diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-12-23 01:10:31 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-12-23 01:16:14 +0600 |
commit | 4c24ed94640b148882f1ceb400127b3b3afcafd4 (patch) | |
tree | 386fcf2f6fc02f7d25ee873556c78a970fd3fa9e /youtube_dl/extractor | |
parent | 11208ebbf164dd6335581ccbdab30a7bb4af63d6 (diff) |
[comcarcoff] Improve json data regex and modernize
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/comcarcoff.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/extractor/comcarcoff.py b/youtube_dl/extractor/comcarcoff.py index 4391b7ce4..edf5b29a0 100644 --- a/youtube_dl/extractor/comcarcoff.py +++ b/youtube_dl/extractor/comcarcoff.py @@ -31,9 +31,10 @@ class ComCarCoffIE(InfoExtractor): display_id = 'comediansincarsgettingcoffee.com' webpage = self._download_webpage(url, display_id) - full_data = json.loads(self._search_regex( - r'\nwindow.app = (?P<json>.+?);\n', - webpage, 'full data json'))['videoData'] + full_data = self._parse_json( + self._search_regex( + r'window\.app\s*=\s*({.+?});\n', webpage, 'full data json'), + display_id)['videoData'] video_id = full_data['activeVideo']['video'] video_data = full_data.get('videos', {}).get(video_id) or full_data['singleshots'][video_id] |