You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yt-dlp/yt_dlp
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
3 years ago
..
downloader [ffmpeg] Download and merge in a single step if possible 3 years ago
extractor [ard] Allow URLs without `-` before id 3 years ago
postprocessor [ard] Allow URLs without `-` before id 3 years ago
YoutubeDL.py [cleanup] Refactor updater 3 years ago
__init__.py [cleanup] Refactor updater 3 years ago
__main__.py Completely change project name to yt-dlp (#85) 4 years ago
aes.py Completely change project name to yt-dlp (#85) 4 years ago
cache.py Completely change project name to yt-dlp (#85) 4 years ago
compat.py [downloader/hls] Assemble single-file WebVTT subtitles from HLS segments 3 years ago
jsinterp.py Completely change project name to yt-dlp (#85) 4 years ago
options.py [cleanup] Refactor ffmpeg convertors 3 years ago
socks.py Completely change project name to yt-dlp (#85) 4 years ago
swfinterp.py Completely change project name to yt-dlp (#85) 4 years ago
update.py [update] Replace self without launching a subprocess in windows 3 years ago
utils.py Handle Basic Auth `user:pass` in URLs 3 years ago
version.py [version] update 3 years ago
webvtt.py [downloader/hls] Remove duplicate cues using a sliding window of candidates 3 years ago