1 from .common
import InfoExtractor
10 class TelegraafIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?telegraaf\.nl/video/(?P<id>\d+)'
13 'url': 'https://www.telegraaf.nl/video/734366489/historisch-scheepswrak-slaat-na-100-jaar-los',
17 'title': 'Historisch scheepswrak slaat na 100 jaar los',
18 'description': 'md5:6f53b7c4f55596722ac24d6c0ec00cfb',
19 'thumbnail': r
're:^https?://.*\.jpg',
21 'timestamp': 1572805527,
22 'upload_date': '20191103',
26 'skip_download': True,
30 def _real_extract(self
, url
):
31 article_id
= self
._match
_id
(url
)
33 video_id
= self
._download
_json
(
34 'https://app.telegraaf.nl/graphql', article_id
,
35 headers
={'User-Agent': 'De Telegraaf/6.8.11 (Android 11; en_US)'},
43 }''' % article_id
, # noqa: UP031
44 })['data']['article']['videos'][0]['videoId']
46 item
= self
._download
_json
(
47 f
'https://content.tmgvideo.nl/playlist/item={video_id}/playlist.json',
52 locations
= item
.get('locations') or {}
53 for location
in locations
.get('adaptive', []):
54 manifest_url
= location
.get('src')
57 ext
= determine_ext(manifest_url
)
59 formats
.extend(self
._extract
_m
3u8_formats
(
60 manifest_url
, video_id
, ext
='mp4', m3u8_id
='hls', fatal
=False))
62 formats
.extend(self
._extract
_mpd
_formats
(
63 manifest_url
, video_id
, mpd_id
='dash', fatal
=False))
65 self
.report_warning(f
'Unknown adaptive format {ext}')
66 for location
in locations
.get('progressive', []):
67 src
= try_get(location
, lambda x
: x
['sources'][0]['src'])
70 label
= location
.get('label')
73 'width': int_or_none(location
.get('width')),
74 'height': int_or_none(location
.get('height')),
75 'format_id': 'http' + (f
'-{label}' if label
else ''),
81 'description': item
.get('description'),
83 'duration': int_or_none(item
.get('duration')),
84 'thumbnail': item
.get('poster'),
85 'timestamp': parse_iso8601(item
.get('datecreated'), ' '),