diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-02-22 14:36:04 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-02-22 14:36:16 +0100 |
commit | 41d3ec5fba1b64be78f3ea823a604c28833a94cd (patch) | |
tree | abb7d03c320831b64a0a81ac8a4f374be0aab5c4 | |
parent | 0568c352f331549d2a0b961ba8c7a70e48daed78 (diff) |
[savefrom] Add extractor (Fixes #2434)
-rw-r--r-- | youtube_dl/extractor/__init__.py | 1 | ||||
-rw-r--r-- | youtube_dl/extractor/savefrom.py | 37 |
2 files changed, 38 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index e35287f88..229bdc595 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -186,6 +186,7 @@ from .rutube import ( RutubeMovieIE, RutubePersonIE, ) +from .savefrom import SaveFromIE from .servingsys import ServingSysIE from .sina import SinaIE from .slashdot import SlashdotIE diff --git a/youtube_dl/extractor/savefrom.py b/youtube_dl/extractor/savefrom.py new file mode 100644 index 000000000..198a08c1c --- /dev/null +++ b/youtube_dl/extractor/savefrom.py @@ -0,0 +1,37 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import os.path +import re + +from .common import InfoExtractor + + +class SaveFromIE(InfoExtractor): + IE_NAME = 'savefrom.net' + _VALID_URL = r'https?://[^.]+\.savefrom\.net/\#url=(?P<url>.*)$' + + _TEST = { + 'url': 'http://en.savefrom.net/#url=http://youtube.com/watch?v=UlVRAPW2WJY&utm_source=youtube.com&utm_medium=short_domains&utm_campaign=ssyoutube.com', + 'info_dict': { + 'id': 'UlVRAPW2WJY', + 'ext': 'mp4', + 'title': 'About Team Radical MMA | MMA Fighting', + 'upload_date': '20120816', + 'uploader': 'Howcast', + 'uploader_id': 'Howcast', + 'description': 'md5:4f0aac94361a12e1ce57d74f85265175', + }, + 'params': { + 'skip_download': True + } + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + video_id = os.path.splitext(url.split('/')[-1])[0] + return { + '_type': 'url', + 'id': video_id, + 'url': mobj.group('url'), + } |