mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-02-22 08:26:00 +00:00
[ie/spankbang] Support browser impersonation (#14130)
Closes #14129 Authored by: blauerdorf
This commit is contained in:
@@ -122,7 +122,7 @@ class SpankBangIE(InfoExtractor):
|
|||||||
}), headers={
|
}), headers={
|
||||||
'Referer': url,
|
'Referer': url,
|
||||||
'X-Requested-With': 'XMLHttpRequest',
|
'X-Requested-With': 'XMLHttpRequest',
|
||||||
})
|
}, impersonate=True)
|
||||||
|
|
||||||
for format_id, format_url in stream.items():
|
for format_id, format_url in stream.items():
|
||||||
if format_url and isinstance(format_url, list):
|
if format_url and isinstance(format_url, list):
|
||||||
@@ -178,9 +178,9 @@ class SpankBangPlaylistIE(InfoExtractor):
|
|||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = self._match_valid_url(url)
|
mobj = self._match_valid_url(url)
|
||||||
playlist_id = mobj.group('id')
|
playlist_id = mobj.group('id')
|
||||||
|
country = self.get_param('geo_bypass_country') or 'US'
|
||||||
webpage = self._download_webpage(
|
self._set_cookie('.spankbang.com', 'country', country.upper())
|
||||||
url, playlist_id, headers={'Cookie': 'country=US; mobile=on'})
|
webpage = self._download_webpage(url, playlist_id, impersonate=True)
|
||||||
|
|
||||||
entries = [self.url_result(
|
entries = [self.url_result(
|
||||||
urljoin(url, mobj.group('path')),
|
urljoin(url, mobj.group('path')),
|
||||||
|
|||||||
Reference in New Issue
Block a user