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.

35 lines
1.0 KiB

  1. # coding: utf-8
  2. import re
  3. from .common import InfoExtractor
  4. class Canalc2IE(InfoExtractor):
  5. IE_NAME = 'canalc2.tv'
  6. _VALID_URL = r'http://.*?\.canalc2\.tv/video\.asp\?idVideo=(\d+)&voir=oui'
  7. _TEST = {
  8. u'url': u'http://www.canalc2.tv/video.asp?idVideo=12163&voir=oui',
  9. u'file': u'12163.mp4',
  10. u'md5': u'060158428b650f896c542dfbb3d6487f',
  11. u'info_dict': {
  12. u'title': u'Terrasses du Numérique'
  13. }
  14. }
  15. def _real_extract(self, url):
  16. video_id = re.match(self._VALID_URL, url).group(1)
  17. webpage = self._download_webpage(url, video_id)
  18. file_name = self._search_regex(
  19. r"so\.addVariable\('file','(.*?)'\);",
  20. webpage, 'file name')
  21. video_url = 'http://vod-flash.u-strasbg.fr:8080/' + file_name
  22. title = self._html_search_regex(
  23. r'class="evenement8">(.*?)</a>', webpage, u'title')
  24. return {'id': video_id,
  25. 'ext': 'mp4',
  26. 'url': video_url,
  27. 'title': title,
  28. }