]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/spankbang.py
[extractor/wistia] Match IDs in embed URLs (#4990)
[yt-dlp.git] / yt_dlp / extractor / spankbang.py
index d70331bb357cda2c37c6d154398dcb8b1fefa80a..1aa8eaba1daa7313851e8729826811030203524c 100644 (file)
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
 import re
 
 from .common import InfoExtractor
@@ -26,17 +24,18 @@ class SpankBangIE(InfoExtractor):
                         )
                     '''
     _TESTS = [{
-        'url': 'http://spankbang.com/3vvn/video/fantasy+solo',
-        'md5': '1cc433e1d6aa14bc376535b8679302f7',
+        'url': 'https://spankbang.com/56b3d/video/the+slut+maker+hmv',
+        'md5': '2D13903DE4ECC7895B5D55930741650A',
         'info_dict': {
-            'id': '3vvn',
+            'id': '56b3d',
             'ext': 'mp4',
-            'title': 'fantasy solo',
-            'description': 'dillion harper masturbates on a bed',
+            'title': 'The Slut Maker HMV',
+            'description': 'Girls getting converted into cock slaves.',
             'thumbnail': r're:^https?://.*\.jpg$',
-            'uploader': 'silly2587',
-            'timestamp': 1422571989,
-            'upload_date': '20150129',
+            'uploader': 'Mindself',
+            'uploader_id': 'mindself',
+            'timestamp': 1617109572,
+            'upload_date': '20210330',
             'age_limit': 18,
         }
     }, {
@@ -134,15 +133,15 @@ def extract_format(format_id, format_url):
         info = self._search_json_ld(webpage, video_id, default={})
 
         title = self._html_search_regex(
-            r'(?s)<h1[^>]*>(.+?)</h1>', webpage, 'title', default=None)
+            r'(?s)<h1[^>]+\btitle=["\']([^"]+)["\']>', webpage, 'title', default=None)
         description = self._search_regex(
             r'<div[^>]+\bclass=["\']bottom[^>]+>\s*<p>[^<]*</p>\s*<p>([^<]+)',
             webpage, 'description', default=None)
         thumbnail = self._og_search_thumbnail(webpage, default=None)
         uploader = self._html_search_regex(
-            (r'(?s)<li[^>]+class=["\']profile[^>]+>(.+?)</a>',
-             r'class="user"[^>]*><img[^>]+>([^<]+)'),
-            webpage, 'uploader', default=None)
+            r'<svg[^>]+\bclass="(?:[^"]*?user[^"]*?)">.*?</svg>([^<]+)', webpage, 'uploader', default=None)
+        uploader_id = self._html_search_regex(
+            r'<a[^>]+href="/profile/([^"]+)"', webpage, 'uploader_id', default=None)
         duration = parse_duration(self._search_regex(
             r'<div[^>]+\bclass=["\']right_side[^>]+>\s*<span>([^<]+)',
             webpage, 'duration', default=None))
@@ -157,6 +156,7 @@ def extract_format(format_id, format_url):
             'description': description,
             'thumbnail': thumbnail,
             'uploader': uploader,
+            'uploader_id': uploader_id,
             'duration': duration,
             'view_count': view_count,
             'formats': formats,