You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1.2 KiB

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