Skip to content

Commit

Permalink
feat: add support for yt-dlp
Browse files Browse the repository at this point in the history
  • Loading branch information
qx6ghqkz committed Jun 19, 2024
1 parent f5474c2 commit de0604f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ docker run -d \
--user 1000:1000 \
-p 9080:9080 \
--mount type=bind,source="/path/to/config/gallery-dl.conf",target=/etc/gallery-dl.conf,readonly \
--mount type=bind,source="/path/to/config/yt-dlp.conf",target=/etc/yt-dlp.conf,readonly \
--mount type=bind,source="/path/to/downloads/gallery-dl",target=/gallery-dl \
--mount type=bind,source="/path/to/downloads/yt-dlp",target=/yt-dlp \
--mount type=bind,source="/path/to/data/archive.txt",target=/data/archive.txt \
--mount type=bind,source="/path/to/data/cookies.txt",target=/data/cookies.txt \
--restart unless-stopped \
qx6ghqkz/gallery-dl-server:latest
```
Expand All @@ -35,9 +39,21 @@ services:
- type: bind
source: "/path/to/config/gallery-dl.conf"
target: /etc/gallery-dl.conf
- type: bind
source: "/path/to/config/yt-dlp.conf"
target: /etc/yt-dlp.conf
- type: bind
source: "/path/to/downloads/gallery-dl"
target: /gallery-dl
- type: bind
source: "/path/to/downloads/yt-dlp"
target: /yt-dlp
- type: bind
source: "/path/to/data/archive.txt"
target: /data/archive.txt
- type: bind
source: "/path/to/data/cookies.txt"
target: /data/cookies.txt
restart: unless-stopped
```
Expand All @@ -57,6 +73,10 @@ The configuration file must be mounted inside the Docker container in one of the

The config location used in the examples is `/etc/gallery-dl.conf`. A default config file for use with gallery-dl-server is provided in this repo ([link](https://github.com/qx6ghqkz/gallery-dl-server/blob/main/gallery-dl.conf)).

The same goes for yt-dlp ([documentation](https://github.com/yt-dlp/yt-dlp/tree/master?tab=readme-ov-file#configuration)). The configuration file in the examples is mounted at `/etc/yt-dlp.conf`. An example config file for yt-dlp is provided [here](https://github.com/qx6ghqkz/gallery-dl-server/blob/main/yt-dlp.conf).

Any additional directories specified in the configuration files must also be mounted inside the Docker container, for example if you specify a cookies file location then that file must be mounted in that same location inside the Docker container.

## Usage

### Start a download remotely
Expand Down
9 changes: 3 additions & 6 deletions gallery-dl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,9 @@

"ytdl":
{
"format": null,
"forward-cookies": false,
"logging": true,
"module": null,
"outtmpl": null,
"raw-options": null
"enabled": true,
"module": "yt_dlp",
"logging": true
}
},

Expand Down
15 changes: 15 additions & 0 deletions yt-dlp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--ignore-errors
--no-cache-dir
--no-playlist
--cookies "/data/cookies.txt"
--download-archive "/data/archive.txt"
--output "/yt-dlp/%(title).200s [%(id)s].%(ext)s"
--format "(bestvideo[ext=mp4]/bestvideo)+(bestaudio[ext=m4a]/bestaudio)/best"
--merge-output-format "mp4"
--convert-thumbnails "png"
--embed-thumbnail
--sub-langs "en.*,ja"
--sub-format "srt/best"
--convert-subs "srt"
--embed-subs
--embed-metadata

0 comments on commit de0604f

Please sign in to comment.