1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-01 22:47:59 +00:00

[9gag] Make post view regex more robust

This commit is contained in:
Sergey M․ 2015-09-23 01:44:38 +06:00
parent 6400f8ec0f
commit 5600e214c3

View file

@ -59,7 +59,8 @@ class NineGagIE(InfoExtractor):
webpage = self._download_webpage(url, display_id) webpage = self._download_webpage(url, display_id)
post_view = json.loads(self._html_search_regex( 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 ie_key = None
source_url = post_view.get('sourceUrl') source_url = post_view.get('sourceUrl')