[9gag] Make post view regex more robust
authorSergey M․ <dstftw@gmail.com>
Tue, 22 Sep 2015 19:44:38 +0000 (01:44 +0600)
committerSergey M․ <dstftw@gmail.com>
Tue, 22 Sep 2015 19:44:38 +0000 (01:44 +0600)
youtube_dl/extractor/ninegag.py

index d157b0d1023ea5ab10e58fe538a6424bb8f4069c..692cc3368f17ab80c6ea0132b8ba6eefa3ef9120 100644 (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')