-
Notifications
You must be signed in to change notification settings - Fork 1
Wiki en
This script provides a simple graphical interface for the yt-dlp
command. No installation is required. Just open the software, paste the video link, and click "Start Download" or press Enter
to download the video.
Screenshot of the main interface (V2.0.0 version)
System Requirements | Description |
---|---|
Operating System | Windows 7 and above |
Other Software | ffmpeg (important, must be installed) |
- Download ffmpeg from the ffmpeg official website.
- Open "Edit System Environment Variables" settings.
- Find the variable named "Path" in the system variables and click "Edit".
- Add the installation directory path of ffmpeg (e.g. "C:\path\to\ffmpeg").
- Confirm the changes and close the window. Restart your computer or open a new command prompt to enable the environment variable.
- Video download: You can specify videos (up to YouTube 8K) and audio of any quality. It supports downloading playlists and thumbnails.
- Support for most video websites: It supports Bilibili, YouTube, Youku, TikTok and almost all video websites. See Supported Websites for details.
- Support for keyword search: Enter a search keyword in the video link to download the most matching video from YouTube.
- Subtitle download: You can download subtitle files (if any) in the specified language and format. Check "Translate Subtitles" to translate them into the desired language.
Download the software, no installation is required. After opening, paste the video link and click "Start Download" or press Enter
to download the video.
- Import cookies: For some videos that require login or membership to watch, you may need to check "Import Cookies" to download (Version 1.1.2 and above).
- Download short videos: Since the video quality is the maximum height of the video, when downloading TikTok, YouTube Shorts or other short videos, the video quality should be selected to be greater than 1920.
-
Default current folder: The download folder is optional. The default is to download to the
videos
folder under the current software directory. - Download danmaku: To download danmaku files from Bilibili and other danmaku websites, check "Download all subtitles" (danmaku download option added in V2.1.0)
-
Subtitle translation and automatic subtitle generation:
- Except for YouTube, not all websites support subtitle translation;
-
Before V2.1.0: To download automatically generated subtitles, the video must first have automatic subtitles. Then check "Translate" and change any line on the right to
LANG_CODE-orig
(LANG_CODE
is the language code). Change another line to blank. For example, changeen
toen-orig
(English automatic subtitles) - V2.1.0 and above: To download automatically generated subtitles, select "auto" for "Language". To translate automatically generated subtitles, check "Translate into" and select the language you want to translate into.
Please make sure the following python modules are installed on your computer: yt-dlp
, ttkthemes
, pyyaml
. Execute the following command to install:
pip install yt-dlp ttkthemes pyyaml
In the project directory, execute the following command to run:
python .\yt-dlp-simple-gui.py
In the project directory, execute the following command to package the result into a single executable file yt-dlp-simple-gui.exe
(including all dependencies):
pip install pyinstaller pyinstaller-versionfile
create-version-file metadata.yml --outfile versioninfo.txt
pyinstaller -F --onefile .\yt-dlp-simple-gui.py -i download_icon.ico --version-file=versioninfo.txt --paths C:\users\dell\appdata\local\programs\python\python310 \lib\site-packages\yt-dlp,websockets,pycryptodomex,brotli,certifi,mutagen,ttkthemes,pillow,pyyaml --clean
To improve the exe startup and loading speed, it can be packaged into a file directory:
create-version-file metadata.yml --outfile versioninfo.txt
pyinstaller -F --onedir .\yt-dlp-simple-gui.py -i download_icon.ico --version-file=versioninfo.txt --paths C:\users\dell\appdata\local\programs\python\python310 \lib\site-packages\yt-dlp,websockets,pycryptodomex,brotli,certifi,mutagen,ttkthemes,pillow,pyyaml --clean
At this point, all the results are packaged into a folder, which includes an executable file yt-dlp-simple-gui.exe
and dependent files (default) required for execution of the executable file.
Execute the following code:
pip install pipenv
pipenv install
pipenv shell
Wait until the virtual environment starts, and then execute the following code:
pip install yt-dlp pyinstaller ttkthemes pyyaml pyinstaller-versionfile
create-version-file metadata.yml --outfile versioninfo.txt
Choose one of the following two lines of code:
:: generate a single executable file exe
pyinstaller -F --onefile .\yt-dlp-simple-gui.py -i download_icon.ico --version-file=versioninfo.txt --clean
:: Generate file directory (can be packaged into zip)
pyinstaller -F --onedir .\yt-dlp-simple-gui.py -i download_icon.ico --version-file=versioninfo.txt --clean
Then copy UPX.exe
to the same folder as pyinstaller.exe
. Modify the .spec
file generated by pyinstaller
, change upx=False
to upx=True
, and then execute the following code:
:: (if already True, skip this line)
pyinstaller yt-dlp-simple-gui.spec
pipenv --rm
exit
After Version 2.0.0, the Qt framework (PyQt5) is used to construct the software, and additional steps are required for compilation.
- Clone the source code of yt-dlp locally:
git clone https://github.com/yt-dlp/yt-dlp .git
- Copy all the source code of the yt-dlp project to the
qt-gui
folder of this project - Execute the following command in the folder (if it is python3, execute the
python3
command):
python -m pip install -U pyinstaller -r requirements.txt
pip install yt-dlp pyyaml pyqt5 pyinstaller pyinstaller-versionfile
create-version-file metadata.yml --outfile versioninfo.txt
:: generate a single executable file exe
pyinstaller --onefile yt-dlp-simple-gui-qt.py --add-data "constants.py;." --add-data "ui.py;." --add-data "download_icon.ico;." --add-data "yt-dlp-simple-gui.ui;." --add-data "about_ui.py;." --add-data "about.ui;." --add-data "translations/*.qm;translations" -i download_icon.ico --version-file=versioninfo.txt --clean
:: Generate file directory (can be packaged into zip)
pyinstaller --onedir yt-dlp-simple-gui-qt.py --add-data "constants.py;." --add-data "ui.py;." --add-data "download_icon.ico;." --add-data "yt-dlp-simple-gui.ui;." --add-data "about_ui.py;." --add-data "about.ui;." --add-data "translations/*.qm;translations" -i download_icon.ico --version-file=versioninfo.txt --clean
Console Window can be hided from adding parameter --noconsole
after the command since V2.1.0.
There are .ts
and .qm
files under the translation
folder, where .ts
files are in xml
format, and .qm
is a binary file. Proceed as follows:
- Modify the ui files such as
yt-dlp-simple-gui.ui
in the Qt Designer software, and then execute the following code in the current qt project directory (qt-gui
):
pyuic5 yt-dlp-simple-gui.ui -o ui.py
::...(other ui files)
- Compile the ts file, the code is as follows (the middle of the language code is an underscore
_
, not a horizontal bar-
):
pylupdate5 yt-dlp-simple-gui-qt.py ui.py -ts translations/en.ts
pylupdate5 yt-dlp-simple-gui-qt.py ui.py -ts translations/zh_TW.ts
::...(other languages)
- Open all
ts
files with Qt Linguist, add translations, and select "Generate All". - In the
getFont()
function ofyt-dlp-simple-gui-qt.py
, add the font of the corresponding language, and add theswitch_language
method of the corresponding language in therunAction
function; - There are other places where language parameters need to be added:
constant.py
, some initialization places can be written according to the format of the language added before.
This project is licensed under the MIT License.
This Wiki is part of the yt-dlp-simple-gui project(zh-CN), providing detailed documentation and guides for using the yt-dlp-simple-gui tool effectively. It complements the graphical user interface (GUI) tool, making video downloading and management more convenient.
Copyright (c) 2023 Guo Jingxing