3 from .common
import InfoExtractor
10 from ..utils
.traversal
import traverse_obj
13 class CloudyCDNIE(InfoExtractor
):
14 _VALID_URL
= r
'(?:https?:)?//embed\.cloudycdn\.services/(?P<site_id>[^/?#]+)/media/(?P<id>[\w-]+)'
15 _EMBED_REGEX
= [rf
'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
17 'url': 'https://embed.cloudycdn.services/ltv/media/46k_d23-6000-105?',
18 'md5': '64f72a360ca530d5ed89c77646c9eee5',
20 'id': '46k_d23-6000-105',
22 'timestamp': 1700589151,
24 'upload_date': '20231121',
25 'title': 'D23-6000-105_cetstud',
26 'thumbnail': 'https://store.cloudycdn.services/tmsp00060/assets/media/660858/placeholder1700589200.jpg',
29 'url': 'https://embed.cloudycdn.services/izm/media/26e_lv-8-5-1',
30 'md5': '798828a479151e2444d8dcfbec76e482',
35 'timestamp': 1669767167,
36 'thumbnail': 'https://store.cloudycdn.services/tmsp00120/assets/media/488306/placeholder1679423604.jpg',
38 'upload_date': '20221130',
41 # Video-only m3u8 formats need manual fixup
42 'url': 'https://embed.cloudycdn.services/ltv/media/08j_d24-6000-074',
43 'md5': 'fc472e40f6e6238446509be411c920e2',
45 'id': '08j_d24-6000-074',
47 'upload_date': '20240620',
49 'title': 'D24-6000-074-cetstud',
50 'timestamp': 1718902233,
51 'thumbnail': 'https://store.cloudycdn.services/tmsp00060/assets/media/788392/placeholder1718903938.jpg',
53 'params': {'format': 'bv'},
56 'url': 'https://www.tavaklase.lv/video/es-esmu-mina-um-2/',
57 'md5': '63074e8e6c84ac2a01f2fb8bf03b8f43',
61 'upload_date': '20230223',
63 'thumbnail': 'https://store.cloudycdn.services/tmsp00120/assets/media/518407/placeholder1678748124.jpg',
64 'timestamp': 1677181513,
69 def _real_extract(self
, url
):
70 site_id
, video_id
= self
._match
_valid
_url
(url
).group('site_id', 'id')
72 data
= self
._download
_json
(
73 f
'https://player.cloudycdn.services/player/{site_id}/media/{video_id}/',
74 video_id
, data
=urlencode_postdata({
79 formats
, subtitles
= [], {}
80 for m3u8_url
in traverse_obj(data
, ('source', 'sources', ..., 'src', {url_or_none}
)):
81 fmts
, subs
= self
._extract
_m
3u8_formats
_and
_subtitles
(m3u8_url
, video_id
, fatal
=False)
83 if re
.search(r
'chunklist_b\d+_vo_', fmt
['url']):
84 fmt
['acodec'] = 'none'
86 self
._merge
_subtitles
(subs
, target
=subtitles
)
91 'subtitles': subtitles
,
92 **traverse_obj(data
, {
93 'title': ('name', {str}
),
94 'duration': ('duration', {int_or_none}
),
95 'timestamp': ('upload_date', {parse_iso8601}
),
96 'thumbnail': ('source', 'poster', {url_or_none}
),