Batch script to download, patch with github pull requests, compile and update youtube-dl from source.
- jq
- curl
- You already have it if you use Windows 10 version 1803 or newer.
- git
- python
- If you have installed more than one version you can choose the one you desire in the configuration; not all versions are necessarily compatible with youtube-dl, I use python 3.9. Make sure you install the py launcher.
- pyinstaller
- pyinstaller.exe must be in the default Python\Scripts\ folder ("Python" is the python installation folder). If you don't know what this is about, you are probably fine.
- cmdow
- Used to maximize the window, you can disable it in the configuration.
Simply download the zip file from the latest release and extract the script and the configuration file somewhere. If the destination folder is contained in PATH you will be able to call youtube-pu as a command everywhere. Make sure to edit the configuration file before using the script.
Simply write youtube-pu
on the command line. The behavior of the command will be similar to youtube-dl -U
, with the difference that the updated executable will be patched with the pull requests selected in the configuration file and compiled with the chosen python version.
In particular, the script will do several actions in the following order:
- Check the local youtube-dl version and the latest release version.
- If the local version corresponds with the version of the latest release, youtube-pu will display a message and exit.
- If the local version is different or if youtube-dl is not present on the system, youtube-pu will ask you if you want to update/install.
- Clone the source with git (the latest version tag, not the main branch).
- Merge your copy of the source with the requested pull requests.
- Compile youtube-dl.exe with pyinstaller.
- Replace the current youtube-dl executable with the just compiled one.
- Delete temporary files and exit.