diff options
author | Sergey M․ <[email protected]> | 2020-12-26 21:55:12 +0700 |
---|---|---|
committer | Sergey M․ <[email protected]> | 2020-12-26 21:55:12 +0700 |
commit | cfa4ffa23b96df7ee3ffbe0dd35ec5c80e17590f (patch) | |
tree | 7064e91526c54a7382ac60a255fe83f44727697a | |
parent | 4f1dc1463d49167482e1722b4c637eabc560e7aa (diff) | |
download | youtube-dl-cfa4ffa23b96df7ee3ffbe0dd35ec5c80e17590f.tar.gz youtube-dl-cfa4ffa23b96df7ee3ffbe0dd35ec5c80e17590f.zip |
[spangbang] Add support for playlist videos
-rw-r--r-- | youtube_dl/extractor/spankbang.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/youtube_dl/extractor/spankbang.py b/youtube_dl/extractor/spankbang.py index 61ca902ce..e3ec8602d 100644 --- a/youtube_dl/extractor/spankbang.py +++ b/youtube_dl/extractor/spankbang.py @@ -17,7 +17,14 @@ from ..utils import ( class SpankBangIE(InfoExtractor): - _VALID_URL = r'https?://(?:[^/]+\.)?spankbang\.com/(?P<id>[\da-z]+)/(?:video|play|embed)\b' + _VALID_URL = r'''(?x) + https?:// + (?:[^/]+\.)?spankbang\.com/ + (?: + (?P<id>[\da-z]+)/(?:video|play|embed)\b| + [\da-z]+-(?P<id_2>[\da-z]+)/playlist/[^/?#&]+ + ) + ''' _TESTS = [{ 'url': 'http://spankbang.com/3vvn/video/fantasy+solo', 'md5': '1cc433e1d6aa14bc376535b8679302f7', @@ -57,10 +64,14 @@ class SpankBangIE(InfoExtractor): }, { 'url': 'https://spankbang.com/2y3td/embed/', 'only_matching': True, + }, { + 'url': 'https://spankbang.com/2v7ik-7ecbgu/playlist/latina+booty', + 'only_matching': True, }] def _real_extract(self, url): - video_id = self._match_id(url) + mobj = re.match(self._VALID_URL, url) + video_id = mobj.group('id') or mobj.group('id_2') webpage = self._download_webpage( url.replace('/%s/embed' % video_id, '/%s/video' % video_id), video_id, headers={'Cookie': 'country=US'}) |