From: Sergey M․ Date: Tue, 22 Sep 2015 19:48:13 +0000 (+0600) Subject: [9gag] Modernize X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=c659022b5cabebaba3275df2d0f4ae97b468eac8;p=youtube-dl [9gag] Modernize --- diff --git a/youtube_dl/extractor/ninegag.py b/youtube_dl/extractor/ninegag.py index 6daae7318..d8e103189 100644 --- a/youtube_dl/extractor/ninegag.py +++ b/youtube_dl/extractor/ninegag.py @@ -58,9 +58,11 @@ class NineGagIE(InfoExtractor): webpage = self._download_webpage(url, display_id) - post_view = json.loads(self._html_search_regex( - r'var\s+postView\s*=\s*new\s+app\.PostView\({\s*post:\s*({.+?})\s*,\s*posts:\s*prefetchedCurrentPost', - webpage, 'post view')) + post_view = self._parse_json( + self._search_regex( + r'var\s+postView\s*=\s*new\s+app\.PostView\({\s*post:\s*({.+?})\s*,\s*posts:\s*prefetchedCurrentPost', + webpage, 'post view'), + display_id) ie_key = None source_url = post_view.get('sourceUrl')