]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/dumpert.py
1 from .common
import InfoExtractor
8 class DumpertIE(InfoExtractor
):
9 _VALID_URL
= r
'(?P<protocol>https?)://(?:(?:www|legacy)\.)?dumpert\.nl/(?:mediabase|embed|item)/(?P<id>[0-9]+[/_][0-9a-zA-Z]+)'
11 'url': 'https://www.dumpert.nl/item/6646981_951bc60f',
12 'md5': '1b9318d7d5054e7dcb9dc7654f21d643',
14 'id': '6646981/951bc60f',
16 'title': 'Ik heb nieuws voor je',
17 'description': 'Niet schrikken hoor',
18 'thumbnail': r
're:^https?://.*\.jpg$',
21 'url': 'https://www.dumpert.nl/embed/6675421_dc440fe7',
22 'only_matching': True,
24 'url': 'http://legacy.dumpert.nl/mediabase/6646981/951bc60f',
25 'only_matching': True,
27 'url': 'http://legacy.dumpert.nl/embed/6675421/dc440fe7',
28 'only_matching': True,
31 def _real_extract(self
, url
):
32 video_id
= self
._match
_id
(url
).replace('_', '/')
33 item
= self
._download
_json
(
34 'http://api-live.dumpert.nl/mobile_api/json/info/' + video_id
.replace('/', '_'),
37 media
= next(m
for m
in item
['media'] if m
.get('mediatype') == 'VIDEO')
39 quality
= qualities(['flv', 'mobile', 'tablet', '720p'])
41 for variant
in media
.get('variants', []):
42 uri
= variant
.get('uri')
45 version
= variant
.get('version')
49 'quality': quality(version
),
53 stills
= item
.get('stills') or {}
54 for t
in ('thumb', 'still'):
55 for s
in ('', '-medium', '-large'):
57 still_url
= stills
.get(still_id
)
65 stats
= item
.get('stats') or {}
70 'description': item
.get('description'),
71 'thumbnails': thumbnails
,
73 'duration': int_or_none(media
.get('duration')),
74 'like_count': int_or_none(stats
.get('kudos_total')),
75 'view_count': int_or_none(stats
.get('views_total')),