From f8d9f1cd07364c759426f01878a57f243ccdb60d Mon Sep 17 00:00:00 2001 From: Gabor Miklos Date: Mon, 20 Nov 2017 13:27:52 +0200 Subject: [PATCH 1/2] [slutload] Support mobile site --- youtube_dl/extractor/slutload.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/slutload.py b/youtube_dl/extractor/slutload.py index 7145d285a..ecf86f7ee 100644 --- a/youtube_dl/extractor/slutload.py +++ b/youtube_dl/extractor/slutload.py @@ -1,25 +1,42 @@ from __future__ import unicode_literals +import re + from .common import InfoExtractor class SlutloadIE(InfoExtractor): _VALID_URL = r'^https?://(?:\w+\.)?slutload\.com/video/[^/]+/(?P[^/]+)/?$' - _TEST = { + _TESTS = [{ 'url': 'http://www.slutload.com/video/virginie-baisee-en-cam/TD73btpBqSxc/', 'md5': '868309628ba00fd488cf516a113fd717', 'info_dict': { 'id': 'TD73btpBqSxc', 'ext': 'mp4', - 'title': 'virginie baisee en cam', 'age_limit': 18, + 'title': 'virginie baisee en cam', 'thumbnail': r're:https?://.*?\.jpg' } - } + }, { + # mobile site + 'url': 'http://mobile.slutload.com/video/masturbation-solo/fviFLmc6kzJ/', + 'info_dict': { + 'id': 'fviFLmc6kzJ', + 'ext': 'mp4', + 'age_limit': 18, + 'title': 'Masturbation Solo', + 'thumbnail': r're:https?://.*?\.jpg' + }, + 'params': { + 'skip_download': True, + }, + }] def _real_extract(self, url): video_id = self._match_id(url) - webpage = self._download_webpage(url, video_id) + + 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() From 99d24d02cac26f8d582972a4d690fb167ceb54de Mon Sep 17 00:00:00 2001 From: Sergey M Date: Sun, 31 Dec 2017 01:40:33 +0700 Subject: [PATCH 2/2] Update slutload.py --- youtube_dl/extractor/slutload.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/youtube_dl/extractor/slutload.py b/youtube_dl/extractor/slutload.py index ecf86f7ee..6fc2ff60d 100644 --- a/youtube_dl/extractor/slutload.py +++ b/youtube_dl/extractor/slutload.py @@ -13,23 +13,14 @@ class SlutloadIE(InfoExtractor): 'info_dict': { 'id': 'TD73btpBqSxc', 'ext': 'mp4', - 'age_limit': 18, 'title': 'virginie baisee en cam', + 'age_limit': 18, 'thumbnail': r're:https?://.*?\.jpg' } }, { # mobile site 'url': 'http://mobile.slutload.com/video/masturbation-solo/fviFLmc6kzJ/', - 'info_dict': { - 'id': 'fviFLmc6kzJ', - 'ext': 'mp4', - 'age_limit': 18, - 'title': 'Masturbation Solo', - 'thumbnail': r're:https?://.*?\.jpg' - }, - 'params': { - 'skip_download': True, - }, + 'only_matching': True, }] def _real_extract(self, url):