]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[n-tv.de] Fix extraction (closes #10331)
authorYen Chi Hsuan <yan12125@gmail.com>
Fri, 19 Aug 2016 12:39:28 +0000 (20:39 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Fri, 19 Aug 2016 12:39:28 +0000 (20:39 +0800)
ChangeLog
youtube_dl/extractor/ntvde.py

index 98a3dbca3bde37e951236400ae92d4b2792a44b2..6281fe325a7ef9791ba890351cd1326fc167eeb9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@ version <unreleased>
 Core
 * Fix js_to_json(): correct octal or hexadecimal number detection
 
+Extractors
+* [n-tv.de] Fix extraction (#10331)
+
 
 version 2016.08.19
 
index a83e85cb8109ef44468851355f2b522e22fc5831..d28a8154247f75cbc612f7999083cd60275c5a88 100644 (file)
@@ -1,6 +1,8 @@
-# encoding: utf-8
+# coding: utf-8
 from __future__ import unicode_literals
 
+import re
+
 from .common import InfoExtractor
 from ..compat import compat_urlparse
 from ..utils import (
@@ -40,8 +42,8 @@ class NTVDeIE(InfoExtractor):
         timestamp = int_or_none(info.get('publishedDateAsUnixTimeStamp'))
         vdata = self._parse_json(self._search_regex(
             r'(?s)\$\(\s*"\#player"\s*\)\s*\.data\(\s*"player",\s*(\{.*?\})\);',
-            webpage, 'player data'),
-            video_id, transform_source=js_to_json)
+            webpage, 'player data'), video_id,
+            transform_source=lambda s: js_to_json(re.sub(r'advertising:\s*{[^}]+},', '', s)))
         duration = parse_duration(vdata.get('duration'))
 
         formats = []