From 726da5b6beab6f2287066c632c8bae961db1bedf Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sun, 13 Nov 2022 11:24:59 -0800 Subject: [PATCH] [BACKEND] Update docker container to have latest examples (#319) --- .github/workflows/package.yaml | 3 ++ docker/root/defaults/config.yaml | 56 +++++++++---------------- docker/root/defaults/subscriptions.yaml | 21 +++++++--- docker/root/etc/cont-init.d/30-config | 2 + 4 files changed, 40 insertions(+), 42 deletions(-) diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index f514690c..b5f931ad 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -38,9 +38,12 @@ jobs: - name: Build Wheel run: | + # Build wheel and copy to docker dir pip install -e .[build] python setup.py bdist_wheel cp dist/*.whl docker/root + # Copy examples to docker defaults dir + cp -R examples docker/root/defaults/ - name: Save Python build cache uses: actions/cache@v3 diff --git a/docker/root/defaults/config.yaml b/docker/root/defaults/config.yaml index 43d2fea8..3ff27547 100644 --- a/docker/root/defaults/config.yaml +++ b/docker/root/defaults/config.yaml @@ -1,44 +1,26 @@ +# 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 +# configuration: working_directory: '/tmp/ytdl-sub-downloads' -# All example presets are included in this default config.yaml, -# feel free to change it as you see fit. For a detailed explanation -# of the examples, see https://ytdl-sub.readthedocs.io/en/latest/examples.html presets: - ############################################################################# - # Downloads single videos and stores them as Kodi/Jellyfin/Emby music videos, - # which all live in a single directory. - yt_music_video: - youtube: - download_strategy: "video" + video: + download: + download_strategy: "url" output_options: - output_directory: "{music_video_directory}" - file_name: "{music_video_name}.{ext}" - thumbnail_name: "{music_video_name}-thumb.jpg" - - nfo_tags: - nfo_name: "{music_video_name}.nfo" - nfo_root: "musicvideo" - tags: - artist: "{artist}" - title: "{title}" - album: "Music Videos" - year: "{upload_year}" - - overrides: - music_video_directory: "/music_videos" - music_video_name: "{artist_sanitized} - {title_sanitized}" - # artist: # FILL THIS OUT IN THE SUBSCRIPTION - - ############################################################################# - # Downloads playlists and stores all videos as Kodi/Jellyfin/Emby music - # videos, which all live in a single directory. - yt_music_video_playlist: - preset: "yt_music_video" - youtube: - download_strategy: "playlist" - - output_options: - maintain_download_archive: True + output_directory: "/tmp/ytdl-sub-output" + file_name: "{uid}.{ext}" + thumbnail_name: "{uid}.{thumbnail_ext}" diff --git a/docker/root/defaults/subscriptions.yaml b/docker/root/defaults/subscriptions.yaml index bf5e6527..3d0a3afa 100644 --- a/docker/root/defaults/subscriptions.yaml +++ b/docker/root/defaults/subscriptions.yaml @@ -1,7 +1,18 @@ +# 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: "yt_music_video_playlist" - youtube: - playlist_url: "https://youtube.com/playlist?list=PLVTLbc6i-h_iuhdwUfuPDLFLXG2QQnz-x" - overrides: - artist: "Rammstein" + preset: "video" + download: + url: "https://youtube.com/playlist?list=PLVTLbc6i-h_iuhdwUfuPDLFLXG2QQnz-x" diff --git a/docker/root/etc/cont-init.d/30-config b/docker/root/etc/cont-init.d/30-config index cc58f75d..9fd18e67 100644 --- a/docker/root/etc/cont-init.d/30-config +++ b/docker/root/etc/cont-init.d/30-config @@ -5,6 +5,8 @@ cp /defaults/config.yaml /config/config.yaml [[ ! -e /config/subscriptions.yaml ]] && \ cp /defaults/subscriptions.yaml /config/subscriptions.yaml +[[ ! -d /config/examples ]] && \ + cp -R /defaults/examples /config/ # permissions chown -R abc:abc \