1 from .common
import InfoExtractor
8 from ..compat
import compat_urllib_parse_unquote
11 class NozIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?noz\.de/video/(?P<id>[0-9]+)/'
14 'url': 'http://www.noz.de/video/25151/32-Deutschland-gewinnt-Badminton-Lnderspiel-in-Melle',
19 'title': '3:2 - Deutschland gewinnt Badminton-Länderspiel in Melle',
20 'description': 'Vor rund 370 Zuschauern gewinnt die deutsche Badminton-Nationalmannschaft am Donnerstag ein EM-Vorbereitungsspiel gegen Frankreich in Melle. Video Moritz Frankenberg.',
21 'thumbnail': r
're:^http://.*\.jpg',
25 def _real_extract(self
, url
):
26 video_id
= self
._match
_id
(url
)
27 webpage
= self
._download
_webpage
(url
, video_id
)
28 description
= self
._og
_search
_description
(webpage
)
30 edge_url
= self
._html
_search
_regex
(
31 r
'<script\s+(?:type="text/javascript"\s+)?src="(.*?/videojs_.*?)"',
33 edge_content
= self
._download
_webpage
(edge_url
, 'meta configuration')
35 config_url_encoded
= self
._search
_regex
(
36 r
'so\.addVariable\("config_url","[^,]*,(.*?)"',
37 edge_content
, 'config URL'
39 config_url
= compat_urllib_parse_unquote(config_url_encoded
)
41 doc
= self
._download
_xml
(config_url
, 'video configuration')
42 title
= xpath_text(doc
, './/title')
43 thumbnail
= xpath_text(doc
, './/article/thumbnail/url')
44 duration
= int_or_none(xpath_text(
45 doc
, './/article/movie/file/duration'))
47 for qnode
in doc
.findall('.//article/movie/file/qualities/qual'):
48 http_url_ele
= find_xpath_attr(
49 qnode
, './html_urls/video_url', 'format', 'video/mp4')
50 http_url
= http_url_ele
.text
if http_url_ele
is not None else None
54 'format_name': xpath_text(qnode
, './name'),
55 'format_id': '%s-%s' % ('http', xpath_text(qnode
, './id')),
56 'height': int_or_none(xpath_text(qnode
, './height')),
57 'width': int_or_none(xpath_text(qnode
, './width')),
58 'tbr': int_or_none(xpath_text(qnode
, './bitrate'), scale
=1000),
61 f4m_url
= xpath_text(qnode
, 'url_hd2')
63 formats
.extend(self
._extract
_f
4m
_formats
(
64 update_url_query(f4m_url
, {'hdcore': '3.4.0'}
),
65 video_id
, f4m_id
='hds', fatal
=False))
66 m3u8_url_ele
= find_xpath_attr(
67 qnode
, './html_urls/video_url',
68 'format', 'application/vnd.apple.mpegurl')
69 m3u8_url
= m3u8_url_ele
.text
if m3u8_url_ele
is not None else None
71 formats
.extend(self
._extract
_m
3u8_formats
(
72 m3u8_url
, video_id
, 'mp4', 'm3u8_native',
73 m3u8_id
='hls', fatal
=False))
74 self
._sort
_formats
(formats
)
81 'description': description
,
82 'thumbnail': thumbnail
,