]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/dumpert.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
11 class DumpertIE(InfoExtractor
):
12 _VALID_URL
= r
'(?P<protocol>https?)://(?:(?:www|legacy)\.)?dumpert\.nl/(?:mediabase|embed|item)/(?P<id>[0-9]+[/_][0-9a-zA-Z]+)'
14 'url': 'https://www.dumpert.nl/item/6646981_951bc60f',
15 'md5': '1b9318d7d5054e7dcb9dc7654f21d643',
17 'id': '6646981/951bc60f',
19 'title': 'Ik heb nieuws voor je',
20 'description': 'Niet schrikken hoor',
21 'thumbnail': r
're:^https?://.*\.jpg$',
24 'url': 'https://www.dumpert.nl/embed/6675421_dc440fe7',
25 'only_matching': True,
27 'url': 'http://legacy.dumpert.nl/mediabase/6646981/951bc60f',
28 'only_matching': True,
30 'url': 'http://legacy.dumpert.nl/embed/6675421/dc440fe7',
31 'only_matching': True,
34 def _real_extract(self
, url
):
35 video_id
= self
._match
_id
(url
).replace('_', '/')
36 item
= self
._download
_json
(
37 'http://api-live.dumpert.nl/mobile_api/json/info/' + video_id
.replace('/', '_'),
40 media
= next(m
for m
in item
['media'] if m
.get('mediatype') == 'VIDEO')
42 quality
= qualities(['flv', 'mobile', 'tablet', '720p'])
44 for variant
in media
.get('variants', []):
45 uri
= variant
.get('uri')
48 version
= variant
.get('version')
52 'quality': quality(version
),
54 self
._sort
_formats
(formats
)
57 stills
= item
.get('stills') or {}
58 for t
in ('thumb', 'still'):
59 for s
in ('', '-medium', '-large'):
61 still_url
= stills
.get(still_id
)
69 stats
= item
.get('stats') or {}
74 'description': item
.get('description'),
75 'thumbnails': thumbnails
,
77 'duration': int_or_none(media
.get('duration')),
78 'like_count': int_or_none(stats
.get('kudos_total')),
79 'view_count': int_or_none(stats
.get('views_total')),