From 8a2c65cfad856ee72257026ff900b4f5a9990e64 Mon Sep 17 00:00:00 2001 From: Jakob Cornell Date: Mon, 5 Oct 2020 22:23:38 -0500 Subject: [PATCH] Fix attr list parsing bugs --- hls_watch/playlist.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hls_watch/playlist.py b/hls_watch/playlist.py index 36fe912..f964b4c 100644 --- a/hls_watch/playlist.py +++ b/hls_watch/playlist.py @@ -118,7 +118,7 @@ def _parse_attrs(string): # decimal-resolution m = re.match(r'(?P\d+)x(?P\d+)(?P,.+|$)$', string) if m: - return Resolution._make(map(int, m.groups())) + return (Resolution(int(m.group('h')), int(m.group('v'))), m.group('rest')) m = re.match('(?P[^,]*)(?P,.+|$)$', string) return m.groups() @@ -130,6 +130,7 @@ def _parse_attrs(string): assert rest[0] == '=' (val, rest) = pop_value(rest[1:]) items.append((key, val)) + rest = rest.lstrip(',') attrs = dict(items) assert len(attrs) == len(items) -- 2.30.2