]> git.bitcoin.ninja Git - youtube-dl/blob - youtube_dl/extractor/unistra.py
Implement a different adult sites checking algorithm
[youtube-dl] / youtube_dl / extractor / unistra.py
1 import re
2
3 from .common import InfoExtractor
4
5 class UnistraIE(InfoExtractor):
6     _VALID_URL = r'http://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(\d+)'
7
8     _TEST = {
9         u'url': u'http://utv.unistra.fr/video.php?id_video=154',
10         u'file': u'154.mp4',
11         u'md5': u'736f605cfdc96724d55bb543ab3ced24',
12         u'info_dict': {
13             u'title': u'M!ss Yella',
14             u'description': u'md5:104892c71bd48e55d70b902736b81bbf',
15         },
16     }
17
18     def _real_extract(self, url):
19         id = re.match(self._VALID_URL, url).group(1)
20         webpage = self._download_webpage(url, id)
21         file = re.search(r'file: "(.*?)",', webpage).group(1)
22         title = self._html_search_regex(r'<title>UTV - (.*?)</', webpage, u'title')
23
24         video_url = 'http://vod-flash.u-strasbg.fr:8080/' + file
25
26         return {'id': id,
27                 'title': title,
28                 'ext': 'mp4',
29                 'url': video_url,
30                 'description': self._html_search_regex(r'<meta name="Description" content="(.*?)"', webpage, u'description', flags=re.DOTALL),
31                 'thumbnail': self._search_regex(r'image: "(.*?)"', webpage, u'thumbnail'),
32                 }