From 4bc1284c57967454d9fbfa5d5ece26ad1a7d3244 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sat, 30 Mar 2024 22:22:22 -0700 Subject: [PATCH] working? --- .../prebuilt_presets/helpers/url.yaml | 18 +- .../helpers/url_bilateral.yaml | 21 + .../prebuilt_presets/tv_show/tv_show.yaml | 9 - .../tv_show/tv_show_by_date.yaml | 9 + .../tv_show/tv_show_collection.yaml | 365 ++++++++++++++++++ 5 files changed, 397 insertions(+), 25 deletions(-) create mode 100644 src/ytdl_sub/prebuilt_presets/helpers/url_bilateral.yaml diff --git a/src/ytdl_sub/prebuilt_presets/helpers/url.yaml b/src/ytdl_sub/prebuilt_presets/helpers/url.yaml index 10d1f54f..6d78aaec 100644 --- a/src/ytdl_sub/prebuilt_presets/helpers/url.yaml +++ b/src/ytdl_sub/prebuilt_presets/helpers/url.yaml @@ -336,22 +336,8 @@ presets: # inspection of the URL and conditionally adding another # ytdl-sub url download with the scraping and download reversed _multi_url_bilateral_inner: - overrides: - enable_bilateral_scraping: True - "%is_bilateral_url": >- - { %contains( $0, "youtube.com/playlist" ) } - "%bilateral_url": >- - { - %if( - %and( - enable_bilateral_scraping, - subscription_has_download_archive, - %is_bilateral_url($0) - ), - $0, - "" - ) - } + preset: + - "_url_bilateral_overrides" download: - url: "{ %bilateral_url(url) }" diff --git a/src/ytdl_sub/prebuilt_presets/helpers/url_bilateral.yaml b/src/ytdl_sub/prebuilt_presets/helpers/url_bilateral.yaml new file mode 100644 index 00000000..b785fc5e --- /dev/null +++ b/src/ytdl_sub/prebuilt_presets/helpers/url_bilateral.yaml @@ -0,0 +1,21 @@ +presets: + # multi-url with bilateral scraping built into it via + # inspection of the URL and conditionally adding another + # ytdl-sub url download with the scraping and download reversed + _url_bilateral_overrides: + overrides: + enable_bilateral_scraping: True + "%is_bilateral_url": >- + { %contains( $0, "youtube.com/playlist" ) } + "%bilateral_url": >- + { + %if( + %and( + enable_bilateral_scraping, + subscription_has_download_archive, + %is_bilateral_url($0) + ), + $0, + "" + ) + } \ No newline at end of file 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 2c9a55ce..463f122b 100644 --- a/src/ytdl_sub/prebuilt_presets/tv_show/tv_show.yaml +++ b/src/ytdl_sub/prebuilt_presets/tv_show/tv_show.yaml @@ -29,15 +29,6 @@ presets: - "_kodi_base" - "_jellyfin_tv_show" -#################################################################################################### - - # TV show from one or more sources. Uses {url}'s avatar and banner as poster and fanart - _tv_show_by_date: - preset: "_multi_url_bilateral" - overrides: - avatar_uncropped_thumbnail_file_name: "{tv_show_poster_file_name}" - banner_uncropped_thumbnail_file_name: "{tv_show_fanart_file_name}" - #################################################################################################### _episode_video_tags: diff --git a/src/ytdl_sub/prebuilt_presets/tv_show/tv_show_by_date.yaml b/src/ytdl_sub/prebuilt_presets/tv_show/tv_show_by_date.yaml index 30027444..e676ec82 100644 --- a/src/ytdl_sub/prebuilt_presets/tv_show/tv_show_by_date.yaml +++ b/src/ytdl_sub/prebuilt_presets/tv_show/tv_show_by_date.yaml @@ -31,6 +31,15 @@ presets: - "plex_tv_show_by_date" - "season_by_year__episode_by_month_day" +#################################################################################################### + + # TV show from one or more sources. Uses {url}'s avatar and banner as poster and fanart + _tv_show_by_date: + preset: "_multi_url_bilateral" + overrides: + avatar_uncropped_thumbnail_file_name: "{tv_show_poster_file_name}" + banner_uncropped_thumbnail_file_name: "{tv_show_fanart_file_name}" + #################################################################################################### _season_by_year: 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 8554fda9..33d973b5 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 @@ -79,6 +79,7 @@ presets: uid: "avatar_uncropped" - name: "{tv_show_fanart_file_name}" uid: "banner_uncropped" + - url: "{collection_season_2_url}" variables: collection_season_number: "2" @@ -86,6 +87,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_3_url}" variables: collection_season_number: "3" @@ -93,6 +95,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_4_url}" variables: collection_season_number: "4" @@ -100,6 +103,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_5_url}" variables: collection_season_number: "5" @@ -107,6 +111,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_6_url}" variables: collection_season_number: "6" @@ -114,6 +119,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_7_url}" variables: collection_season_number: "7" @@ -121,6 +127,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_8_url}" variables: collection_season_number: "8" @@ -128,6 +135,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_9_url}" variables: collection_season_number: "9" @@ -135,6 +143,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_10_url}" variables: collection_season_number: "10" @@ -142,6 +151,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_11_url}" variables: collection_season_number: "11" @@ -149,6 +159,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_12_url}" variables: collection_season_number: "12" @@ -156,6 +167,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_13_url}" variables: collection_season_number: "13" @@ -163,6 +175,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_14_url}" variables: collection_season_number: "14" @@ -170,6 +183,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_15_url}" variables: collection_season_number: "15" @@ -177,6 +191,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_16_url}" variables: collection_season_number: "16" @@ -184,6 +199,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_17_url}" variables: collection_season_number: "17" @@ -191,6 +207,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_18_url}" variables: collection_season_number: "18" @@ -198,6 +215,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_19_url}" variables: collection_season_number: "19" @@ -205,6 +223,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_20_url}" variables: collection_season_number: "20" @@ -212,6 +231,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_21_url}" variables: collection_season_number: "21" @@ -219,6 +239,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_22_url}" variables: collection_season_number: "22" @@ -226,6 +247,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_23_url}" variables: collection_season_number: "23" @@ -233,6 +255,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_24_url}" variables: collection_season_number: "24" @@ -240,6 +263,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_25_url}" variables: collection_season_number: "25" @@ -247,6 +271,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_26_url}" variables: collection_season_number: "26" @@ -254,6 +279,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_27_url}" variables: collection_season_number: "27" @@ -261,6 +287,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_28_url}" variables: collection_season_number: "28" @@ -268,6 +295,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_29_url}" variables: collection_season_number: "29" @@ -275,6 +303,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_30_url}" variables: collection_season_number: "30" @@ -282,6 +311,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_31_url}" variables: collection_season_number: "31" @@ -289,6 +319,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_32_url}" variables: collection_season_number: "32" @@ -296,6 +327,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_33_url}" variables: collection_season_number: "33" @@ -303,6 +335,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_34_url}" variables: collection_season_number: "34" @@ -310,6 +343,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_35_url}" variables: collection_season_number: "35" @@ -317,6 +351,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_36_url}" variables: collection_season_number: "36" @@ -324,6 +359,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_37_url}" variables: collection_season_number: "37" @@ -331,6 +367,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_38_url}" variables: collection_season_number: "38" @@ -338,6 +375,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_39_url}" variables: collection_season_number: "39" @@ -345,6 +383,7 @@ presets: playlist_thumbnails: - name: "{season_poster_file_name}" uid: "latest_entry" + - url: "{collection_season_40_url}" variables: collection_season_number: "40" @@ -648,6 +687,332 @@ presets: s39_url: "" s40_url: "" + _tv_show_collection_bilateral: + preset: + - "_url_bilateral_overrides" + + download: + - url: "{collection_season_1_url}" + variables: + collection_season_number: "1" + collection_season_name: "{collection_season_1_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_2_url}" + variables: + collection_season_number: "2" + collection_season_name: "{collection_season_2_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_3_url}" + variables: + collection_season_number: "3" + collection_season_name: "{collection_season_3_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_4_url}" + variables: + collection_season_number: "4" + collection_season_name: "{collection_season_4_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_5_url}" + variables: + collection_season_number: "5" + collection_season_name: "{collection_season_5_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_6_url}" + variables: + collection_season_number: "6" + collection_season_name: "{collection_season_6_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_7_url}" + variables: + collection_season_number: "7" + collection_season_name: "{collection_season_7_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_8_url}" + variables: + collection_season_number: "8" + collection_season_name: "{collection_season_8_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_9_url}" + variables: + collection_season_number: "9" + collection_season_name: "{collection_season_9_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_10_url}" + variables: + collection_season_number: "10" + collection_season_name: "{collection_season_10_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_11_url}" + variables: + collection_season_number: "11" + collection_season_name: "{collection_season_11_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_12_url}" + variables: + collection_season_number: "12" + collection_season_name: "{collection_season_12_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_13_url}" + variables: + collection_season_number: "13" + collection_season_name: "{collection_season_13_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_14_url}" + variables: + collection_season_number: "14" + collection_season_name: "{collection_season_14_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_15_url}" + variables: + collection_season_number: "15" + collection_season_name: "{collection_season_15_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_16_url}" + variables: + collection_season_number: "16" + collection_season_name: "{collection_season_16_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_17_url}" + variables: + collection_season_number: "17" + collection_season_name: "{collection_season_17_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_18_url}" + variables: + collection_season_number: "18" + collection_season_name: "{collection_season_18_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_19_url}" + variables: + collection_season_number: "19" + collection_season_name: "{collection_season_19_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_20_url}" + variables: + collection_season_number: "20" + collection_season_name: "{collection_season_20_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_21_url}" + variables: + collection_season_number: "21" + collection_season_name: "{collection_season_21_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_22_url}" + variables: + collection_season_number: "22" + collection_season_name: "{collection_season_22_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_23_url}" + variables: + collection_season_number: "23" + collection_season_name: "{collection_season_23_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_24_url}" + variables: + collection_season_number: "24" + collection_season_name: "{collection_season_24_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_25_url}" + variables: + collection_season_number: "25" + collection_season_name: "{collection_season_25_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_26_url}" + variables: + collection_season_number: "26" + collection_season_name: "{collection_season_26_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_27_url}" + variables: + collection_season_number: "27" + collection_season_name: "{collection_season_27_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_28_url}" + variables: + collection_season_number: "28" + collection_season_name: "{collection_season_28_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_29_url}" + variables: + collection_season_number: "29" + collection_season_name: "{collection_season_29_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_30_url}" + variables: + collection_season_number: "30" + collection_season_name: "{collection_season_30_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_31_url}" + variables: + collection_season_number: "31" + collection_season_name: "{collection_season_31_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_32_url}" + variables: + collection_season_number: "32" + collection_season_name: "{collection_season_32_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_33_url}" + variables: + collection_season_number: "33" + collection_season_name: "{collection_season_33_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_34_url}" + variables: + collection_season_number: "34" + collection_season_name: "{collection_season_34_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_35_url}" + variables: + collection_season_number: "35" + collection_season_name: "{collection_season_35_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_36_url}" + variables: + collection_season_number: "36" + collection_season_name: "{collection_season_36_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_37_url}" + variables: + collection_season_number: "37" + collection_season_name: "{collection_season_37_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_38_url}" + variables: + collection_season_number: "38" + collection_season_name: "{collection_season_38_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_39_url}" + variables: + collection_season_number: "39" + collection_season_name: "{collection_season_39_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + - url: "{collection_season_40_url}" + variables: + collection_season_number: "40" + collection_season_name: "{collection_season_40_name}" + download_reverse: True + ytdl_options: + playlist_items: "-1:0:-1" + + #################################################################################################### # DEPRECATED SEASON PRESETS