1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-22 07:43:08 +00:00

[n-tv.de] Fix extraction (closes #10331)

This commit is contained in:
Yen Chi Hsuan 2016-08-19 20:39:28 +08:00
parent e4659b4547
commit b82232036a
No known key found for this signature in database
GPG key ID: 3FDDD575826C5C30
2 changed files with 8 additions and 3 deletions

View file

@ -3,6 +3,9 @@ version <unreleased>
Core Core
* Fix js_to_json(): correct octal or hexadecimal number detection * Fix js_to_json(): correct octal or hexadecimal number detection
Extractors
* [n-tv.de] Fix extraction (#10331)
version 2016.08.19 version 2016.08.19

View file

@ -1,6 +1,8 @@
# encoding: utf-8 # coding: utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
import re
from .common import InfoExtractor from .common import InfoExtractor
from ..compat import compat_urlparse from ..compat import compat_urlparse
from ..utils import ( from ..utils import (
@ -40,8 +42,8 @@ class NTVDeIE(InfoExtractor):
timestamp = int_or_none(info.get('publishedDateAsUnixTimeStamp')) timestamp = int_or_none(info.get('publishedDateAsUnixTimeStamp'))
vdata = self._parse_json(self._search_regex( vdata = self._parse_json(self._search_regex(
r'(?s)\$\(\s*"\#player"\s*\)\s*\.data\(\s*"player",\s*(\{.*?\})\);', r'(?s)\$\(\s*"\#player"\s*\)\s*\.data\(\s*"player",\s*(\{.*?\})\);',
webpage, 'player data'), webpage, 'player data'), video_id,
video_id, transform_source=js_to_json) transform_source=lambda s: js_to_json(re.sub(r'advertising:\s*{[^}]+},', '', s)))
duration = parse_duration(vdata.get('duration')) duration = parse_duration(vdata.get('duration'))
formats = [] formats = []