diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index c6f8a785a..163ff60ba 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -988,7 +988,10 @@ from .skynewsarabia import ( from .skysports import SkySportsIE from .slideshare import SlideshareIE from .slideslive import SlidesLiveIE -from .slutload import SlutloadIE +from .slutload import ( + SlutloadIE, + SlutloadMobileIE +) from .smotri import ( SmotriIE, SmotriCommunityIE, diff --git a/youtube_dl/extractor/slutload.py b/youtube_dl/extractor/slutload.py index 6fc2ff60d..fc9d7a11c 100644 --- a/youtube_dl/extractor/slutload.py +++ b/youtube_dl/extractor/slutload.py @@ -1,13 +1,11 @@ from __future__ import unicode_literals -import re - from .common import InfoExtractor class SlutloadIE(InfoExtractor): - _VALID_URL = r'^https?://(?:\w+\.)?slutload\.com/video/[^/]+/(?P[^/]+)/?$' - _TESTS = [{ + _VALID_URL = r'^https?://(?:www\.)?slutload\.com/video/[^/]+/(?P[^/]+)/?$' + _TEST = { 'url': 'http://www.slutload.com/video/virginie-baisee-en-cam/TD73btpBqSxc/', 'md5': '868309628ba00fd488cf516a113fd717', 'info_dict': { @@ -17,27 +15,62 @@ class SlutloadIE(InfoExtractor): 'age_limit': 18, 'thumbnail': r're:https?://.*?\.jpg' } - }, { - # mobile site - 'url': 'http://mobile.slutload.com/video/masturbation-solo/fviFLmc6kzJ/', - 'only_matching': True, - }] + } def _real_extract(self, url): video_id = self._match_id(url) - desktop_url = re.sub(r'^(https?://)mobile\.', r'\1', url) - webpage = self._download_webpage(desktop_url, video_id) - - video_title = self._html_search_regex(r'

([^<]+)', - webpage, 'title').strip() + webpage = self._download_webpage(url, video_id) + video_title = self._html_search_regex( + r'

([^<]+)', + webpage, 'title').strip() video_url = self._html_search_regex( - r'(?s)
[^/]+)/?$' + _TEST = { + 'url': 'http://mobile.slutload.com/video/virginie-baisee-en-cam/TD73btpBqSxc/', + 'md5': '868309628ba00fd488cf516a113fd717', + 'info_dict': { + 'id': 'TD73btpBqSxc', + 'ext': 'mp4', + 'age_limit': 18, + 'title': 'virginie baisee en cam', + 'thumbnail': r're:https?://.*?\.jpg' + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + + webpage = self._download_webpage(url, video_id) + + video_title = self._html_search_regex( + r'
([^<]+)
', + webpage, 'title').strip() + video_url = self._html_search_regex( + r'(?s)