mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-08-29 15:21:51 +03:00
@@ -397,6 +397,7 @@ banned-from = [
|
|||||||
"yt_dlp.utils.jwt_encode_hs256".msg = "Use `yt_dlp.utils.jwt_encode` instead."
|
"yt_dlp.utils.jwt_encode_hs256".msg = "Use `yt_dlp.utils.jwt_encode` instead."
|
||||||
"yt_dlp.utils.make_dir".msg = "Use `yt_dlp.utils.make_parent_dirs` instead."
|
"yt_dlp.utils.make_dir".msg = "Use `yt_dlp.utils.make_parent_dirs` instead."
|
||||||
"yt_dlp.utils.number_of_digits".msg = "Do not use"
|
"yt_dlp.utils.number_of_digits".msg = "Do not use"
|
||||||
|
"yt_dlp.utils.random_uuidv4".msg = "Use `str(uuid.uuid4())` instead."
|
||||||
"yt_dlp.utils.decodeArgument".msg = "Do not use"
|
"yt_dlp.utils.decodeArgument".msg = "Do not use"
|
||||||
"yt_dlp.utils.decodeFilename".msg = "Do not use"
|
"yt_dlp.utils.decodeFilename".msg = "Do not use"
|
||||||
"yt_dlp.utils.encodeFilename".msg = "Do not use"
|
"yt_dlp.utils.encodeFilename".msg = "Do not use"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
import uuid
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
random_uuidv4,
|
|
||||||
unified_timestamp,
|
unified_timestamp,
|
||||||
urlencode_postdata,
|
urlencode_postdata,
|
||||||
)
|
)
|
||||||
@@ -77,11 +77,11 @@ class TennisTVIE(InfoExtractor):
|
|||||||
query={
|
query={
|
||||||
'client_id': 'tennis-tv-web',
|
'client_id': 'tennis-tv-web',
|
||||||
'redirect_uri': 'https://www.tennistv.com/resources/v1.1.10/html/silent-check-sso.html',
|
'redirect_uri': 'https://www.tennistv.com/resources/v1.1.10/html/silent-check-sso.html',
|
||||||
'state': random_uuidv4(),
|
'state': str(uuid.uuid4()),
|
||||||
'response_mode': 'fragment',
|
'response_mode': 'fragment',
|
||||||
'response_type': 'code',
|
'response_type': 'code',
|
||||||
'scope': 'openid',
|
'scope': 'openid',
|
||||||
'nonce': random_uuidv4(),
|
'nonce': str(uuid.uuid4()),
|
||||||
'prompt': 'none',
|
'prompt': 'none',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import base64
|
|||||||
import hashlib
|
import hashlib
|
||||||
import hmac
|
import hmac
|
||||||
import json
|
import json
|
||||||
|
import uuid
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from ..compat.compat_utils import passthrough_module
|
from ..compat.compat_utils import passthrough_module
|
||||||
@@ -62,4 +63,8 @@ def number_of_digits(number):
|
|||||||
return len('%d' % number)
|
return len('%d' % number)
|
||||||
|
|
||||||
|
|
||||||
|
def random_uuidv4():
|
||||||
|
return str(uuid.uuid4())
|
||||||
|
|
||||||
|
|
||||||
compiled_regex_type = type(re.compile(''))
|
compiled_regex_type = type(re.compile(''))
|
||||||
|
|||||||
@@ -4730,13 +4730,6 @@ def clean_podcast_url(url):
|
|||||||
return re.sub(r'^\w+://(\w+://)', r'\1', url)
|
return re.sub(r'^\w+://(\w+://)', r'\1', url)
|
||||||
|
|
||||||
|
|
||||||
_HEX_TABLE = '0123456789abcdef'
|
|
||||||
|
|
||||||
|
|
||||||
def random_uuidv4():
|
|
||||||
return re.sub(r'[xy]', lambda x: _HEX_TABLE[random.randint(0, 15)], 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx')
|
|
||||||
|
|
||||||
|
|
||||||
def make_parent_dirs(path):
|
def make_parent_dirs(path):
|
||||||
if dir_name := os.path.dirname(path):
|
if dir_name := os.path.dirname(path):
|
||||||
os.makedirs(dir_name, exist_ok=True)
|
os.makedirs(dir_name, exist_ok=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user