summaryrefslogtreecommitdiffstats
path: root/yt_dlp/compat/_deprecated.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:49:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 16:49:24 +0000
commit2415e66f889f38503b73e8ebc5f43ca342390e5c (patch)
treeac48ab69d1d96bae3d83756134921e0d90593aa5 /yt_dlp/compat/_deprecated.py
parentInitial commit. (diff)
downloadyt-dlp-26f6c725952db23a76af7beff2b44863e0abd96e.tar.xz
yt-dlp-26f6c725952db23a76af7beff2b44863e0abd96e.zip
Adding upstream version 2024.03.10.upstream/2024.03.10
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'yt_dlp/compat/_deprecated.py')
-rw-r--r--yt_dlp/compat/_deprecated.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/yt_dlp/compat/_deprecated.py b/yt_dlp/compat/_deprecated.py
new file mode 100644
index 0000000..607bae9
--- /dev/null
+++ b/yt_dlp/compat/_deprecated.py
@@ -0,0 +1,23 @@
+"""Deprecated - New code should avoid these"""
+import warnings
+
+from .compat_utils import passthrough_module
+
+# XXX: Implement this the same way as other DeprecationWarnings without circular import
+passthrough_module(__name__, '.._legacy', callback=lambda attr: warnings.warn(
+ DeprecationWarning(f'{__name__}.{attr} is deprecated'), stacklevel=6))
+del passthrough_module
+
+import base64
+import urllib.error
+import urllib.parse
+
+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