]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/canalc2.py
3d8d7f9d2dee4713b467e47ab79bbb55edccf147
4 from .common
import InfoExtractor
7 class Canalc2IE(InfoExtractor
):
9 _VALID_URL
= r
'http://.*?\.canalc2\.tv/video\.asp\?.*?idVideo=(?P<id>\d+)'
12 u
'url': u
'http://www.canalc2.tv/video.asp?idVideo=12163&voir=oui',
13 u
'file': u
'12163.mp4',
14 u
'md5': u
'060158428b650f896c542dfbb3d6487f',
16 u
'title': u
'Terrasses du Numérique'
20 def _real_extract(self
, url
):
21 video_id
= re
.match(self
._VALID
_URL
, url
).group('id')
22 # We need to set the voir field for getting the file name
23 url
= 'http://www.canalc2.tv/video.asp?idVideo=%s&voir=oui' % video_id
24 webpage
= self
._download
_webpage
(url
, video_id
)
25 file_name
= self
._search
_regex
(
26 r
"so\.addVariable\('file','(.*?)'\);",
28 video_url
= 'http://vod-flash.u-strasbg.fr:8080/' + file_name
30 title
= self
._html
_search
_regex
(
31 r
'class="evenement8">(.*?)</a>', webpage
, u
'title')
33 return {'id': video_id
,