savefrom.py 1010 B

12345678910111213141516171819202122232425262728293031
  1. import os.path
  2. from .common import InfoExtractor
  3. class SaveFromIE(InfoExtractor):
  4. IE_NAME = 'savefrom.net'
  5. _VALID_URL = r'https?://[^.]+\.savefrom\.net/\#url=(?P<url>.*)$'
  6. _TEST = {
  7. 'url': 'http://en.savefrom.net/#url=http://youtube.com/watch?v=UlVRAPW2WJY&utm_source=youtube.com&utm_medium=short_domains&utm_campaign=ssyoutube.com',
  8. 'info_dict': {
  9. 'id': 'UlVRAPW2WJY',
  10. 'ext': 'mp4',
  11. 'title': 'About Team Radical MMA | MMA Fighting',
  12. 'upload_date': '20120816',
  13. 'uploader': 'Howcast',
  14. 'uploader_id': 'Howcast',
  15. 'description': r're:(?s).* Hi, my name is Rene Dreifuss\. And I\'m here to show you some MMA.*',
  16. },
  17. 'params': {
  18. 'skip_download': True
  19. }
  20. }
  21. def _real_extract(self, url):
  22. mobj = self._match_valid_url(url)
  23. video_id = os.path.splitext(url.split('/')[-1])[0]
  24. return self.url_result(mobj.group('url'), video_id=video_id)