diff options
Diffstat (limited to 'yt_dlp/compat/_legacy.py')
-rw-r--r-- | yt_dlp/compat/_legacy.py | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/yt_dlp/compat/_legacy.py b/yt_dlp/compat/_legacy.py index 49bb13a3c..d19333d31 100644 --- a/yt_dlp/compat/_legacy.py +++ b/yt_dlp/compat/_legacy.py @@ -22,10 +22,14 @@ import urllib.request import xml.etree.ElementTree as etree from subprocess import DEVNULL -from .compat_utils import passthrough_module # isort: split -from .asyncio import run as compat_asyncio_run # noqa: F401 -from .re import Pattern as compat_Pattern # noqa: F401 -from .re import match as compat_Match # noqa: F401 +# isort: split +import asyncio # noqa: F401 +import re # noqa: F401 +from asyncio import run as compat_asyncio_run # noqa: F401 +from re import Pattern as compat_Pattern # noqa: F401 +from re import match as compat_Match # noqa: F401 + +from .compat_utils import passthrough_module from ..dependencies import Cryptodome_AES as compat_pycrypto_AES # noqa: F401 from ..dependencies import brotli as compat_brotli # noqa: F401 from ..dependencies import websockets as compat_websockets # noqa: F401 @@ -44,14 +48,27 @@ def compat_setenv(key, value, env=os.environ): compat_basestring = str +compat_casefold = str.casefold +compat_chr = chr compat_collections_abc = collections.abc +compat_cookiejar = http.cookiejar +compat_cookiejar_Cookie = http.cookiejar.Cookie compat_cookies = http.cookies +compat_cookies_SimpleCookie = http.cookies.SimpleCookie compat_etree_Element = etree.Element compat_etree_register_namespace = etree.register_namespace compat_filter = filter +compat_get_terminal_size = shutil.get_terminal_size compat_getenv = os.getenv +compat_getpass = getpass.getpass +compat_html_entities = html.entities +compat_html_entities_html5 = html.entities.html5 +compat_HTMLParser = html.parser.HTMLParser +compat_http_client = http.client +compat_http_server = http.server compat_input = input compat_integer_types = (int, ) +compat_itertools_count = itertools.count compat_kwargs = lambda kwargs: kwargs compat_map = map compat_numeric_types = (int, float, complex) @@ -59,34 +76,22 @@ compat_print = print compat_shlex_split = shlex.split compat_socket_create_connection = socket.create_connection compat_Struct = struct.Struct +compat_struct_pack = struct.pack +compat_struct_unpack = struct.unpack compat_subprocess_get_DEVNULL = lambda: DEVNULL +compat_tokenize_tokenize = tokenize.tokenize +compat_urllib_error = urllib.error +compat_urllib_parse = urllib.parse compat_urllib_parse_quote = urllib.parse.quote compat_urllib_parse_quote_plus = urllib.parse.quote_plus +compat_urllib_parse_unquote_plus = urllib.parse.unquote_plus compat_urllib_parse_unquote_to_bytes = urllib.parse.unquote_to_bytes compat_urllib_parse_urlunparse = urllib.parse.urlunparse -compat_urllib_request_DataHandler = urllib.request.DataHandler compat_urllib_request = urllib.request +compat_urllib_request_DataHandler = urllib.request.DataHandler compat_urllib_response = urllib.response compat_urlretrieve = urllib.request.urlretrieve compat_xml_parse_error = etree.ParseError compat_xpath = lambda xpath: xpath compat_zip = zip workaround_optparse_bug9161 = lambda: None -compat_getpass = getpass.getpass -compat_chr = chr -compat_urllib_parse = urllib.parse -compat_itertools_count = itertools.count -compat_cookiejar = http.cookiejar -compat_cookiejar_Cookie = http.cookiejar.Cookie -compat_cookies_SimpleCookie = http.cookies.SimpleCookie -compat_get_terminal_size = shutil.get_terminal_size -compat_html_entities = html.entities -compat_html_entities_html5 = html.entities.html5 -compat_tokenize_tokenize = tokenize.tokenize -compat_HTMLParser = html.parser.HTMLParser -compat_http_client = http.client -compat_http_server = http.server -compat_struct_pack = struct.pack -compat_struct_unpack = struct.unpack -compat_urllib_error = urllib.error -compat_urllib_parse_unquote_plus = urllib.parse.unquote_plus |