3 from .common
import InfoExtractor
4 from ..utils
import qualities
7 class UnistraIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)'
12 'url': 'http://utv.unistra.fr/video.php?id_video=154',
13 'md5': '736f605cfdc96724d55bb543ab3ced24',
17 'title': 'M!ss Yella',
18 'description': 'md5:104892c71bd48e55d70b902736b81bbf',
22 'url': 'http://utv.unistra.fr/index.php?id_video=437',
23 'md5': '1ddddd6cccaae76f622ce29b8779636d',
27 'title': 'Prix Louise Weiss 2014',
28 'description': 'md5:cc3a8735f079f4fb6b0b570fc10c135a',
33 def _real_extract(self
, url
):
34 mobj
= self
._match
_valid
_url
(url
)
35 video_id
= mobj
.group('id')
37 webpage
= self
._download
_webpage
(url
, video_id
)
39 files
= set(re
.findall(r
'file\s*:\s*"(/[^"]+)"', webpage
))
41 quality
= qualities(['SD', 'HD'])
43 for file_path
in files
:
44 format_id
= 'HD' if file_path
.endswith('-HD.mp4') else 'SD'
46 'url': f
'http://vod-flash.u-strasbg.fr:8080{file_path}',
47 'format_id': format_id
,
48 'quality': quality(format_id
),
51 title
= self
._html
_search
_regex
(
52 r
'<title>UTV - (.*?)</', webpage
, 'title')
53 description
= self
._html
_search
_regex
(
54 r
'<meta name="Description" content="(.*?)"', webpage
, 'description', flags
=re
.DOTALL
)
55 thumbnail
= self
._search
_regex
(
56 r
'image: "(.*?)"', webpage
, 'thumbnail')
61 'description': description
,
62 'thumbnail': thumbnail
,