Skip to content

Commit

Permalink
[update] Fix endless update loop for linux_exe builds
Browse files Browse the repository at this point in the history
Authored by: bashonly
  • Loading branch information
bashonly committed Dec 15, 2024
1 parent 2037a64 commit dea1717
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions yt_dlp/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,16 @@ def filename(self):
@functools.cached_property
def cmd(self):
"""The command-line to run the executable, if known"""
argv = None
# There is no sys.orig_argv in py < 3.10. Also, it can be [] when frozen
if getattr(sys, 'orig_argv', None):
return sys.orig_argv
argv = sys.orig_argv
elif getattr(sys, 'frozen', False):
return sys.argv
argv = sys.argv
# linux_static exe's argv[0] will be /tmp/staticx-NNNN/yt-dlp_linux if we don't fixup here
if argv and os.getenv('STATICX_PROG_PATH'):
argv[0] = self.filename
return argv

def restart(self):
"""Restart the executable"""
Expand Down

0 comments on commit dea1717

Please sign in to comment.