diff options
Diffstat (limited to 'yt_dlp/extractor/xfileshare.py')
-rw-r--r-- | yt_dlp/extractor/xfileshare.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/yt_dlp/extractor/xfileshare.py b/yt_dlp/extractor/xfileshare.py index 63abe4a1f..08c6d6c7c 100644 --- a/yt_dlp/extractor/xfileshare.py +++ b/yt_dlp/extractor/xfileshare.py @@ -61,6 +61,7 @@ class XFileShareIE(InfoExtractor): IE_DESC = 'XFileShare based sites: %s' % ', '.join(list(zip(*_SITES))[1]) _VALID_URL = (r'https?://(?:www\.)?(?P<host>%s)/(?:embed-)?(?P<id>[0-9a-zA-Z]+)' % '|'.join(site for site in list(zip(*_SITES))[0])) + _EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//(?:%s)/embed-[0-9a-zA-Z]+.*?)\1' % '|'.join(site for site in list(zip(*_SITES))[0])] _FILE_NOT_FOUND_REGEXES = ( r'>(?:404 - )?File Not Found<', @@ -68,6 +69,15 @@ class XFileShareIE(InfoExtractor): ) _TESTS = [{ + 'url': 'https://uqload.com/dltx1wztngdz', + 'md5': '3cfbb65e4c90e93d7b37bcb65a595557', + 'info_dict': { + 'id': 'dltx1wztngdz', + 'ext': 'mp4', + 'title': 'Rick Astley Never Gonna Give You mp4', + 'thumbnail': r're:https://.*\.jpg' + } + }, { 'url': 'http://xvideosharing.com/fq65f94nd2ve', 'md5': '4181f63957e8fe90ac836fa58dc3c8a6', 'info_dict': { @@ -84,15 +94,6 @@ class XFileShareIE(InfoExtractor): 'only_matching': True, }] - @staticmethod - def _extract_urls(webpage): - return [ - mobj.group('url') - for mobj in re.finditer( - r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//(?:%s)/embed-[0-9a-zA-Z]+.*?)\1' - % '|'.join(site for site in list(zip(*XFileShareIE._SITES))[0]), - webpage)] - def _real_extract(self, url): host, video_id = self._match_valid_url(url).groups() @@ -181,7 +182,6 @@ class XFileShareIE(InfoExtractor): 'url': video_url, 'format_id': 'sd', }) - self._sort_formats(formats) thumbnail = self._search_regex( [ @@ -194,4 +194,5 @@ class XFileShareIE(InfoExtractor): 'title': title, 'thumbnail': thumbnail, 'formats': formats, + 'http_headers': {'Referer': url} } |