From 3d06163a47dfce662f4897d61f8f41db270a4c14 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sat, 30 Mar 2024 17:50:45 -0700 Subject: [PATCH] new readme --- README.md | 27 +- examples/tv_show_subscriptions.yaml | 19 +- .../tv_show/tv_show_collection.yaml | 310 ++++++++++++------ tests/unit/config/test_subscription.py | 2 +- 4 files changed, 241 insertions(+), 117 deletions(-) diff --git a/README.md b/README.md index 15036dff..01fd005c 100644 --- a/README.md +++ b/README.md @@ -71,13 +71,8 @@ __preset__: 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: +# TV Show Presets. Can replace Plex with Plex/Jellyfin/Kodi + Plex TV Show by Date: # Sets genre tag to "Documentaries" @@ -101,9 +96,18 @@ Plex TV Show by Date: = 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" + ################################################################### -# Subscriptions nested under these will use the various prebuilt -# music presets +# Music Presets. Can replace Plex with Plex/Jellyfin/Kodi + YouTube Releases: = Jazz: # Sets genre tag to "Jazz" "Thelonious Monk": "https://www.youtube.com/@theloniousmonk3870/releases" @@ -124,10 +128,7 @@ Bandcamp: "Emily Hopkins": "https://emilyharpist.bandcamp.com/" ################################################################### -# Can choose between: -# - Plex Music Videos: -# - Jellyfin Music Videos: -# - Kodi Music Videos: +# Music Video Presets "Plex Music Videos": = Pop: # Sets genre tag to "Pop" "Rick Astley": "https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc" diff --git a/examples/tv_show_subscriptions.yaml b/examples/tv_show_subscriptions.yaml index d8b914cb..eb88e4da 100644 --- a/examples/tv_show_subscriptions.yaml +++ b/examples/tv_show_subscriptions.yaml @@ -55,4 +55,21 @@ Plex TV Show by Date: # Set "News" for genre, use `Only Recent` preset to only store videos uploaded recently = News | Only Recent: - "BBC News": "https://www.youtube.com/@BBCNews" \ No newline at end of file + "BBC News": "https://www.youtube.com/@BBCNews" + +# Sets URLs to be explicit seasons. If a video resides in multiple URLs, it will +# only appear once in the higher-numbered season. This is how you can separate a channel's +# videos and playlists you are interested in. +# +# Choose the player you intend to use by setting the top-level key to be either: +# - Plex TV Show Collection: +# - Jellyfin TV Show Collection: +# - Kodi TV Show Collection: +Plex TV Show Collection: + = Music: + "~Beyond the Guitar": + s01_name: "Videos" + s01_url: "https://www.youtube.com/c/BeyondTheGuitar" + + s02_name: "Music Videos" + s02_url: "https://www.youtube.com/playlist?list=PLE62gWlWZk5NWVAVuf0Lm9jdv_-_KXs0W" diff --git a/src/ytdl_sub/prebuilt_presets/tv_show/tv_show_collection.yaml b/src/ytdl_sub/prebuilt_presets/tv_show/tv_show_collection.yaml index 7846aaa2..8554fda9 100644 --- a/src/ytdl_sub/prebuilt_presets/tv_show/tv_show_collection.yaml +++ b/src/ytdl_sub/prebuilt_presets/tv_show/tv_show_collection.yaml @@ -1,5 +1,25 @@ presets: + ############################### + # All-in-one presets that require no config + + "Kodi TV Show Collection": + preset: + - "kodi_tv_show_collection" + - "season_by_collection__episode_by_year_month_day" + + "Jellyfin TV Show Collection": + preset: + - "jellyfin_tv_show_collection" + - "season_by_collection__episode_by_year_month_day" + + "Plex TV Show Collection": + preset: + - "plex_tv_show_collection" + - "season_by_collection__episode_by_year_month_day" + + ################## + kodi_tv_show_collection: preset: - "_kodi_tv_show" @@ -15,6 +35,30 @@ presets: - "_plex_tv_show" - "_tv_show_collection" + ############################### + + season_by_collection__episode_by_year_month_day: + overrides: + episode_number: "{upload_year_truncated}{upload_month_padded}{upload_day_padded}{upload_date_index_padded}" + episode_number_padded: "{episode_number}" + + season_by_collection__episode_by_year_month_day_reversed: + overrides: + episode_number: "{upload_year_truncated_reversed}{upload_month_reversed_padded}{upload_day_reversed_padded}{upload_date_index_reversed_padded}" + episode_number_padded: "{episode_number}" + + season_by_collection__episode_by_playlist_index: + overrides: + episode_number: "{playlist_index}" + episode_number_padded: "{playlist_index_padded6}" + + season_by_collection__episode_by_playlist_index_reversed: + overrides: + episode_number: "{playlist_index_reversed}" + episode_number_padded: "{playlist_index_reversed_padded6}" + + ############## + _tv_show_collection: download: - url: "{collection_season_1_url}" @@ -438,87 +482,171 @@ presets: season_number: "{collection_season_number}" season_number_padded: "{collection_season_number_padded}" - collection_season_1_url: "" - collection_season_1_name: "" - collection_season_2_url: "" - collection_season_2_name: "" - collection_season_3_url: "" - collection_season_3_name: "" - collection_season_4_url: "" - collection_season_4_name: "" - collection_season_5_url: "" - collection_season_5_name: "" - collection_season_6_url: "" - collection_season_6_name: "" - collection_season_7_url: "" - collection_season_7_name: "" - collection_season_8_url: "" - collection_season_8_name: "" - collection_season_9_url: "" - collection_season_9_name: "" - collection_season_10_url: "" - collection_season_10_name: "" - collection_season_11_url: "" - collection_season_11_name: "" - collection_season_12_url: "" - collection_season_12_name: "" - collection_season_13_url: "" - collection_season_13_name: "" - collection_season_14_url: "" - collection_season_14_name: "" - collection_season_15_url: "" - collection_season_15_name: "" - collection_season_16_url: "" - collection_season_16_name: "" - collection_season_17_url: "" - collection_season_17_name: "" - collection_season_18_url: "" - collection_season_18_name: "" - collection_season_19_url: "" - collection_season_19_name: "" - collection_season_20_url: "" - collection_season_20_name: "" - collection_season_21_url: "" - collection_season_21_name: "" - collection_season_22_url: "" - collection_season_22_name: "" - collection_season_23_url: "" - collection_season_23_name: "" - collection_season_24_url: "" - collection_season_24_name: "" - collection_season_25_url: "" - collection_season_25_name: "" - collection_season_26_url: "" - collection_season_26_name: "" - collection_season_27_url: "" - collection_season_27_name: "" - collection_season_28_url: "" - collection_season_28_name: "" - collection_season_29_url: "" - collection_season_29_name: "" - collection_season_30_url: "" - collection_season_30_name: "" - collection_season_31_url: "" - collection_season_31_name: "" - collection_season_32_url: "" - collection_season_32_name: "" - collection_season_33_url: "" - collection_season_33_name: "" - collection_season_34_url: "" - collection_season_34_name: "" - collection_season_35_url: "" - collection_season_35_name: "" - collection_season_36_url: "" - collection_season_36_name: "" - collection_season_37_url: "" - collection_season_37_name: "" - collection_season_38_url: "" - collection_season_38_name: "" - collection_season_39_url: "" - collection_season_39_name: "" - collection_season_40_url: "" - collection_season_40_name: "" + # Legacy name variable + collection_season_1_name: "{s01_name}" + collection_season_2_name: "{s02_name}" + collection_season_3_name: "{s03_name}" + collection_season_4_name: "{s04_name}" + collection_season_5_name: "{s05_name}" + collection_season_6_name: "{s06_name}" + collection_season_7_name: "{s07_name}" + collection_season_8_name: "{s08_name}" + collection_season_9_name: "{s09_name}" + collection_season_10_name: "{s10_name}" + collection_season_11_name: "{s11_name}" + collection_season_12_name: "{s12_name}" + collection_season_13_name: "{s13_name}" + collection_season_14_name: "{s14_name}" + collection_season_15_name: "{s15_name}" + collection_season_16_name: "{s16_name}" + collection_season_17_name: "{s17_name}" + collection_season_18_name: "{s18_name}" + collection_season_19_name: "{s19_name}" + collection_season_20_name: "{s20_name}" + collection_season_21_name: "{s21_name}" + collection_season_22_name: "{s22_name}" + collection_season_23_name: "{s23_name}" + collection_season_24_name: "{s24_name}" + collection_season_25_name: "{s25_name}" + collection_season_26_name: "{s26_name}" + collection_season_27_name: "{s27_name}" + collection_season_28_name: "{s28_name}" + collection_season_29_name: "{s29_name}" + collection_season_30_name: "{s30_name}" + collection_season_31_name: "{s31_name}" + collection_season_32_name: "{s32_name}" + collection_season_33_name: "{s33_name}" + collection_season_34_name: "{s34_name}" + collection_season_35_name: "{s35_name}" + collection_season_36_name: "{s36_name}" + collection_season_37_name: "{s37_name}" + collection_season_38_name: "{s38_name}" + collection_season_39_name: "{s39_name}" + collection_season_40_name: "{s40_name}" + # Legacy url variable + collection_season_1_url: "{s01_url}" + collection_season_2_url: "{s02_url}" + collection_season_3_url: "{s03_url}" + collection_season_4_url: "{s04_url}" + collection_season_5_url: "{s05_url}" + collection_season_6_url: "{s06_url}" + collection_season_7_url: "{s07_url}" + collection_season_8_url: "{s08_url}" + collection_season_9_url: "{s09_url}" + collection_season_10_url: "{s10_url}" + collection_season_11_url: "{s11_url}" + collection_season_12_url: "{s12_url}" + collection_season_13_url: "{s13_url}" + collection_season_14_url: "{s14_url}" + collection_season_15_url: "{s15_url}" + collection_season_16_url: "{s16_url}" + collection_season_17_url: "{s17_url}" + collection_season_18_url: "{s18_url}" + collection_season_19_url: "{s19_url}" + collection_season_20_url: "{s20_url}" + collection_season_21_url: "{s21_url}" + collection_season_22_url: "{s22_url}" + collection_season_23_url: "{s23_url}" + collection_season_24_url: "{s24_url}" + collection_season_25_url: "{s25_url}" + collection_season_26_url: "{s26_url}" + collection_season_27_url: "{s27_url}" + collection_season_28_url: "{s28_url}" + collection_season_29_url: "{s29_url}" + collection_season_30_url: "{s30_url}" + collection_season_31_url: "{s31_url}" + collection_season_32_url: "{s32_url}" + collection_season_33_url: "{s33_url}" + collection_season_34_url: "{s34_url}" + collection_season_35_url: "{s35_url}" + collection_season_36_url: "{s36_url}" + collection_season_37_url: "{s37_url}" + collection_season_38_url: "{s38_url}" + collection_season_39_url: "{s39_url}" + collection_season_40_url: "{s40_url}" + + s01_name: "" + s02_name: "" + s03_name: "" + s04_name: "" + s05_name: "" + s06_name: "" + s07_name: "" + s08_name: "" + s09_name: "" + s10_name: "" + s11_name: "" + s12_name: "" + s13_name: "" + s14_name: "" + s15_name: "" + s16_name: "" + s17_name: "" + s18_name: "" + s19_name: "" + s20_name: "" + s21_name: "" + s22_name: "" + s23_name: "" + s24_name: "" + s25_name: "" + s26_name: "" + s27_name: "" + s28_name: "" + s29_name: "" + s30_name: "" + s31_name: "" + s32_name: "" + s33_name: "" + s34_name: "" + s35_name: "" + s36_name: "" + s37_name: "" + s38_name: "" + s39_name: "" + s40_name: "" + + s01_url: "" + s02_url: "" + s03_url: "" + s04_url: "" + s05_url: "" + s06_url: "" + s07_url: "" + s08_url: "" + s09_url: "" + s10_url: "" + s11_url: "" + s12_url: "" + s13_url: "" + s14_url: "" + s15_url: "" + s16_url: "" + s17_url: "" + s18_url: "" + s19_url: "" + s20_url: "" + s21_url: "" + s22_url: "" + s23_url: "" + s24_url: "" + s25_url: "" + s26_url: "" + s27_url: "" + s28_url: "" + s29_url: "" + s30_url: "" + s31_url: "" + s32_url: "" + s33_url: "" + s34_url: "" + s35_url: "" + s36_url: "" + s37_url: "" + s38_url: "" + s39_url: "" + s40_url: "" #################################################################################################### # DEPRECATED SEASON PRESETS @@ -563,25 +691,3 @@ presets: collection_season_38: {} collection_season_39: {} collection_season_40: {} - - ############### - - season_by_collection__episode_by_year_month_day: - overrides: - episode_number: "{upload_year_truncated}{upload_month_padded}{upload_day_padded}{upload_date_index_padded}" - episode_number_padded: "{episode_number}" - - season_by_collection__episode_by_year_month_day_reversed: - overrides: - episode_number: "{upload_year_truncated_reversed}{upload_month_reversed_padded}{upload_day_reversed_padded}{upload_date_index_reversed_padded}" - episode_number_padded: "{episode_number}" - - season_by_collection__episode_by_playlist_index: - overrides: - episode_number: "{playlist_index}" - episode_number_padded: "{playlist_index_padded6}" - - season_by_collection__episode_by_playlist_index_reversed: - overrides: - episode_number: "{playlist_index_reversed}" - episode_number_padded: "{playlist_index_reversed_padded6}" \ No newline at end of file diff --git a/tests/unit/config/test_subscription.py b/tests/unit/config/test_subscription.py index bd7122c5..1415926e 100644 --- a/tests/unit/config/test_subscription.py +++ b/tests/unit/config/test_subscription.py @@ -416,7 +416,7 @@ def test_tv_show_subscriptions(config_file: ConfigFile, tv_show_subscriptions_pa config=config_file, subscription_path=tv_show_subscriptions_path ) - assert len(subs) == 7 + assert len(subs) == 8 assert subs[3].name == "Jake Trains" jake_train_overrides = subs[3].overrides.script