No description
Find a file
Ross Patterson 2cc24e85f1
fix(docker): Default config available in WORKDIR
When running arbitrary commands in the container, the default configuration and
subscription file paths don't work. I've tested using `$ docker compose up
--workdir="/config" ...` and the s6-overlay base image bits seem to work just fine, the
output from running cron jobs appears. Then running `$ ytdl-sub sub` without options
"Just Works", so I think baking a `WORKDIR` into the image should be OK, but this should
be tested further before breaking everybody's deployments.

I tested locally by bringing up the compose services and confirming from the output that
the s6-overlay init and cron seem to be working correctly. Then I ran `$ ytdl-sub sub
--dry-run` using both `$ docker compose run ...` and `$ docker compose exec ...`. Before
this change, it exits immediately with a message about the subscriptions file
missing. After this change, it starts to download the `NOVA PBS` subscription. In the
GUI image, I also tested the same command in the VS Code web UI terminal.
2025-08-27 09:52:43 -07:00
.github [BUILD] Use windows-latest for build (#1254) 2025-07-02 00:58:07 -07:00
docker fix(docker): Default config available in WORKDIR 2025-08-27 09:52:43 -07:00
docs build(docker): Local Docker image build/testing 2025-08-27 09:52:32 -07:00
examples [DOCS] logs: persistent logs config (#1304) 2025-08-27 09:04:36 -07:00
src/ytdl_sub [DOCS] Clarify debugging, support, reporting (#1305) 2025-08-27 09:10:01 -07:00
tests [DOCS] Various clarifications (#1289) 2025-08-22 07:17:32 -07:00
tools [DOCS] Add warning for auto-generated docs (#1285) 2025-08-17 07:07:25 -07:00
.gitignore [DOCS] Tooling to auto-generate custom sphinx docs (#849) 2023-12-28 22:39:59 -08:00
.readthedocs.yaml [DOCS] Begin complete overhaul of readthedocs (#847) 2023-12-27 10:27:40 -08:00
codecov.yml [BACKEND] Informational codecov only (#170) 2022-08-12 11:34:22 -07:00
LICENSE Initial commit 2021-09-08 21:44:33 -07:00
Makefile [DEV] Makefile improvements (#1283) 2025-08-16 12:04:49 -07:00
pyproject.toml Bump yt-dlp[default] from 2025.8.20 to 2025.8.22 (#1306) 2025-08-27 09:10:28 -07:00
README.md [FEATURE] Emby prebuilt presets (#1232) 2025-06-01 09:56:48 -07:00
ytdl-sub.spec [BUGFIX] Include music prebuilt presets (and all future ones) in executables (#814) 2023-11-11 10:55:05 -08:00

ytdl-sub

Automate downloading and metadata generation with YoutubeDL.

codecov Code Qaulity Checks License

ytdl-sub is a command-line tool that downloads media via yt-dlp and prepares it for your favorite media player, including Kodi, Jellyfin, Plex, Emby, and modern music players. No additional plugins or external scrapers are needed.

We recognize that everyone stores their media differently. Our approach for file and metadata formatting is to provide maximum flexibility while maintaining simplicity.

YouTube Channels as TV Shows

Plex

unknown

Jellyfin

jellyfin

Music Videos and Concerts

Kodi

kodi

Jellyfin

jelly_mv

SoundCloud Discography

Writes proper music-tags via beets API

sc_mb

Bandcamp Discography

bc_nav

How it Works

ytdl-sub uses YAML files to define subscriptions. Each subscription imports presets that define how to handle and output media files. ytdl-sub comes packaged with many prebuilt presets that do the work of config-building, so you can start downloading immediately.

# subscriptions.yaml:
# Everything in here can be downloaded using the command:
#   ytdl-sub sub subscriptions.yaml

# __preset__ is a place to define global overrides for all subscriptions
__preset__:
  overrides:
    # Root folder of all ytdl-sub TV Shows
    tv_show_directory: "/tv_shows"
    
    # Root folder of all ytdl-sub Music
    music_directory: "/music"
    
    # Root folder of all ytdl-sub Music Videos
    music_video_directory: "/music_videos"
    
    # For 'Only Recent' preset, only keep vids within this range and limit
    only_recent_date_range: "2months"
    only_recent_max_files: 30
    
  # Pass any arg directly to yt-dlp's Python API
  ytdl_options:
    cookiefile: "/config/cookie.txt" 

###################################################################
# TV Show Presets. Can replace Plex with Plex/Jellyfin/Emby/Kodi

Plex TV Show by Date:

  # Sets genre tag to "Documentaries"
  = Documentaries:
    "NOVA PBS": "https://www.youtube.com/@novapbs"
    "National Geographic": "https://www.youtube.com/@NatGeo"
    "Cosmos - What If": "https://www.youtube.com/playlist?list=PLZdXRHYAVxTJno6oFF9nLGuwXNGYHmE8U"

  # Sets genre tag to "Kids", "TV-Y" for content rating
  = Kids | = TV-Y:
    "Jake Trains": "https://www.youtube.com/@JakeTrains"
    "Kids Toys Play": "https://www.youtube.com/@KidsToysPlayChannel"

  = Music:
    # TV show subscriptions can support multiple urls and store in the same TV Show
    "Rick Beato":
      - "https://www.youtube.com/@RickBeato"
      - "https://www.youtube.com/@rickbeato240"

  # Set genre tag to "News", use `Only Recent` preset to only store videos uploaded recently
  = News | Only Recent:
    "BBC News": "https://www.youtube.com/@BBCNews"

Plex TV Show Collection:
  = Music:
    # Prefix with ~ to set specific override variables
    "~Beyond the Guitar":
      s01_name: "Videos"
      s01_url: "https://www.youtube.com/c/BeyondTheGuitar"
      s02_name: "Covers"
      s02_url: "https://www.youtube.com/playlist?list=PLE62gWlWZk5NWVAVuf0Lm9jdv_-_KXs0W"

###################################################################
# Music Presets.

YouTube Releases:
  = Jazz:  # Sets genre tag to "Jazz"
    "Thelonious Monk": "https://www.youtube.com/@theloniousmonk3870/releases"

YouTube Full Albums:
  = Lofi:
    "Game Chops": "https://www.youtube.com/playlist?list=PLBsm_SagFMmdWnCnrNtLjA9kzfrRkto4i"

SoundCloud Discography:
  = Chill Hop:
    "UKNOWY": "https://soundcloud.com/uknowymunich"
  = Synthwave:
    "Lazerdiscs Records": "https://soundcloud.com/lazerdiscsrecords"
    "Earmake": "https://soundcloud.com/earmake"

Bandcamp:
  = Lofi:
    "Emily Hopkins": "https://emilyharpist.bandcamp.com/"

###################################################################
# Music Video Presets. Can replace Plex with Plex/Jellyfin/Kodi
"Plex Music Videos":
  = Pop:  # Sets genre tag to "Pop"
    "Rick Astley": "https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc"
    "Michael Jackson": "https://www.youtube.com/playlist?list=OLAK5uy_mnY03zP6abNWH929q2XhGzWD_2uKJ_n8E"

All of this can be downloaded and ready to import to your favorite player using the command

ytdl-sub sub subscriptions.yaml

See our example subscriptions for more detailed examples and use-cases.

Output

After ytdl-sub runs, the end result will download and format the files into something ready to be consumed by your favorite media player/server.

tv_shows/
  Jake Trains/
    Season 2021/
      s2021.e031701 - Pattys Day Video-thumb.jpg
      s2021.e031701 - Pattys Day Video.mp4
      s2021.e031701 - Pattys Day Video.nfo
      s2021.e031702 - Second Pattys Day Video-thumb.jpg
      s2021.e031702 - Second Pattys Day Video.mp4
      s2021.e031702 - Second Pattys Day Video.nfo
    Season 2022/
      s2022.e122501 - Merry Christmas-thumb.jpg
      s2022.e122501 - Merry Christmas.mp4
      s2022.e122501 - Merry Christmas.nfo
    poster.jpg
    fanart.jpg
    tvshow.nfo

music/
  Artist/
    [2022] Some Single/
      01 - Some Single.mp3
      folder.jpg
    [2023] Latest Album/
      01 - Track Title.mp3
      02 - Another Track.mp3
      folder.jpg

music_videos/
  Elton John/
    Elton John - Rocketman.jpg
    Elton John - Rocketman.mp4

Custom Configs

Any part of this process is modifiable by using custom configs. See our walk-through guide on how to build your first config from scratch. Ready-to-use example configurations can be found here alongside our readthedocs for detailed information on all config fields.

Installation

ytdl-sub can be installed on the following platforms.

Docker Installation

Docker installs can be either headless or use the Web-GUI image, which comprises LSIO's code-server Docker image with ytdl-sub preinstalled. This is the recommended way to use ytdl-sub.

image

Contributing

There are many ways to contribute, even without coding. Please take a look in our GitHub Issues to submit a feature request, or pick up a bug.

Support

We are pretty active in our Discord channel if you have any questions. Also see our FAQ for commonly asked questions.