Commit graph

7 commits

Author SHA1 Message Date
pukkandan 4040428efc
[update] Block further update for unsupported systems 2021-06-01 03:32:09 +05:30
pukkandan b25522ba52
[update] Replace self without launching a subprocess in windows
Closes: #335, https://github.com/ytdl-org/youtube-dl/issues/28488, https://github.com/ytdl-org/youtube-dl/issues/5810, https://github.com/ytdl-org/youtube-dl/issues/5994

In windows, a running executable cannot be replaced. So, the old updater worked by launching a batch script and then exiting, so that the batch script can replace the executable. However, this caused the above-mentioned issues.

The new method takes advantage of the fact that while the executable cannot be replaced or deleted, it can still be renamed. The current update process on windows is as follows:
1. Delete `yt-dlp.exe.old` if it exists
2. Download the new version as `yt-dlp.exe.new`
3. Rename the running exe to `yt-dlp.exe.old`
4. Rename `yt-dlp.exe.new` to `yt-dlp.exe`
5. Open a shell that deletes `yt-dlp.exe.old` and terminate

While we still use a subprocess, the actual update is already done before the app terminates and the batch script does not print anything to stdout/stderr. So this solves all the above issues
2021-05-26 01:13:34 +05:30
pukkandan c19bc311cb
[cleanup] Refactor updater
The updater now uses `.update.run_update` and not `.update.update_self`.
Although I don't expect anyone to be using the updater via API, a wrapper `update_self` is provided for compatibility just in case
2021-05-26 01:13:08 +05:30
pukkandan e28f1c0ae8
[cleanup] Fix linter and some typos
* Also remove inconsistent use of `"` in setup.py
2021-04-28 19:59:40 +05:30
pukkandan c4a508ab31
[update] Fix updater removing the executable bit on some UNIX distros
Closes #133
2021-03-03 19:07:14 +05:30
pukkandan 7815e55572
[update] Fix current build hash for UNIX 2021-03-03 19:02:21 +05:30
Pccode66 7a5c1cfe93
Completely change project name to yt-dlp (#85)
* All modules and binary names are changed
* All documentation references changed
* yt-dlp no longer loads youtube-dlc config files
* All URLs changed to point to organization account

Co-authored-by: Pccode66
Co-authored-by: pukkandan
2021-02-25 00:15:56 +05:30
Renamed from youtube_dlc/update.py (Browse further)