1 from .common
import InfoExtractor
2 from ..utils
import int_or_none
5 class DigitekaIE(InfoExtractor
):
7 https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
25 )/(?P<id>[\d+a-z]+)'''
26 _EMBED_REGEX
= [r
'<(?:iframe|script)[^>]+src=["\'](?P
<url
>(?
:https?
:)?
//(?
:www\
.)?ultimedia\
.com
/deliver
/(?
:generic|musique
)(?
:/[^
/]+)*/(?
:src|article
)/[\d
+a
-z
]+)']
29 'url
': 'https
://www
.ultimedia
.com
/default
/index
/videogeneric
/id/s8uk0r
',
30 'md5
': '276a0e49de58c7e85d32b057837952a2
',
34 'title
': 'Loi sur la fin de vie
: le texte prévoit un renforcement des directives anticipées
',
35 'thumbnail
': r're
:^https?
://.*\
.jpg
',
37 'upload_date
': '20150317',
38 'timestamp
': 1426604939,
39 'uploader_id
': '3fszv
',
43 'url
': 'https
://www
.ultimedia
.com
/default
/index
/videomusic
/id/xvpfp8
',
44 'md5
': '2ea3513813cf230605c7e2ffe7eca61c
',
48 'title
': 'Two
- C
\'est La
Vie (clip
)',
49 'thumbnail
': r're
:^https?
://.*\
.jpg
',
51 'upload_date
': '20150224',
52 'timestamp
': 1424760500,
53 'uploader_id
': '3rfzk
',
56 'url
': 'https
://www
.digiteka
.net
/deliver
/generic
/iframe
/mdtk
/01637594/src
/lqm3kl
/zone
/1/showtitle
/1/autoplay
/yes
',
57 'only_matching
': True,
60 def _real_extract(self, url):
61 mobj = self._match_valid_url(url)
62 video_id = mobj.group('id')
63 video_type = mobj.group('embed_type
') or mobj.group('site_type
')
64 if video_type == 'music
':
65 video_type = 'musique
'
67 deliver_info = self._download_json(
68 f'http
://www
.ultimedia
.com
/deliver
/video?video
={video_id}
&topic
={video_type}
',
71 yt_id = deliver_info.get('yt_id
')
73 return self.url_result(yt_id, 'Youtube
')
75 jwconf = deliver_info['jwconf
']
78 for source in jwconf['playlist
'][0]['sources
']:
80 'url
': source['file'],
81 'format_id
': source.get('label
'),
84 title = deliver_info['title
']
85 thumbnail = jwconf.get('image
')
86 duration = int_or_none(deliver_info.get('duration
'))
87 timestamp = int_or_none(deliver_info.get('release_time
'))
88 uploader_id = deliver_info.get('owner_id
')
93 'thumbnail
': thumbnail,
95 'timestamp
': timestamp,
96 'uploader_id
': uploader_id,