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.

40 lines
1.4 KiB

  1. import re
  2. # -*- coding: utf-8 -*-
  3. # needed for the title french ê! coding utf-8- -*-
  4. # based on the vine.co and lots of help from https://filippo.io/add-support-for-a-new-video-site-to-youtube-dl/
  5. from .common import InfoExtractor
  6. class TelembIE(InfoExtractor):
  7. _VALID_URL = r'https?://www\.telemb\.be/(?P<id>.*)'
  8. _TEST = {
  9. u'url': u'http://www.telemb.be/mons-cook-with-danielle-des-cours-de-cuisine-en-anglais-_d_13466.html',
  10. u'file': u'mons-cook-with-danielle-des-cours-de-cuisine-en-anglais-_d_13466.html.mp4',
  11. u'md5': u'f45ea69878516ba039835794e0f8f783',
  12. u'info_dict': {
  13. u"title": u'TéléMB : Mons - Cook with Danielle : des cours de cuisine en anglais ! - Les reportages'
  14. }
  15. }
  16. def _real_extract(self, url):
  17. mobj = re.match(self._VALID_URL, url)
  18. video_id = mobj.group('id')
  19. webpage_url = 'http://www.telemb.be/' + video_id
  20. webpage = self._download_webpage(webpage_url, video_id)
  21. self.report_extraction(video_id)
  22. video_url = self._html_search_regex(r'"(http://wowza\.imust\.org/srv/vod/.*\.mp4)"',
  23. webpage, u'video URL')
  24. return [{
  25. 'id': video_id,
  26. 'url': video_url,
  27. 'ext': 'mp4',
  28. 'title': self._og_search_title(webpage),
  29. 'thumbnail': self._og_search_thumbnail(webpage),
  30. }]