From aa0d28531aa77b9d1e8e2b616401a4e216cfc85f Mon Sep 17 00:00:00 2001 From: bashonly Date: Mon, 11 Aug 2025 15:12:59 -0500 Subject: [PATCH] [update] fix onedir variant names Authored by: bashonly --- yt_dlp/update.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yt_dlp/update.py b/yt_dlp/update.py index cc6e70012e..5d38baecc6 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -61,10 +61,10 @@ def _get_variant_and_executable_path(): # py2exe is unsupported but we should still correctly identify it for debugging purposes if not hasattr(sys, '_MEIPASS'): return 'py2exe', path - if sys._MEIPASS == os.path.dirname(path): - return f'{sys.platform}_dir', path + # We know it's a PyInstaller bundle, but is it "onedir" or "onefile"? + suffix = 'dir' if sys._MEIPASS == os.path.dirname(path) else 'exe' if sys.platform == 'darwin': - return 'darwin_exe', path + return f'darwin_{suffix}', path machine = f'_{platform.machine().lower()}' is_64bits = sys.maxsize > 2**32 @@ -80,7 +80,7 @@ def _get_variant_and_executable_path(): if static_exe_path := os.getenv('STATICX_PROG_PATH'): path = static_exe_path - return f'{remove_end(sys.platform, "32")}{machine}_exe', path + return f'{remove_end(sys.platform, "32")}{machine}_{suffix}', path path = os.path.dirname(__file__) if isinstance(__loader__, zipimporter):