]> jfr.im git - yt-dlp.git/blob - yt_dlp/compat/_legacy.py
[dependencies] Create module with all dependency imports
[yt-dlp.git] / yt_dlp / compat / _legacy.py
1 """ Do not use! """
2
3 import collections
4 import ctypes
5 import http
6 import http.client
7 import http.cookiejar
8 import http.cookies
9 import http.server
10 import shlex
11 import socket
12 import struct
13 import urllib
14 import xml.etree.ElementTree as etree
15 from subprocess import DEVNULL
16
17 from .asyncio import run as compat_asyncio_run # noqa: F401
18 from .re import Pattern as compat_Pattern # noqa: F401
19 from .re import match as compat_Match # noqa: F401
20 from ..dependencies import Cryptodome_AES as compat_pycrypto_AES # noqa: F401
21 from ..dependencies import brotli as compat_brotli # noqa: F401
22 from ..dependencies import websockets as compat_websockets # noqa: F401
23
24
25 # compat_ctypes_WINFUNCTYPE = ctypes.WINFUNCTYPE
26 # will not work since ctypes.WINFUNCTYPE does not exist in UNIX machines
27 def compat_ctypes_WINFUNCTYPE(*args, **kwargs):
28 return ctypes.WINFUNCTYPE(*args, **kwargs)
29
30
31 compat_basestring = str
32 compat_collections_abc = collections.abc
33 compat_cookies = http.cookies
34 compat_etree_Element = etree.Element
35 compat_etree_register_namespace = etree.register_namespace
36 compat_filter = filter
37 compat_input = input
38 compat_integer_types = (int, )
39 compat_kwargs = lambda kwargs: kwargs
40 compat_map = map
41 compat_numeric_types = (int, float, complex)
42 compat_print = print
43 compat_shlex_split = shlex.split
44 compat_socket_create_connection = socket.create_connection
45 compat_Struct = struct.Struct
46 compat_subprocess_get_DEVNULL = lambda: DEVNULL
47 compat_urllib_parse_quote = urllib.parse.quote
48 compat_urllib_parse_quote_plus = urllib.parse.quote_plus
49 compat_urllib_parse_unquote_to_bytes = urllib.parse.unquote_to_bytes
50 compat_urllib_parse_urlunparse = urllib.parse.urlunparse
51 compat_urllib_request_DataHandler = urllib.request.DataHandler
52 compat_urllib_response = urllib.response
53 compat_urlretrieve = urllib.request.urlretrieve
54 compat_xml_parse_error = etree.ParseError
55 compat_xpath = lambda xpath: xpath
56 compat_zip = zip
57 workaround_optparse_bug9161 = lambda: None