]> jfr.im git - yt-dlp.git/blame - yt_dlp/compat/_deprecated.py
Bugfix for 3a408f9d199127ca2626359e21a866a09ab236b3
[yt-dlp.git] / yt_dlp / compat / _deprecated.py
CommitLineData
77f90330 1"""Deprecated - New code should avoid these"""
2
3import base64
4import getpass
5import html
6import html.parser
7import http
8import http.client
9import http.cookiejar
10import http.cookies
11import http.server
12import itertools
13import os
14import shutil
15import struct
16import tokenize
17import urllib
18
19compat_b64decode = base64.b64decode
20compat_chr = chr
21compat_cookiejar = http.cookiejar
22compat_cookiejar_Cookie = http.cookiejar.Cookie
23compat_cookies_SimpleCookie = http.cookies.SimpleCookie
24compat_get_terminal_size = shutil.get_terminal_size
25compat_getenv = os.getenv
26compat_getpass = getpass.getpass
27compat_html_entities = html.entities
28compat_html_entities_html5 = html.entities.html5
29compat_HTMLParser = html.parser.HTMLParser
30compat_http_client = http.client
31compat_http_server = http.server
32compat_HTTPError = urllib.error.HTTPError
33compat_itertools_count = itertools.count
34compat_parse_qs = urllib.parse.parse_qs
35compat_str = str
36compat_struct_pack = struct.pack
37compat_struct_unpack = struct.unpack
38compat_tokenize_tokenize = tokenize.tokenize
39compat_urllib_error = urllib.error
40compat_urllib_parse_unquote = urllib.parse.unquote
41compat_urllib_parse_unquote_plus = urllib.parse.unquote_plus
42compat_urllib_parse_urlencode = urllib.parse.urlencode
43compat_urllib_parse_urlparse = urllib.parse.urlparse
44compat_urllib_request = urllib.request
45compat_urlparse = compat_urllib_parse = urllib.parse
46
1d485a1a 47
48def compat_setenv(key, value, env=os.environ):
49 env[key] = value
50
51
77f90330 52__all__ = [x for x in globals() if x.startswith('compat_')]