diff options
author | garret1317 <garret@airmail.cc> | 2025-09-14 17:28:08 +0100 |
---|---|---|
committer | garret1317 <garret@airmail.cc> | 2025-09-14 17:28:08 +0100 |
commit | 8337d2b164759181777f64f12b985e4fad769ab7 (patch) | |
tree | e5d94de6c305ac9624e551c074243cf82db9c625 /yt_dlp_plugins/extractor/radiko_dependencies.py | |
parent | e1c74fc8eb027d40acc9d5114f352670b435c23b (diff) | |
download | yt-dlp-rajiko-8337d2b164759181777f64f12b985e4fad769ab7.tar.gz yt-dlp-rajiko-8337d2b164759181777f64f12b985e4fad769ab7.tar.bz2 yt-dlp-rajiko-8337d2b164759181777f64f12b985e4fad769ab7.zip |
Add support for bundled protobug library
github:
closes #29
Diffstat (limited to 'yt_dlp_plugins/extractor/radiko_dependencies.py')
-rw-r--r-- | yt_dlp_plugins/extractor/radiko_dependencies.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/yt_dlp_plugins/extractor/radiko_dependencies.py b/yt_dlp_plugins/extractor/radiko_dependencies.py new file mode 100644 index 0000000..769a5e3 --- /dev/null +++ b/yt_dlp_plugins/extractor/radiko_dependencies.py @@ -0,0 +1,29 @@ +# Bundle importing code Copyright (c) 2021-2022 Grub4K, from yt-dont-lock-p. +# https://github.com/Grub4K/yt-dont-lock-p/blob/ff3b6e1d42ce8584153ae27544d2c05b50ab5954/yt_dlp_plugins/postprocessor/yt_dont_lock_p/__init__.py#L23-L46 +# Used under 0BSD with permission + +# https://discord.com/channels/807245652072857610/1112613156934668338/1416816007732920430 (yt-dlp discord server, https://discord.gg/H5MNcFW63r ) +# [17:00] garret1317: @Grub4K can i pinch your MIT-licensed dependency bundling code to use in my 0BSD-licensed plugin? +# I will credit of course but i can't require that anyone else does the same +# (Any response to this message will be considered a written consent or refusal of the request) +# [17:04] Grub4K: Feel free to use that part under 0BSD +# [17:05] garret1317: 👍 cheers + +try: + import protobug +except ImportError: + import sys + from pathlib import Path + + # Try importing from zip file bundle + search_path = str(Path(__file__).parent.parent) + sys.path.append(search_path) + try: + import protobug + except ImportError: + protobug = None + except Exception: + protobug = None + + finally: + sys.path.remove(search_path) |