diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-08-19 20:39:28 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-08-19 20:39:28 +0800 |
commit | b82232036a019e340b715779108c3f4caea8a78d (patch) | |
tree | 11766b5c3074d917e52634609d4eb6c8b65fcad2 /youtube_dl/extractor/ntvde.py | |
parent | e4659b45474acb563db0ab4284abdfc80837307e (diff) |
[n-tv.de] Fix extraction (closes #10331)
Diffstat (limited to 'youtube_dl/extractor/ntvde.py')
-rw-r--r-- | youtube_dl/extractor/ntvde.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/youtube_dl/extractor/ntvde.py b/youtube_dl/extractor/ntvde.py index a83e85cb8..d28a81542 100644 --- a/youtube_dl/extractor/ntvde.py +++ b/youtube_dl/extractor/ntvde.py @@ -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 = [] |