diff --git a/src/ytdl_sub/downloaders/url/downloader.py b/src/ytdl_sub/downloaders/url/downloader.py index 7f773e36..473fecbb 100644 --- a/src/ytdl_sub/downloaders/url/downloader.py +++ b/src/ytdl_sub/downloaders/url/downloader.py @@ -406,9 +406,7 @@ class MultiUrlDownloader(SourcePlugin[MultiUrlValidator]): entry_dicts = YTDLP.extract_info_via_info_json( working_directory=self.working_directory, ytdl_options_overrides=self.metadata_ytdl_options(scrape_reverse=scrape_reverse), - log_prefix_on_info_json_dl=( - f"Downloading metadata {'in reverse ' if scrape_reverse else ''}for" - ), + log_prefix_on_info_json_dl="Downloading metadata for", url=url, ) diff --git a/src/ytdl_sub/entries/script/custom_functions.py b/src/ytdl_sub/entries/script/custom_functions.py index 0024ae60..8d68d86f 100644 --- a/src/ytdl_sub/entries/script/custom_functions.py +++ b/src/ytdl_sub/entries/script/custom_functions.py @@ -32,7 +32,7 @@ class CustomFunctions: """ # Top-level allow-list of notorious playlists that can be # ordered in either direction - if not any(["youtube.com/playlist" in url.value]): + if "youtube.com/playlist" not in url.value: return Boolean("True") info_only_kwargs = { diff --git a/src/ytdl_sub/prebuilt_presets/tv_show/tv_show.yaml b/src/ytdl_sub/prebuilt_presets/tv_show/tv_show.yaml index edf64ec5..fb97e0fb 100644 --- a/src/ytdl_sub/prebuilt_presets/tv_show/tv_show.yaml +++ b/src/ytdl_sub/prebuilt_presets/tv_show/tv_show.yaml @@ -40,14 +40,6 @@ presets: #################################################################################################### - # TV show from a collection. Must specify additional `tv_show_collection_season` presets in - # addition. Each season sets its own `collection_season_number/_padded` - _tv_show_collection: - overrides: - collection_season_number_padded: "{ %pad_zero(%int(collection_season_number), 2) }" - season_number: "{collection_season_number}" - season_number_padded: "{collection_season_number_padded}" - _episode_video_tags: video_tags: show: "{tv_show_name}" 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 816ec42e..da38009c 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,133 @@ presets: + # TV show from a collection. Must specify additional `tv_show_collection_season` presets in + # addition. Each season sets its own `collection_season_number/_padded` + _tv_show_collection: + overrides: + collection_season_number_padded: "{ %pad_zero(%int(collection_season_number), 2) }" + season_number: "{collection_season_number}" + season_number_padded: "{collection_season_number_padded}" + collection_season_1_url: "" + collection_season_1_name: "Season 1" + collection_season_1_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_1_url) }" + collection_season_2_url: "" + collection_season_2_name: "Season 2" + collection_season_2_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_2_url) }" + collection_season_3_url: "" + collection_season_3_name: "Season 3" + collection_season_3_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_3_url) }" + collection_season_4_url: "" + collection_season_4_name: "Season 4" + collection_season_4_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_4_url) }" + collection_season_5_url: "" + collection_season_5_name: "Season 5" + collection_season_5_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_5_url) }" + collection_season_6_url: "" + collection_season_6_name: "Season 6" + collection_season_6_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_6_url) }" + collection_season_7_url: "" + collection_season_7_name: "Season 7" + collection_season_7_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_7_url) }" + collection_season_8_url: "" + collection_season_8_name: "Season 8" + collection_season_8_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_8_url) }" + collection_season_9_url: "" + collection_season_9_name: "Season 9" + collection_season_9_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_9_url) }" + collection_season_10_url: "" + collection_season_10_name: "Season 10" + collection_season_10_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_10_url) }" + collection_season_11_url: "" + collection_season_11_name: "Season 11" + collection_season_11_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_11_url) }" + collection_season_12_url: "" + collection_season_12_name: "Season 12" + collection_season_12_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_12_url) }" + collection_season_13_url: "" + collection_season_13_name: "Season 13" + collection_season_13_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_13_url) }" + collection_season_14_url: "" + collection_season_14_name: "Season 14" + collection_season_14_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_14_url) }" + collection_season_15_url: "" + collection_season_15_name: "Season 15" + collection_season_15_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_15_url) }" + collection_season_16_url: "" + collection_season_16_name: "Season 16" + collection_season_16_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_16_url) }" + collection_season_17_url: "" + collection_season_17_name: "Season 17" + collection_season_17_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_17_url) }" + collection_season_18_url: "" + collection_season_18_name: "Season 18" + collection_season_18_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_18_url) }" + collection_season_19_url: "" + collection_season_19_name: "Season 19" + collection_season_19_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_19_url) }" + collection_season_20_url: "" + collection_season_20_name: "Season 20" + collection_season_20_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_20_url) }" + collection_season_21_url: "" + collection_season_21_name: "Season 21" + collection_season_21_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_21_url) }" + collection_season_22_url: "" + collection_season_22_name: "Season 22" + collection_season_22_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_22_url) }" + collection_season_23_url: "" + collection_season_23_name: "Season 23" + collection_season_23_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_23_url) }" + collection_season_24_url: "" + collection_season_24_name: "Season 24" + collection_season_24_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_24_url) }" + collection_season_25_url: "" + collection_season_25_name: "Season 25" + collection_season_25_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_25_url) }" + collection_season_26_url: "" + collection_season_26_name: "Season 26" + collection_season_26_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_26_url) }" + collection_season_27_url: "" + collection_season_27_name: "Season 27" + collection_season_27_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_27_url) }" + collection_season_28_url: "" + collection_season_28_name: "Season 28" + collection_season_28_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_28_url) }" + collection_season_29_url: "" + collection_season_29_name: "Season 29" + collection_season_29_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_29_url) }" + collection_season_30_url: "" + collection_season_30_name: "Season 30" + collection_season_30_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_30_url) }" + collection_season_31_url: "" + collection_season_31_name: "Season 31" + collection_season_31_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_31_url) }" + collection_season_32_url: "" + collection_season_32_name: "Season 32" + collection_season_32_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_32_url) }" + collection_season_33_url: "" + collection_season_33_name: "Season 33" + collection_season_33_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_33_url) }" + collection_season_34_url: "" + collection_season_34_name: "Season 34" + collection_season_34_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_34_url) }" + collection_season_35_url: "" + collection_season_35_name: "Season 35" + collection_season_35_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_35_url) }" + collection_season_36_url: "" + collection_season_36_name: "Season 36" + collection_season_36_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_36_url) }" + collection_season_37_url: "" + collection_season_37_name: "Season 37" + collection_season_37_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_37_url) }" + collection_season_38_url: "" + collection_season_38_name: "Season 38" + collection_season_38_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_38_url) }" + collection_season_39_url: "" + collection_season_39_name: "Season 39" + collection_season_39_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_39_url) }" + collection_season_40_url: "" + collection_season_40_name: "Season 40" + collection_season_40_ordered_by_newest: "{ %is_playlist_ordered_by_newest(collection_season_40_url) }" + kodi_tv_show_collection: preset: - "_kodi_tv_show" @@ -38,10 +166,8 @@ presets: uid: "avatar_uncropped" - name: "{tv_show_fanart_file_name}" uid: "banner_uncropped" - scrape_reverse: >- - { %not( %is_playlist_ordered_by_newest( collection_season_1_url )) } - download_reverse: >- - { %is_playlist_ordered_by_newest( collection_season_1_url ) } + scrape_reverse: "{%not( collection_season_1_ordered_by_newest )}" + download_reverse: "collection_season_1_ordered_by_newest" output_directory_nfo_tags: tags: @@ -59,6 +185,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_2_ordered_by_newest )}" + download_reverse: "collection_season_2_ordered_by_newest" output_directory_nfo_tags: tags: @@ -76,6 +204,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_3_ordered_by_newest )}" + download_reverse: "collection_season_3_ordered_by_newest" output_directory_nfo_tags: tags: @@ -93,6 +223,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_4_ordered_by_newest )}" + download_reverse: "collection_season_4_ordered_by_newest" output_directory_nfo_tags: tags: @@ -110,6 +242,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_5_ordered_by_newest )}" + download_reverse: "collection_season_5_ordered_by_newest" output_directory_nfo_tags: tags: @@ -127,6 +261,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_6_ordered_by_newest )}" + download_reverse: "collection_season_6_ordered_by_newest" output_directory_nfo_tags: tags: @@ -144,6 +280,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_7_ordered_by_newest )}" + download_reverse: "collection_season_7_ordered_by_newest" output_directory_nfo_tags: tags: @@ -161,6 +299,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_8_ordered_by_newest )}" + download_reverse: "collection_season_8_ordered_by_newest" output_directory_nfo_tags: tags: @@ -178,6 +318,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_9_ordered_by_newest )}" + download_reverse: "collection_season_9_ordered_by_newest" output_directory_nfo_tags: tags: @@ -195,6 +337,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_10_ordered_by_newest )}" + download_reverse: "collection_season_10_ordered_by_newest" output_directory_nfo_tags: tags: @@ -212,6 +356,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_11_ordered_by_newest )}" + download_reverse: "collection_season_11_ordered_by_newest" output_directory_nfo_tags: tags: @@ -229,6 +375,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_12_ordered_by_newest )}" + download_reverse: "collection_season_12_ordered_by_newest" output_directory_nfo_tags: tags: @@ -246,6 +394,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_13_ordered_by_newest )}" + download_reverse: "collection_season_13_ordered_by_newest" output_directory_nfo_tags: tags: @@ -263,6 +413,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_14_ordered_by_newest )}" + download_reverse: "collection_season_14_ordered_by_newest" output_directory_nfo_tags: tags: @@ -280,6 +432,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_15_ordered_by_newest )}" + download_reverse: "collection_season_15_ordered_by_newest" output_directory_nfo_tags: tags: @@ -297,6 +451,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_16_ordered_by_newest )}" + download_reverse: "collection_season_16_ordered_by_newest" output_directory_nfo_tags: tags: @@ -314,6 +470,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_17_ordered_by_newest )}" + download_reverse: "collection_season_17_ordered_by_newest" output_directory_nfo_tags: tags: @@ -331,6 +489,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_18_ordered_by_newest )}" + download_reverse: "collection_season_18_ordered_by_newest" output_directory_nfo_tags: tags: @@ -348,6 +508,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_19_ordered_by_newest )}" + download_reverse: "collection_season_19_ordered_by_newest" output_directory_nfo_tags: tags: @@ -365,6 +527,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_20_ordered_by_newest )}" + download_reverse: "collection_season_20_ordered_by_newest" output_directory_nfo_tags: tags: @@ -382,6 +546,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_21_ordered_by_newest )}" + download_reverse: "collection_season_21_ordered_by_newest" output_directory_nfo_tags: tags: @@ -399,6 +565,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_22_ordered_by_newest )}" + download_reverse: "collection_season_22_ordered_by_newest" output_directory_nfo_tags: tags: @@ -416,6 +584,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_23_ordered_by_newest )}" + download_reverse: "collection_season_23_ordered_by_newest" output_directory_nfo_tags: tags: @@ -433,6 +603,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_24_ordered_by_newest )}" + download_reverse: "collection_season_24_ordered_by_newest" output_directory_nfo_tags: tags: @@ -450,6 +622,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_25_ordered_by_newest )}" + download_reverse: "collection_season_25_ordered_by_newest" output_directory_nfo_tags: tags: @@ -467,6 +641,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_26_ordered_by_newest )}" + download_reverse: "collection_season_26_ordered_by_newest" output_directory_nfo_tags: tags: @@ -484,6 +660,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_27_ordered_by_newest )}" + download_reverse: "collection_season_27_ordered_by_newest" output_directory_nfo_tags: tags: @@ -501,6 +679,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_28_ordered_by_newest )}" + download_reverse: "collection_season_28_ordered_by_newest" output_directory_nfo_tags: tags: @@ -518,6 +698,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_29_ordered_by_newest )}" + download_reverse: "collection_season_29_ordered_by_newest" output_directory_nfo_tags: tags: @@ -535,6 +717,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_30_ordered_by_newest )}" + download_reverse: "collection_season_30_ordered_by_newest" output_directory_nfo_tags: tags: @@ -552,6 +736,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_31_ordered_by_newest )}" + download_reverse: "collection_season_31_ordered_by_newest" output_directory_nfo_tags: tags: @@ -569,6 +755,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_32_ordered_by_newest )}" + download_reverse: "collection_season_32_ordered_by_newest" output_directory_nfo_tags: tags: @@ -586,6 +774,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_33_ordered_by_newest )}" + download_reverse: "collection_season_33_ordered_by_newest" output_directory_nfo_tags: tags: @@ -603,6 +793,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_34_ordered_by_newest )}" + download_reverse: "collection_season_34_ordered_by_newest" output_directory_nfo_tags: tags: @@ -620,6 +812,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_35_ordered_by_newest )}" + download_reverse: "collection_season_35_ordered_by_newest" output_directory_nfo_tags: tags: @@ -637,6 +831,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_36_ordered_by_newest )}" + download_reverse: "collection_season_36_ordered_by_newest" output_directory_nfo_tags: tags: @@ -654,6 +850,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_37_ordered_by_newest )}" + download_reverse: "collection_season_37_ordered_by_newest" output_directory_nfo_tags: tags: @@ -671,6 +869,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_38_ordered_by_newest )}" + download_reverse: "collection_season_38_ordered_by_newest" output_directory_nfo_tags: tags: @@ -688,6 +888,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_39_ordered_by_newest )}" + download_reverse: "collection_season_39_ordered_by_newest" output_directory_nfo_tags: tags: @@ -705,6 +907,8 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + scrape_reverse: "{%not( collection_season_40_ordered_by_newest )}" + download_reverse: "collection_season_40_ordered_by_newest" output_directory_nfo_tags: tags: