mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-03 16:51:50 +00:00
[ie/xhamster] Fix extractor (#14286)
Closes #14145 Authored by: nicolaasjan, willsmillie Co-authored-by: nicolaasjan <14093220+nicolaasjan@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import base64
|
||||||
import itertools
|
import itertools
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ from ..utils import (
|
|||||||
int_or_none,
|
int_or_none,
|
||||||
parse_duration,
|
parse_duration,
|
||||||
str_or_none,
|
str_or_none,
|
||||||
|
try_call,
|
||||||
try_get,
|
try_get,
|
||||||
unified_strdate,
|
unified_strdate,
|
||||||
url_or_none,
|
url_or_none,
|
||||||
@@ -229,6 +231,11 @@ class XHamsterIE(InfoExtractor):
|
|||||||
standard_url = standard_format.get(standard_format_key)
|
standard_url = standard_format.get(standard_format_key)
|
||||||
if not standard_url:
|
if not standard_url:
|
||||||
continue
|
continue
|
||||||
|
decoded = try_call(lambda: base64.b64decode(standard_url))
|
||||||
|
if decoded and decoded[:4] == b'xor_':
|
||||||
|
standard_url = bytes(
|
||||||
|
a ^ b for a, b in
|
||||||
|
zip(decoded[4:], itertools.cycle(b'xh7999'))).decode()
|
||||||
standard_url = urljoin(url, standard_url)
|
standard_url = urljoin(url, standard_url)
|
||||||
if not standard_url or standard_url in format_urls:
|
if not standard_url or standard_url in format_urls:
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user