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.

33 lines
1.0 KiB

11 years ago
11 years ago
  1. from __future__ import unicode_literals
  2. import re
  3. from .common import InfoExtractor
  4. class WimpIE(InfoExtractor):
  5. _VALID_URL = r'http://(?:www\.)?wimp\.com/([^/]+)/'
  6. _TEST = {
  7. 'url': 'http://www.wimp.com/maruexhausted/',
  8. 'md5': 'f1acced123ecb28d9bb79f2479f2b6a1',
  9. 'info_dict': {
  10. 'id': 'maruexhausted',
  11. 'ext': 'flv',
  12. 'title': 'Maru is exhausted.',
  13. 'description': 'md5:57e099e857c0a4ea312542b684a869b8',
  14. }
  15. }
  16. def _real_extract(self, url):
  17. mobj = re.match(self._VALID_URL, url)
  18. video_id = mobj.group(1)
  19. webpage = self._download_webpage(url, video_id)
  20. video_url = self._search_regex(
  21. r's1\.addVariable\("file",\s*"([^"]+)"\);', webpage, 'video URL')
  22. return {
  23. 'id': video_id,
  24. 'url': video_url,
  25. 'title': self._og_search_title(webpage),
  26. 'thumbnail': self._og_search_thumbnail(webpage),
  27. 'description': self._og_search_description(webpage),
  28. }