1 from .common
import InfoExtractor
9 class DRBonanzaIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?dr\.dk/bonanza/[^/]+/\d+/[^/]+/(?P<id>\d+)/(?P<display_id>[^/?#&]+)'
12 'url': 'http://www.dr.dk/bonanza/serie/154/matador/40312/matador---0824-komme-fremmede-',
15 'display_id': 'matador---0824-komme-fremmede-',
17 'title': 'MATADOR - 08:24. "Komme fremmede".',
18 'description': 'md5:77b4c1ac4d4c1b9d610ab4395212ff84',
19 'thumbnail': r
're:^https?://.*\.(?:gif|jpg)$',
24 def _real_extract(self
, url
):
25 mobj
= self
._match
_valid
_url
(url
)
26 video_id
, display_id
= mobj
.group('id', 'display_id')
28 webpage
= self
._download
_webpage
(url
, display_id
)
30 info
= self
._parse
_html
5_media
_entries
(
31 url
, webpage
, display_id
, m3u8_id
='hls',
32 m3u8_entry_protocol
='m3u8_native')[0]
34 asset
= self
._parse
_json
(
36 r
'(?s)currentAsset\s*=\s*({.+?})\s*</script', webpage
, 'asset'),
37 display_id
, transform_source
=js_to_json
)
39 title
= unescapeHTML(asset
['AssetTitle']).strip()
42 return self
._search
_regex
(
43 rf
'<div[^>]+>\s*<p>{field}:<p>\s*</div>\s*<div[^>]+>\s*<p>([^<]+)</p>',
44 webpage
, field
, default
=None)
47 'id': asset
.get('AssetId') or video_id
,
48 'display_id': display_id
,
50 'description': extract('Programinfo'),
51 'duration': parse_duration(extract('Tid')),
52 'thumbnail': asset
.get('AssetImageUrl'),