1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-27 17:08:32 +00:00
This commit is contained in:
Hawker2 2025-06-20 01:13:20 +08:00 committed by GitHub
commit 662acde5ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,7 @@
class SpankBangIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
(?:[^/]+\.)?spankbang\.com/
(?:[^/]+\.)?spankbang\.(?:com|party)/
(?:
(?P<id>[\da-z]+)/(?:video|play|embed)\b|
[\da-z]+-(?P<id_2>[\da-z]+)/playlist/[^/?#&]+
@ -114,8 +114,10 @@ def extract_format(format_id, format_url):
r'data-streamkey\s*=\s*(["\'])(?P<value>(?:(?!\1).)+)\1',
webpage, 'stream key', group='value')
stream_domain = re.search(r'https?://(?:[^/]+\.)?(spankbang\.(?:com|party))/', url).group(1)
stream_url = 'https://' + stream_domain + '/api/videos/stream'
stream = self._download_json(
'https://spankbang.com/api/videos/stream', video_id,
stream_url, video_id,
'Downloading stream JSON', data=urlencode_postdata({
'id': stream_key,
'data': 0,
@ -129,6 +131,11 @@ def extract_format(format_id, format_url):
format_url = format_url[0]
extract_format(format_id, format_url)
og_url = self._search_regex(
r'<meta property="og:url" content="(.*?)"', webpage, 'og:url', default=None)
if og_url:
video_id = self._search_regex(r'https://spankbang.(?:com|party)/([^/]+)/', og_url, 'video ID', default=None)
info = self._search_json_ld(webpage, video_id, default={})
title = self._html_search_regex(
@ -165,7 +172,7 @@ def extract_format(format_id, format_url):
class SpankBangPlaylistIE(InfoExtractor):
_VALID_URL = r'https?://(?:[^/]+\.)?spankbang\.com/(?P<id>[\da-z]+)/playlist/(?P<display_id>[^/]+)'
_VALID_URL = r'https?://(?:[^/]+\.)?spankbang\.(?:com|party)/(?P<id>[\da-z]+)/playlist/(?P<display_id>[^/]+)'
_TEST = {
'url': 'https://spankbang.com/ug0k/playlist/big+ass+titties',
'info_dict': {