mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-29 03:55:53 +00:00
Move entries from deprecated to legacy
This commit is contained in:
parent
1207343939
commit
6e51cbc6da
@ -8,22 +8,10 @@ passthrough_module(__name__, '.._legacy', callback=lambda attr: warnings.warn(
|
|||||||
DeprecationWarning(f'{__name__}.{attr} is deprecated'), stacklevel=6))
|
DeprecationWarning(f'{__name__}.{attr} is deprecated'), stacklevel=6))
|
||||||
del passthrough_module
|
del passthrough_module
|
||||||
|
|
||||||
import base64
|
|
||||||
import os
|
import os
|
||||||
import urllib.error
|
|
||||||
import urllib.parse
|
|
||||||
|
|
||||||
compat_str = str
|
|
||||||
|
|
||||||
compat_b64decode = base64.b64decode
|
compat_os_name = os.name
|
||||||
|
|
||||||
compat_urlparse = urllib.parse
|
|
||||||
compat_parse_qs = urllib.parse.parse_qs
|
|
||||||
compat_urllib_parse_unquote = urllib.parse.unquote
|
|
||||||
compat_urllib_parse_urlencode = urllib.parse.urlencode
|
|
||||||
compat_urllib_parse_urlparse = urllib.parse.urlparse
|
|
||||||
|
|
||||||
compat_os_name = os._name if os.name == 'java' else os.name
|
|
||||||
compat_realpath = os.path.realpath
|
compat_realpath = os.path.realpath
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -104,5 +104,12 @@ compat_xml_parse_error = compat_xml_etree_ElementTree_ParseError = etree.ParseEr
|
|||||||
compat_xpath = lambda xpath: xpath
|
compat_xpath = lambda xpath: xpath
|
||||||
compat_zip = zip
|
compat_zip = zip
|
||||||
workaround_optparse_bug9161 = lambda: None
|
workaround_optparse_bug9161 = lambda: None
|
||||||
|
compat_str = str
|
||||||
|
compat_b64decode = base64.b64decode
|
||||||
|
compat_urlparse = urllib.parse
|
||||||
|
compat_parse_qs = urllib.parse.parse_qs
|
||||||
|
compat_urllib_parse_unquote = urllib.parse.unquote
|
||||||
|
compat_urllib_parse_urlencode = urllib.parse.urlencode
|
||||||
|
compat_urllib_parse_urlparse = urllib.parse.urlparse
|
||||||
|
|
||||||
legacy = []
|
legacy = []
|
||||||
|
|||||||
@ -10,34 +10,6 @@ del passthrough_module
|
|||||||
|
|
||||||
|
|
||||||
import struct
|
import struct
|
||||||
from ._utils import preferredencoding
|
|
||||||
|
|
||||||
|
|
||||||
def encodeFilename(s, for_subprocess=False):
|
|
||||||
assert isinstance(s, str)
|
|
||||||
return s
|
|
||||||
|
|
||||||
|
|
||||||
def decodeFilename(b, for_subprocess=False):
|
|
||||||
return b
|
|
||||||
|
|
||||||
|
|
||||||
def decodeArgument(b):
|
|
||||||
return b
|
|
||||||
|
|
||||||
|
|
||||||
def decodeOption(optval):
|
|
||||||
if optval is None:
|
|
||||||
return optval
|
|
||||||
if isinstance(optval, bytes):
|
|
||||||
optval = optval.decode(preferredencoding())
|
|
||||||
|
|
||||||
assert isinstance(optval, str)
|
|
||||||
return optval
|
|
||||||
|
|
||||||
|
|
||||||
def error_to_compat_str(err):
|
|
||||||
return str(err)
|
|
||||||
|
|
||||||
|
|
||||||
def bytes_to_intlist(bs):
|
def bytes_to_intlist(bs):
|
||||||
|
|||||||
@ -313,3 +313,30 @@ def make_HTTPS_handler(params, **kwargs):
|
|||||||
|
|
||||||
def process_communicate_or_kill(p, *args, **kwargs):
|
def process_communicate_or_kill(p, *args, **kwargs):
|
||||||
return Popen.communicate_or_kill(p, *args, **kwargs)
|
return Popen.communicate_or_kill(p, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def encodeFilename(s, for_subprocess=False):
|
||||||
|
assert isinstance(s, str)
|
||||||
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
def decodeFilename(b, for_subprocess=False):
|
||||||
|
return b
|
||||||
|
|
||||||
|
|
||||||
|
def decodeArgument(b):
|
||||||
|
return b
|
||||||
|
|
||||||
|
|
||||||
|
def decodeOption(optval):
|
||||||
|
if optval is None:
|
||||||
|
return optval
|
||||||
|
if isinstance(optval, bytes):
|
||||||
|
optval = optval.decode(preferredencoding())
|
||||||
|
|
||||||
|
assert isinstance(optval, str)
|
||||||
|
return optval
|
||||||
|
|
||||||
|
|
||||||
|
def error_to_compat_str(err):
|
||||||
|
return str(err)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user