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 'http
://www
.ultimedia
.com
/deliver
/video?video
=%s&topic
=%s' % (video_id, 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 self._sort_formats(formats)
86 title = deliver_info['title
']
87 thumbnail = jwconf.get('image
')
88 duration = int_or_none(deliver_info.get('duration
'))
89 timestamp = int_or_none(deliver_info.get('release_time
'))
90 uploader_id = deliver_info.get('owner_id
')
95 'thumbnail
': thumbnail,
97 'timestamp
': timestamp,
98 'uploader_id
': uploader_id,