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.

29 lines
836 B

  1. import re
  2. from .common import InfoExtractor
  3. class RedTubeIE(InfoExtractor):
  4. _VALID_URL = r'(?:http://)?(?:www\.)?redtube\.com/(?P<id>[0-9]+)'
  5. def _real_extract(self,url):
  6. mobj = re.match(self._VALID_URL, url)
  7. video_id = mobj.group('id')
  8. video_extension = 'mp4'
  9. webpage = self._download_webpage(url, video_id)
  10. self.report_extraction(video_id)
  11. video_url = self._html_search_regex(r'<source src="(.+?)" type="video/mp4">',
  12. webpage, u'video URL')
  13. video_title = self._html_search_regex('<h1 class="videoTitle slidePanelMovable">(.+?)</h1>',
  14. webpage, u'title')
  15. return [{
  16. 'id': video_id,
  17. 'url': video_url,
  18. 'ext': video_extension,
  19. 'title': video_title,
  20. }]