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.

39 lines
1.0 KiB

  1. # encoding: utf-8
  2. from __future__ import unicode_literals
  3. import re
  4. from .common import InfoExtractor
  5. class DumpIE(InfoExtractor):
  6. _VALID_URL = r'^https?://(?:www\.)?dump\.com/(?P<id>[a-zA-Z0-9]+)/'
  7. _TEST = {
  8. 'url': 'http://www.dump.com/oneus/',
  9. 'md5': 'ad71704d1e67dfd9e81e3e8b42d69d99',
  10. 'info_dict': {
  11. 'id': 'oneus',
  12. 'ext': 'flv',
  13. 'title': "He's one of us.",
  14. 'thumbnail': 're:^https?://.*\.jpg$',
  15. },
  16. }
  17. def _real_extract(self, url):
  18. m = re.match(self._VALID_URL, url)
  19. video_id = m.group('id')
  20. webpage = self._download_webpage(url, video_id)
  21. video_url = self._search_regex(
  22. r's1.addVariable\("file",\s*"([^"]+)"', webpage, 'video URL')
  23. thumb = self._og_search_thumbnail(webpage)
  24. title = self._search_regex(r'<b>([^"]+)</b>', webpage, 'title')
  25. return {
  26. 'id': video_id,
  27. 'title': title,
  28. 'url': video_url,
  29. 'thumbnail': thumb,
  30. }