]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/ina.py
652f19b7b8ea689d7861b04f6ff421c144c300d9
3 from .common
import InfoExtractor
6 class InaIE(InfoExtractor
):
7 """Information Extractor for Ina.fr"""
8 _VALID_URL
= r
'(?:http://)?(?:www\.)?ina\.fr/video/(?P<id>I?[A-F0-9]+)/.*'
10 u
'url': u
'www.ina.fr/video/I12055569/francois-hollande-je-crois-que-c-est-clair-video.html',
11 u
'file': u
'I12055569.mp4',
12 u
'md5': u
'a667021bf2b41f8dc6049479d9bb38a3',
14 u
"title": u
"Fran\u00e7ois Hollande \"Je crois que c'est clair\""
18 def _real_extract(self
,url
):
19 mobj
= re
.match(self
._VALID
_URL
, url
)
21 video_id
= mobj
.group('id')
22 mrss_url
='http://player.ina.fr/notices/%s.mrss' % video_id
23 video_extension
= 'mp4'
24 webpage
= self
._download
_webpage
(mrss_url
, video_id
)
26 self
.report_extraction(video_id
)
28 video_url
= self
._html
_search
_regex
(r
'<media:player url="(?P<mp4url>http://mp4.ina.fr/[^"]+\.mp4)',
29 webpage
, u
'video URL')
31 video_title
= self
._search
_regex
(r
'<title><!\[CDATA\[(?P<titre>.*?)]]></title>',
37 'ext': video_extension
,