3 from .common
import InfoExtractor
4 from ..utils
import parse_duration
7 class Canalc2IE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:(?:www\.)?canalc2\.tv/video/|archives-canalc2\.u-strasbg\.fr/video\.asp\?.*\bidVideo=)(?P<id>\d+)'
12 'url': 'http://www.canalc2.tv/video/12163',
13 'md5': '060158428b650f896c542dfbb3d6487f',
17 'title': 'Terrasses du Numérique',
21 'url': 'http://archives-canalc2.u-strasbg.fr/video.asp?idVideo=11427&voir=oui',
22 'only_matching': True,
25 def _real_extract(self
, url
):
26 video_id
= self
._match
_id
(url
)
28 webpage
= self
._download
_webpage
(
29 f
'http://www.canalc2.tv/video/{video_id}', video_id
)
31 title
= self
._html
_search
_regex
(
32 r
'(?s)class="[^"]*col_description[^"]*">.*?<h3>(.+?)</h3>',
36 for _
, video_url
in re
.findall(r
'file\s*=\s*(["\'])(.+?
)\
1', webpage):
37 if video_url.startswith('rtmp
://'):
39 r'^
(?P
<url
>rtmp
://[^
/]+/(?P
<app
>.+/))(?P
<play_path
>mp4
:.+)$
', video_url)
41 'url
': rtmp.group('url
'),
44 'app
': rtmp.group('app
'),
45 'play_path
': rtmp.group('play_path
'),
59 info = self._parse_html5_media_entries(url, webpage, url)[0]
64 'duration
': parse_duration(self._search_regex(
65 r'id=["\']video_duree["\'][^
>]*>([^
<]+)',
66 webpage, 'duration
', fatal=False)),