Skip to content

Commit

Permalink
[9now] Fix extraction (closes #22361)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw authored and pareronia committed Jun 22, 2020
1 parent fc04df2 commit a77c0d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion youtube_dl/extractor/ninenow.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def _real_extract(self, url):
webpage = self._download_webpage(url, display_id)
page_data = self._parse_json(self._search_regex(
r'window\.__data\s*=\s*({.*?});', webpage,
'page data'), display_id)
'page data', default='{}'), display_id, fatal=False)
if not page_data:
page_data = self._parse_json(self._parse_json(self._search_regex(
r'window\.__data\s*=\s*JSON\.parse\s*\(\s*(".+?")\s*\)\s*;',
webpage, 'page data'), display_id), display_id)

for kind in ('episode', 'clip'):
current_key = page_data.get(kind, {}).get(
Expand Down

0 comments on commit a77c0d3

Please sign in to comment.