diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-03-03 18:54:30 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-03-03 19:02:21 +0530 |
commit | 7815e5557231616b65995d2979b4ad701e2fc8c1 (patch) | |
tree | 83621ffc31a14f37c6ab394c2a3592332fa47006 /yt_dlp/update.py | |
parent | 162e6f000009ea1d58f5ea31652343d96ca746c6 (diff) | |
download | hypervideo-pre-7815e5557231616b65995d2979b4ad701e2fc8c1.tar.lz hypervideo-pre-7815e5557231616b65995d2979b4ad701e2fc8c1.tar.xz hypervideo-pre-7815e5557231616b65995d2979b4ad701e2fc8c1.zip |
[update] Fix current build hash for UNIX
Diffstat (limited to 'yt_dlp/update.py')
-rw-r--r-- | yt_dlp/update.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/yt_dlp/update.py b/yt_dlp/update.py index 81c9013a1..5ae4e5204 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -49,12 +49,16 @@ def update_self(to_screen, verbose, opener): h.update(mv[:n]) return h.hexdigest() - to_screen('Current Build Hash %s' % calc_sha256sum(sys.executable)) - if not isinstance(globals().get('__loader__'), zipimporter) and not hasattr(sys, 'frozen'): to_screen('It looks like you installed yt-dlp with a package manager, pip, setup.py or a tarball. Please use that to update.') return + # sys.executable is set to the full pathname of the exe-file for py2exe + # though symlinks are not followed so that we need to do this manually + # with help of realpath + filename = compat_realpath(sys.executable if hasattr(sys, 'frozen') else sys.argv[0]) + to_screen('Current Build Hash %s' % calc_sha256sum(filename)) + # Download and check versions info try: version_info = opener.open(JSON_URL).read().decode('utf-8') @@ -103,11 +107,6 @@ def update_self(to_screen, verbose, opener): (i[1] for i in hashes if i[0] == 'yt-dlp%s' % label), None) - # sys.executable is set to the full pathname of the exe-file for py2exe - # though symlinks are not followed so that we need to do this manually - # with help of realpath - filename = compat_realpath(sys.executable if hasattr(sys, 'frozen') else sys.argv[0]) - if not os.access(filename, os.W_OK): to_screen('ERROR: no write permissions on %s' % filename) return |