1 from .common
import InfoExtractor
2 from ..utils
import int_or_none
, parse_qs
5 class ToggoIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?:www\.)?toggo\.de/(?:toggolino/)?[^/?#]+/(?:folge|video)/(?P<id>[^/?#]+)'
9 'url': 'https://www.toggo.de/weihnachtsmann--co-kg/folge/ein-geschenk-fuer-zwei',
13 'title': 'Ein Geschenk für zwei',
14 'display_id': 'ein-geschenk-fuer-zwei',
15 'thumbnail': r
're:^https?://.*\.(?:jpg|png)',
16 'description': 'md5:b7715915bfa47824b4e4ad33fb5962f8',
17 'release_timestamp': 1637259179,
18 'series': 'Weihnachtsmann & Co. KG',
19 'season': 'Weihnachtsmann & Co. KG',
21 'season_id': 'VST118',
22 'episode': 'Ein Geschenk für zwei',
24 'episode_id': 'VEP2977',
25 'timestamp': 1581935960,
26 'uploader_id': '6057955896001',
27 'upload_date': '20200217',
29 'params': {'skip_download': True},
31 'url': 'https://www.toggo.de/grizzy--die-lemminge/folge/ab-durch-die-wand-vogelfrei-rock\'n\'lemming',
32 'only_matching': True,
34 'url': 'https://www.toggo.de/toggolino/paw-patrol/folge/der-wetter-zeppelin-der-chili-kochwettbewerb',
35 'only_matching': True,
37 'url': 'https://www.toggo.de/toggolino/paw-patrol/video/paw-patrol-rettung-im-anflug',
38 'only_matching': True,
41 def _real_extract(self
, url
):
42 display_id
= self
._match
_id
(url
)
43 data
= self
._download
_json
(
44 f
'https://production-n.toggo.de/api/assetstore/vod/asset/{display_id}', display_id
)['data']
47 x
['value'] for x
in data
['custom_fields'] if x
.get('key') == 'video-cloud-id')
48 info
= self
._downloader
.get_info_extractor('BrightcoveNew').extract(
49 f
'http://players.brightcove.net/6057955896001/default_default/index.html?videoId={brightcove_id}')
51 for f
in info
['formats']:
52 if '/dash/live/cenc/' in f
.get('fragment_base_url', ''):
53 # Get hidden non-DRM format
54 f
['fragment_base_url'] = f
['fragment_base_url'].replace('/cenc/', '/clear/')
57 if '/fairplay/' in f
.get('manifest_url', ''):
63 'width': int_or_none(next(iter(parse_qs(url
).get('width', [])), None)),
64 } for name
, url
in (data
.get('images') or {}).items()]
69 'display_id': display_id
,
70 'title': data
.get('title'),
71 'language': data
.get('language'),
72 'thumbnails': thumbnails
,
73 'description': data
.get('description'),
74 'release_timestamp': data
.get('earliest_start_date'),
75 'series': data
.get('series_title'),
76 'season': data
.get('season_title'),
77 'season_number': data
.get('season_no'),
78 'season_id': data
.get('season_id'),
79 'episode': data
.get('title'),
80 'episode_number': data
.get('episode_no'),
81 'episode_id': data
.get('id'),