[WDR] use _download_json with a strip_jsonp
authorBoris Wachtmeister <boris-code@gmx.com>
Thu, 26 May 2016 14:59:45 +0000 (16:59 +0200)
committerBoris Wachtmeister <boris-code@gmx.com>
Thu, 26 May 2016 18:54:51 +0000 (20:54 +0200)
youtube_dl/extractor/wdr.py

index 05bfe7deb3b2c9f0a9342e3c121f09930c655e26..73a343c69bc0fe94cdf767e85a5444d2d91f0bd6 100644 (file)
@@ -9,6 +9,7 @@ from ..compat import (
     compat_urlparse,
 )
 from ..utils import (
+    strip_jsonp,
     unified_strdate,
     ExtractorError,
 )
@@ -112,9 +113,8 @@ class WDRIE(InfoExtractor):
 
             raise ExtractorError('No downloadable streams found', expected=True)
 
-        js_data = self._download_webpage(js_url, 'metadata')
-        json_data = self._search_regex(r'\(({.*})\)', js_data, 'json')
-        metadata = self._parse_json(json_data, display_id)
+        metadata = self._download_json(
+            js_url, 'metadata', transform_source=strip_jsonp)
 
         metadata_tracker_data = metadata['trackerData']
         metadata_media_resource = metadata['mediaResource']