From 1210a4ac13c3623f59d3b411c1407d64bb684a8e Mon Sep 17 00:00:00 2001 From: bashonly Date: Sun, 28 Apr 2024 16:10:19 -0500 Subject: [PATCH] [update] Correct exe path for static builds Authored by: bashonly --- yt_dlp/update.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yt_dlp/update.py b/yt_dlp/update.py index f47cbc5b2..ca70f69a7 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -69,6 +69,10 @@ def _get_variant_and_executable_path(): # Ref: https://en.wikipedia.org/wiki/Uname#Examples if machine[1:] in ('x86', 'x86_64', 'amd64', 'i386', 'i686'): machine = '_x86' if platform.architecture()[0][:2] == '32' else '' + # sys.executable returns a /tmp/ path for staticx builds (linux_static) + # Ref: https://staticx.readthedocs.io/en/latest/usage.html#run-time-information + if static_exe_path := os.getenv('STATICX_PROG_PATH'): + path = static_exe_path return f'{remove_end(sys.platform, "32")}{machine}_exe', path path = os.path.dirname(__file__)