From 0a84430461e2f3885053db1620ddda00451a17eb Mon Sep 17 00:00:00 2001 From: bubbleguuum Date: Mon, 21 Mar 2016 13:36:57 +0100 Subject: [PATCH 1/2] fixes streams parsing --- youtube_dl/extractor/tunein.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/tunein.py b/youtube_dl/extractor/tunein.py index 8322cc14d..8b9b64763 100644 --- a/youtube_dl/extractor/tunein.py +++ b/youtube_dl/extractor/tunein.py @@ -29,9 +29,9 @@ class TuneInBaseIE(InfoExtractor): stream_data = self._download_webpage( streams_url, content_id, note='Downloading stream data') - streams = json.loads(self._search_regex( - r'\((.*)\);', stream_data, 'stream info'))['Streams'] - + + streams = json.loads(stream_data).get('Streams') + is_live = None formats = [] for stream in streams: From 9795b404f9a9b022b66dc2a606b31c9ea44ff845 Mon Sep 17 00:00:00 2001 From: bubbleguuum Date: Mon, 21 Mar 2016 17:22:16 +0100 Subject: [PATCH 2/2] [tunein] fix Stations parsing --- youtube_dl/extractor/tunein.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/youtube_dl/extractor/tunein.py b/youtube_dl/extractor/tunein.py index 8b9b64763..88f5200d0 100644 --- a/youtube_dl/extractor/tunein.py +++ b/youtube_dl/extractor/tunein.py @@ -30,6 +30,9 @@ class TuneInBaseIE(InfoExtractor): stream_data = self._download_webpage( streams_url, content_id, note='Downloading stream data') + if stream_data.startswith('('): + stream_data = self._search_regex(r'\((.*)\);', stream_data, 'stream info') + streams = json.loads(stream_data).get('Streams') is_live = None