mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-05 01:38:36 +01:00
86e5f3ed2e
Using https://github.com/asottile/pyupgrade 1. `__future__` imports and `coding: utf-8` were removed 2. Files were rewritten with `pyupgrade --py36-plus --keep-percent-format` 3. f-strings were cherry-picked from `pyupgrade --py36-plus` Extractors are left untouched (except removing header) to avoid unnecessary merge conflicts
31 lines
1010 B
Python
31 lines
1010 B
Python
import os.path
|
|
|
|
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': r're:(?s).* Hi, my name is Rene Dreifuss\. And I\'m here to show you some MMA.*',
|
|
},
|
|
'params': {
|
|
'skip_download': True
|
|
}
|
|
}
|
|
|
|
def _real_extract(self, url):
|
|
mobj = self._match_valid_url(url)
|
|
video_id = os.path.splitext(url.split('/')[-1])[0]
|
|
|
|
return self.url_result(mobj.group('url'), video_id=video_id)
|