1 from .common
import InfoExtractor
9 class TweakersIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://tweakers\.net/video/(?P<id>\d+)'
12 'url': 'https://tweakers.net/video/9926/new-nintendo-3ds-xl-op-alle-fronten-beter.html',
13 'md5': 'fe73e417c093a788e0160c4025f88b15',
17 'title': 'New Nintendo 3DS XL - Op alle fronten beter',
18 'description': 'md5:3789b21fed9c0219e9bcaacd43fab280',
19 'thumbnail': r
're:^https?://.*\.jpe?g$',
21 'uploader_id': 's7JeEm',
25 def _real_extract(self
, url
):
26 video_id
= self
._match
_id
(url
)
27 video_data
= self
._download
_json
(
28 f
'https://tweakers.net/video/s1playlist/{video_id}/1920/1080/playlist.json',
31 title
= video_data
['title']
34 for location
in video_data
.get('locations', {}).get('progressive', []):
35 format_id
= location
.get('label')
36 width
= int_or_none(location
.get('width'))
37 height
= int_or_none(location
.get('height'))
38 for source
in location
.get('sources', []):
39 source_url
= source
.get('src')
42 ext
= mimetype2ext(source
.get('type')) or determine_ext(source_url
)
44 'format_id': format_id
,
54 'description': video_data
.get('description'),
55 'thumbnail': video_data
.get('poster'),
56 'duration': int_or_none(video_data
.get('duration')),
57 'uploader_id': video_data
.get('account'),