Skip to content

Commit

Permalink
config rewrite for presets
Browse files Browse the repository at this point in the history
  • Loading branch information
dsymbol committed Oct 1, 2024
1 parent 610b498 commit c7d6710
Show file tree
Hide file tree
Showing 13 changed files with 613 additions and 562 deletions.
48 changes: 31 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,62 @@
name: Release

on:
push:
paths:
- 'app/version.py'
workflow_dispatch:
inputs:
version:
description: "version"
required: false

permissions:
contents: write

env:
QT_QPA_PLATFORM: offscreen
QT_QPA_PLATFORM: offscreen

jobs:
build-windows:
name: build-windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -U "https://yt-dlp.github.io/Pyinstaller-Builds/x86_64/pyinstaller-6.7.0-py3-none-any.whl"
- name: Build application
- name: Set version
working-directory: ./app
shell: bash
run: |
pyinstaller --name=yt-dlp-gui --clean -y app.py --icon ./ui/assets/yt-dlp-gui.ico --noconsole
Compress-Archive -Path dist/* -DestinationPath yt-dlp-gui-win64.zip
if [ -n "${{ github.event.inputs.version }}" ]; then
version=${{ github.event.inputs.version }}
else
version=$(git rev-parse --short HEAD)
fi
sed -i "s/^__version__.*/__version__ = \"$version\"/" ./app.py
- name: Get version
- name: Build application
working-directory: ./app
run: echo "VERSION=$(python -c "from version import __version__; print(__version__)")" | Out-File -FilePath $env:GITHUB_ENV -Append
run: |
pyinstaller --name=yt-dlp-gui --clean -y app.py --icon ./ui/assets/yt-dlp-gui.ico --add-data "config.toml;." --noconsole
Compress-Archive -Path dist/* -DestinationPath ./yt-dlp-gui-win64.zip
- uses: actions/upload-artifact@v4
if: ${{ github.event.inputs.version == '' }}
with:
name: yt-dlp-gui-win64
path: ./app/dist/

- name: Create Release
uses: softprops/action-gh-release@v1
- uses: softprops/action-gh-release@v2
if: ${{ github.event.inputs.version != '' }}
with:
name: ${{ env.VERSION }}
tag_name: ${{ env.VERSION }}
tag_name: ${{ github.event.inputs.version }}
generate_release_notes: true
draft: false
prerelease: false
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ dmypy.json
.idea/
bin/

config.json
config.toml
debug.log
82 changes: 30 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,68 @@
# yt-dlp-gui
Graphical interface for the command line tool [yt-dlp](https://github.com/yt-dlp/yt-dlp), which allows users to download
videos from various [websites](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md), including YouTube.
It is designed to be more user-friendly and accessible for those who are not comfortable using the command line.

Graphical interface for the command line tool [yt-dlp](https://github.com/yt-dlp/yt-dlp) with preset customization.

## Screenshot

![](https://github.com/dsymbol/yt-dlp-gui/assets/88138099/4e14b95e-a716-48ad-9d68-8da9a14df755)
![](https://github.com/user-attachments/assets/8e758f07-3cdb-477c-91ab-0ee20c2443e8)

## Getting Started
## Usage

There are three ways to get started, depending on your preference and system:
There are two ways to get started, depending on your preference and system:

* [`Portable`](#portable) ~ *Windows*
* [`Build`](#build) ~ *Windows & Linux*
* [`Manual`](#manual) ~ *Platform independent*

### Portable

Download the latest portable version from the [releases](https://github.com/dsymbol/yt-dlp-gui/releases/latest) section.
This will download a ZIP file containing the program files and all necessary dependencies.
Download the latest portable version from the the [releases](https://github.com/dsymbol/yt-dlp-gui/releases/latest) section.
This is a ZIP file containing the program files and all necessary dependencies.

*All releases are built and released using GitHub Workflow*

### Build
### Manual

You **must** have [Python](https://www.python.org/downloads/) 3.9+ installed.

To build yt-dlp-gui from its source code:

1. Clone the repository onto your local machine:

```bash
git clone https://github.com/dsymbol/yt-dlp-gui
cd yt-dlp-gui
```

2. Install the necessary dependencies:

```bash
pip install -r requirements.txt
```

3. Use PyInstaller to compile the program:

```bash
cd app
python app.py
```

#### Linux

```bash
pyinstaller --name=yt-dlp-gui --clean -y app.py
```
## Preset Customization

#### Windows
If you want to create your own presets or modify the existing ones, you're in the right place. All customization options can be found in the `config.toml` file.

```pwsh
pyinstaller --name=yt-dlp-gui --clean -y app.py --icon ./ui/assets/yt-dlp-gui.ico --noconsole
```
### Available Fields

4. The executable will be ready at:
To define a preset, the section name must begin with `presets.`. Below are the fields you can use to customize your presets:

```bash
./dist/yt-dlp-gui
```
- **args** (required): This field specifies the arguments for `yt-dlp`. It can be provided as a string or a list.

### Manual
- **path** (optional): This string field allows you to specify the output path. If this field is left out, it must be included in the `args` field.

You **must** have [Python](https://www.python.org/downloads/) 3.9+ installed.
- **filename** (optional): This string field allows you to define the naming convention. If this field is left out, it must be specified in the `args` field.

1. Clone the repository onto your local machine:
- **sponsorblock** (optional): This integer field allows you to set SponsorBlock functionality. `0` to disable or `1` to remove and `2` to mark.

```bash
git clone https://github.com/dsymbol/yt-dlp-gui
cd yt-dlp-gui
```
- **metadata** (optional): This boolean field determines whether to include metadata.

2. Install the necessary dependencies:
- **subtitles** (optional): This boolean field determines whether to include subtitles.

```bash
pip install -r requirements.txt
```
- **thumbnail** (optional): This boolean field determines whether to include thumbnail.

3. Run the program:
Below an example of how to add the `wav` format, you will notice I left out `subtitles` and `thumbnail` as they're not applicable for this format.

```bash
cd app
python app.py
```toml
[presets.wav]
args = "--extract-audio --audio-format wav --audio-quality 0"
path = ""
filename = "%(title)s.%(ext)s"
sponsorblock = 0
metadata = false
```

Try it yourself by pasting it to the bottom of your `config.toml` file! You will see that any fields not included in the preset will be disabled in the GUI. If you encounter any issues with your preset, check the `debug.log` file which is located in the root directory of the program for details.
Loading

0 comments on commit c7d6710

Please sign in to comment.