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