Browse Source

[9gag] Make post view regex more robust

totalwebcasting
Sergey M․ 9 years ago
parent
commit
5600e214c3
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      youtube_dl/extractor/ninegag.py

+ 2
- 1
youtube_dl/extractor/ninegag.py View File

@ -59,7 +59,8 @@ class NineGagIE(InfoExtractor):
webpage = self._download_webpage(url, display_id)
post_view = json.loads(self._html_search_regex(
r'var postView = new app\.PostView\({\s*post:\s*({.+?}),\s*posts:\s*prefetchedCurrentPost', webpage, 'post view'))
r'var\s+postView\s*=\s*new\s+app\.PostView\({\s*post:\s*({.+?})\s*,\s*posts:\s*prefetchedCurrentPost',
webpage, 'post view'))
ie_key = None
source_url = post_view.get('sourceUrl')


Loading…
Cancel
Save