From 19eee28f4a12d6474b4a5556bf7d4b8cb9e24429 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Fri, 3 Nov 2023 17:14:38 -0700 Subject: [PATCH] [DOCKER] New default config/subscription in Docker (#798) The default subscription file in the docker container now matches the one in the repo's README --- README.md | 9 ++- docker/root/defaults/config.yaml | 22 +++--- docker/root/defaults/subscriptions.yaml | 100 ++++++++++++++++++++---- tests/unit/config/test_subscription.py | 8 ++ 4 files changed, 108 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 4658f182..8f28f16e 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ that do the work of config-building, so you can start downloading immediately. ```yaml # 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__: @@ -189,7 +191,10 @@ for detailed information on all config fields. ## Installation `ytdl-sub` can be installed on the following platforms. -- [Docker Compose](https://ytdl-sub.readthedocs.io/en/latest/install.html#docker-compose_) +- [Docker Compose](https://ytdl-sub.readthedocs.io/en/latest/install.html#docker-compose) + - [Web-GUI](https://ytdl-sub.readthedocs.io/en/latest/install.html#gui) + - [Headless](https://ytdl-sub.readthedocs.io/en/latest/install.html#headless) + - [CPU / GPU Passthrough](https://ytdl-sub.readthedocs.io/en/latest/install.html#passthrough) - [Docker CLI](https://ytdl-sub.readthedocs.io/en/latest/install.html#docker) - [Windows](https://ytdl-sub.readthedocs.io/en/latest/install.html#windows) - [Unraid](https://ytdl-sub.readthedocs.io/en/latest/install.html#unraid) @@ -200,7 +205,7 @@ for detailed information on all config fields. - [Local Docker Build](https://ytdl-sub.readthedocs.io/en/latest/install.html#local-docker-build) ### Docker Installation -Docker installs can be either headless or use the GUI image, which comprises +Docker installs can be either headless or use the Web-GUI image, which comprises [LSIO's](https://www.linuxserver.io/) [code-server](https://hub.docker.com/r/linuxserver/code-server) Docker image with `ytdl-sub` preinstalled. This is the recommended way to use ``ytdl-sub``. diff --git a/docker/root/defaults/config.yaml b/docker/root/defaults/config.yaml index f8cece1c..6906f357 100644 --- a/docker/root/defaults/config.yaml +++ b/docker/root/defaults/config.yaml @@ -4,20 +4,16 @@ # Prebuilt Presets: https://ytdl-sub.readthedocs.io/en/latest/presets.html # Config Docs: https://ytdl-sub.readthedocs.io/en/latest/config.html # -# Examples are included in the /config/examples/ directory. -# Any config and subscription can be ran using: -# ytdl-sub --config /path/to/config.yaml sub /path/to/subscriptions.yaml +# The subscriptions in `subscriptions.yaml` uses prebuilt presets which do not require +# any additions to this config. They can be downloaded using the command: +# +# ytdl-sub --config config.yaml sub subscriptions.yaml # # Or dry-ran with: -# ytdl-sub --dry-run --config /path/to/config.yaml sub /path/to/subscriptions.yaml +# +# ytdl-sub --dry-run --config config.yaml sub subscriptions.yaml +# +# See the documentation above on how to build your own custom presets. # configuration: - working_directory: '/tmp/ytdl-sub-downloads' - -presets: - - video: - output_options: - output_directory: "/tmp/ytdl-sub-output" - file_name: "{uid}.{ext}" - thumbnail_name: "{uid}.{thumbnail_ext}" + working_directory: ".ytdl-sub-working-directory" diff --git a/docker/root/defaults/subscriptions.yaml b/docker/root/defaults/subscriptions.yaml index eb2ed43f..a63c7994 100644 --- a/docker/root/defaults/subscriptions.yaml +++ b/docker/root/defaults/subscriptions.yaml @@ -1,17 +1,85 @@ -# Bare-bones config. Here are some useful links to get started: -# Walk-through Guide: https://github.com/jmbannon/ytdl-sub/wiki/1.-Introduction -# Config Examples: https://github.com/jmbannon/ytdl-sub/tree/master/examples -# Prebuilt Presets: https://ytdl-sub.readthedocs.io/en/latest/presets.html -# Config Docs: https://ytdl-sub.readthedocs.io/en/latest/config.html -# -# Examples are included in the /config/examples/ directory. -# Any config and subscription can be ran using: -# ytdl-sub --config /path/to/config.yaml sub /path/to/subscriptions.yaml -# -# Or dry-ran with: -# ytdl-sub --dry-run --config /path/to/config.yaml sub /path/to/subscriptions.yaml -# -rammstein_music_videos: - preset: "video" - download: "https://youtube.com/playlist?list=PLVTLbc6i-h_iuhdwUfuPDLFLXG2QQnz-x" +# 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 uploaded in this range + date_range: "2months" + + # Pass any arg directly to yt-dlp's Python API + ytdl_options: + cookiefile: "/config/cookie.txt" + +################################################################### +# Subscriptions nested under this will use the +# `Plex TV Show by Date` preset. +# +# Can choose between: +# - Plex TV Show by Date: +# - Jellyfin TV Show by Date: +# - Kodi TV Show by Date: +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" + +################################################################### +# Subscriptions nested under these will use the various prebuilt +# 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/" + +################################################################### +# Can choose between: +# - Plex Music Videos: +# - Jellyfin Music Videos: +# - Kodi Music Videos: +"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" \ No newline at end of file diff --git a/tests/unit/config/test_subscription.py b/tests/unit/config/test_subscription.py index 7649ef4e..291079d8 100644 --- a/tests/unit/config/test_subscription.py +++ b/tests/unit/config/test_subscription.py @@ -571,3 +571,11 @@ def test_music_video_subscriptions(default_config: ConfigFile, music_video_subsc == "https://www.youtube.com/playlist?list=OLAK5uy_mnY03zP6abNWH929q2XhGzWD_2uKJ_n8E" ) assert monk["subscription_indent_1"] == "Pop" + + +def test_default_docker_config_and_subscriptions(): + default_config = ConfigFile.from_file_path("docker/root/defaults/config.yaml") + default_subs = Subscription.from_file_path( + config=default_config, subscription_path=Path("docker/root/defaults/subscriptions.yaml") + ) + assert len(default_subs) == 15