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