From 6fbf4fec85c201e32137295c81e0fff245341c3e Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Mon, 1 Apr 2024 02:48:48 -0700 Subject: [PATCH] donwload correct order --- src/ytdl_sub/downloaders/url/downloader.py | 2 +- .../prebuilt_presets/helpers/url.yaml | 200 +++++++++--------- .../tv_show/tv_show_collection.yaml | 83 ++++---- tests/e2e/youtube/test_playlist.py | 71 ++++++- .../test_playlist_bilateral_collection_p1.txt | 61 ++++++ .../test_playlist_bilateral_collection_p2.txt | 170 +++++++++++++++ .../youtube/test_playlist_bilateral_p1.txt | 1 + .../youtube/test_playlist_bilateral_p2.txt | 2 + 8 files changed, 442 insertions(+), 148 deletions(-) create mode 100644 tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_collection_p1.txt create mode 100644 tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_collection_p2.txt diff --git a/src/ytdl_sub/downloaders/url/downloader.py b/src/ytdl_sub/downloaders/url/downloader.py index 5fc8c60b..8d50f1c3 100644 --- a/src/ytdl_sub/downloaders/url/downloader.py +++ b/src/ytdl_sub/downloaders/url/downloader.py @@ -388,7 +388,7 @@ class MultiUrlDownloader(SourcePlugin[MultiUrlValidator]): yield entries_to_iter[idx] self._mark_downloaded(entries_to_iter[idx]) - del entries_to_iter[idx] + entries_to_iter[idx] = None def _iterate_parent_entry( self, parent: EntryParent, download_reversed: bool diff --git a/src/ytdl_sub/prebuilt_presets/helpers/url.yaml b/src/ytdl_sub/prebuilt_presets/helpers/url.yaml index 6d78aaec..d924c159 100644 --- a/src/ytdl_sub/prebuilt_presets/helpers/url.yaml +++ b/src/ytdl_sub/prebuilt_presets/helpers/url.yaml @@ -341,403 +341,403 @@ presets: download: - url: "{ %bilateral_url(url) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url2) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url3) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url4) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url5) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url6) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url7) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url8) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url9) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url10) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url11) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url12) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url13) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url14) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url15) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url16) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url17) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url18) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url19) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url20) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url21) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url22) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url23) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url24) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url25) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url26) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url27) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url28) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url29) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url30) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url31) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url32) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url33) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url34) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url35) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url36) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url37) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url38) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url39) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url40) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url41) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url42) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url43) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url44) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url45) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url46) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url47) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url48) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url49) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url50) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url51) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url52) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url53) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url54) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url55) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url56) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url57) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url58) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url59) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url60) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url61) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url62) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url63) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url64) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url65) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url66) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url67) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url68) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url69) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url70) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url71) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url72) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url73) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url74) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url75) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url76) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url77) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url78) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url79) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url80) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url81) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url82) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url83) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url84) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url85) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url86) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url87) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url88) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url89) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url90) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url91) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url92) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url93) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url94) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url95) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url96) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url97) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url98) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url99) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" - url: "{ %bilateral_url(url100) }" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" 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 33d973b5..7ee4690d 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 @@ -60,6 +60,9 @@ presets: ############## _tv_show_collection: + preset: + - "_tv_show_collection_bilateral" + download: - url: "{collection_season_1_url}" variables: @@ -696,7 +699,7 @@ presets: variables: collection_season_number: "1" collection_season_name: "{collection_season_1_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -704,7 +707,7 @@ presets: variables: collection_season_number: "2" collection_season_name: "{collection_season_2_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -712,7 +715,7 @@ presets: variables: collection_season_number: "3" collection_season_name: "{collection_season_3_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -720,7 +723,7 @@ presets: variables: collection_season_number: "4" collection_season_name: "{collection_season_4_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -728,7 +731,7 @@ presets: variables: collection_season_number: "5" collection_season_name: "{collection_season_5_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -736,7 +739,7 @@ presets: variables: collection_season_number: "6" collection_season_name: "{collection_season_6_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -744,7 +747,7 @@ presets: variables: collection_season_number: "7" collection_season_name: "{collection_season_7_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -752,7 +755,7 @@ presets: variables: collection_season_number: "8" collection_season_name: "{collection_season_8_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -760,7 +763,7 @@ presets: variables: collection_season_number: "9" collection_season_name: "{collection_season_9_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -768,7 +771,7 @@ presets: variables: collection_season_number: "10" collection_season_name: "{collection_season_10_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -776,7 +779,7 @@ presets: variables: collection_season_number: "11" collection_season_name: "{collection_season_11_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -784,7 +787,7 @@ presets: variables: collection_season_number: "12" collection_season_name: "{collection_season_12_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -792,7 +795,7 @@ presets: variables: collection_season_number: "13" collection_season_name: "{collection_season_13_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -800,7 +803,7 @@ presets: variables: collection_season_number: "14" collection_season_name: "{collection_season_14_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -808,7 +811,7 @@ presets: variables: collection_season_number: "15" collection_season_name: "{collection_season_15_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -816,7 +819,7 @@ presets: variables: collection_season_number: "16" collection_season_name: "{collection_season_16_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -824,7 +827,7 @@ presets: variables: collection_season_number: "17" collection_season_name: "{collection_season_17_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -832,7 +835,7 @@ presets: variables: collection_season_number: "18" collection_season_name: "{collection_season_18_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -840,7 +843,7 @@ presets: variables: collection_season_number: "19" collection_season_name: "{collection_season_19_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -848,7 +851,7 @@ presets: variables: collection_season_number: "20" collection_season_name: "{collection_season_20_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -856,7 +859,7 @@ presets: variables: collection_season_number: "21" collection_season_name: "{collection_season_21_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -864,7 +867,7 @@ presets: variables: collection_season_number: "22" collection_season_name: "{collection_season_22_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -872,7 +875,7 @@ presets: variables: collection_season_number: "23" collection_season_name: "{collection_season_23_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -880,7 +883,7 @@ presets: variables: collection_season_number: "24" collection_season_name: "{collection_season_24_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -888,7 +891,7 @@ presets: variables: collection_season_number: "25" collection_season_name: "{collection_season_25_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -896,7 +899,7 @@ presets: variables: collection_season_number: "26" collection_season_name: "{collection_season_26_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -904,7 +907,7 @@ presets: variables: collection_season_number: "27" collection_season_name: "{collection_season_27_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -912,7 +915,7 @@ presets: variables: collection_season_number: "28" collection_season_name: "{collection_season_28_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -920,7 +923,7 @@ presets: variables: collection_season_number: "29" collection_season_name: "{collection_season_29_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -928,7 +931,7 @@ presets: variables: collection_season_number: "30" collection_season_name: "{collection_season_30_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -936,7 +939,7 @@ presets: variables: collection_season_number: "31" collection_season_name: "{collection_season_31_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -944,7 +947,7 @@ presets: variables: collection_season_number: "32" collection_season_name: "{collection_season_32_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -952,7 +955,7 @@ presets: variables: collection_season_number: "33" collection_season_name: "{collection_season_33_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -960,7 +963,7 @@ presets: variables: collection_season_number: "34" collection_season_name: "{collection_season_34_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -968,7 +971,7 @@ presets: variables: collection_season_number: "35" collection_season_name: "{collection_season_35_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -976,7 +979,7 @@ presets: variables: collection_season_number: "36" collection_season_name: "{collection_season_36_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -984,7 +987,7 @@ presets: variables: collection_season_number: "37" collection_season_name: "{collection_season_37_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -992,7 +995,7 @@ presets: variables: collection_season_number: "38" collection_season_name: "{collection_season_38_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -1000,7 +1003,7 @@ presets: variables: collection_season_number: "39" collection_season_name: "{collection_season_39_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" @@ -1008,7 +1011,7 @@ presets: variables: collection_season_number: "40" collection_season_name: "{collection_season_40_name}" - download_reverse: True + download_reverse: False ytdl_options: playlist_items: "-1:0:-1" diff --git a/tests/e2e/youtube/test_playlist.py b/tests/e2e/youtube/test_playlist.py index f15af17d..e173c568 100644 --- a/tests/e2e/youtube/test_playlist.py +++ b/tests/e2e/youtube/test_playlist.py @@ -52,12 +52,13 @@ def playlist_preset_dict(output_directory): @pytest.fixture -def playlist_bilateral_dict(output_directory): +def tv_show_by_date_bilateral_dict(output_directory): return { "preset": [ "Jellyfin TV Show by Date", ], "format": "worst[ext=mp4]", + "match_filters": {"filters": ["title *= Feb.1"]}, "overrides": { "url": "https://www.youtube.com/playlist?list=PLd4Q7G88JqoekF0b30NYQcOTnTiIe9Ali", "tv_show_directory": output_directory, @@ -65,6 +66,29 @@ def playlist_bilateral_dict(output_directory): "nfo_tags": { "tags": { "subscription_has_download_archive": "{subscription_has_download_archive}", + "download_index": "{download_index}", + } + }, + } + + +@pytest.fixture +def tv_show_collection_bilateral_dict(output_directory): + return { + "preset": [ + "Jellyfin TV Show Collection", + ], + "format": "worst[ext=mp4]", + "match_filters": {"filters": ["title *= Feb.1"]}, + "overrides": { + "s01_url": "https://www.youtube.com/playlist?list=PLd4Q7G88JqoekF0b30NYQcOTnTiIe9Ali", + "s01_name": "bilateral test", + "tv_show_directory": output_directory, + }, + "nfo_tags": { + "tags": { + "subscription_has_download_archive": "{subscription_has_download_archive}", + "download_index": "{download_index}", } }, } @@ -242,17 +266,16 @@ class TestPlaylist: assert len(subscriptions) == 1 assert subscriptions[0].transaction_log.is_empty - def test_tv_show_downloads_bilateral( + def test_tv_show_by_date_downloads_bilateral( self, - playlist_bilateral_dict: Dict, + tv_show_by_date_bilateral_dict: Dict, output_directory: str, default_config: ConfigFile, ): - playlist_bilateral_dict["filter_include"] = ["{ %contains(title, 'Feb.1') }"] playlist_subscription = Subscription.from_dict( config=default_config, preset_name="bilateral_test", - preset_dict=playlist_bilateral_dict, + preset_dict=tv_show_by_date_bilateral_dict, ) transaction_log = playlist_subscription.download(dry_run=False) @@ -264,11 +287,11 @@ class TestPlaylist: # Now that one vid is downloaded, attempt to download all and see if bilateral # logic kicks in - del playlist_bilateral_dict["filter_include"] + del tv_show_by_date_bilateral_dict["match_filters"] playlist_subscription = Subscription.from_dict( config=default_config, preset_name="bilateral_test", - preset_dict=playlist_bilateral_dict, + preset_dict=tv_show_by_date_bilateral_dict, ) transaction_log = playlist_subscription.download(dry_run=True) assert_transaction_log_matches( @@ -276,3 +299,37 @@ class TestPlaylist: transaction_log=transaction_log, transaction_log_summary_file_name="youtube/test_playlist_bilateral_p2.txt", ) + + def test_tv_show_collection_downloads_bilateral( + self, + tv_show_collection_bilateral_dict: Dict, + output_directory: str, + default_config: ConfigFile, + ): + playlist_subscription = Subscription.from_dict( + config=default_config, + preset_name="bilateral_test", + preset_dict=tv_show_collection_bilateral_dict, + ) + + transaction_log = playlist_subscription.download(dry_run=False) + assert_transaction_log_matches( + output_directory=output_directory, + transaction_log=transaction_log, + transaction_log_summary_file_name="youtube/test_playlist_bilateral_collection_p1.txt", + ) + + # Now that one vid is downloaded, attempt to download all and see if bilateral + # logic kicks in + del tv_show_collection_bilateral_dict["match_filters"] + playlist_subscription = Subscription.from_dict( + config=default_config, + preset_name="bilateral_test", + preset_dict=tv_show_collection_bilateral_dict, + ) + transaction_log = playlist_subscription.download(dry_run=True) + assert_transaction_log_matches( + output_directory=output_directory, + transaction_log=transaction_log, + transaction_log_summary_file_name="youtube/test_playlist_bilateral_collection_p2.txt", + ) diff --git a/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_collection_p1.txt b/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_collection_p1.txt new file mode 100644 index 00000000..91030c53 --- /dev/null +++ b/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_collection_p1.txt @@ -0,0 +1,61 @@ +Files created: +---------------------------------------- +{output_directory} + .ytdl-sub-bilateral_test-download-archive.json + fanart.jpg + poster.jpg + season01-poster.jpg + tvshow.nfo + NFO tags: + tvshow: + genre: ytdl-sub + mpaa: TV-14 + namedseason: + attributes: + number: 1 + tag: bilateral test + title: bilateral_test +{output_directory}/Season 01 + s01.e11020101 - Jesse's Minecraft Server [Trailer - Feb.1]-thumb.jpg + s01.e11020101 - Jesse's Minecraft Server [Trailer - Feb.1].info.json + s01.e11020101 - Jesse's Minecraft Server [Trailer - Feb.1].mp4 + Video Tags: + contentRating: TV-14 + date: 2011-02-01 + episode_id: 11020101 + genre: ytdl-sub + show: bilateral_test + synopsis: + https://www.youtube.com/watch?v=0SVukUyys10 + + To join the server, you must apply at: + http://www.jesseminecraft.webs.com/ + + This is just a brief video of the server as of Feb. 1, 2011. + + Texture Pack I Use: + http://www.minecraftforum.net/viewtopic.php?f=25&t=29164 + title: 2011-02-01 - Jesse's Minecraft Server [Trailer - Feb.1] + year: 2011 + s01.e11020101 - Jesse's Minecraft Server [Trailer - Feb.1].nfo + NFO tags: + episodedetails: + aired: 2011-02-01 + download_index: 1 + episode: 11020101 + genre: ytdl-sub + mpaa: TV-14 + plot: + https://www.youtube.com/watch?v=0SVukUyys10 + + To join the server, you must apply at: + http://www.jesseminecraft.webs.com/ + + This is just a brief video of the server as of Feb. 1, 2011. + + Texture Pack I Use: + http://www.minecraftforum.net/viewtopic.php?f=25&t=29164 + season: 1 + subscription_has_download_archive: false + title: 2011-02-01 - Jesse's Minecraft Server [Trailer - Feb.1] + year: 2011 \ No newline at end of file diff --git a/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_collection_p2.txt b/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_collection_p2.txt new file mode 100644 index 00000000..2b9254c0 --- /dev/null +++ b/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_collection_p2.txt @@ -0,0 +1,170 @@ +Files created: +---------------------------------------- +{output_directory}/Season 01 + s01.e11022701 - Jesse's Minecraft Server [Trailer - Feb.27]-thumb.jpg + s01.e11022701 - Jesse's Minecraft Server [Trailer - Feb.27].info.json + s01.e11022701 - Jesse's Minecraft Server [Trailer - Feb.27].mp4 + Video Tags: + contentRating: TV-14 + date: 2011-02-27 + episode_id: 11022701 + genre: ytdl-sub + show: bilateral_test + synopsis: + https://www.youtube.com/watch?v=qPybBrXspds + + Website Link: + http://jesseminecraft.webs.com/ + + All you have to do is read the rules, and fill out a quick, little application to join the Server so we know you read them. We do this to keep the griefers/newbs out, it only takes three minutes, it's not that big of a deal. + + Jesse's Minecraft Server is a City Roleplay/Survival Server, there is a currency, public transportation, strict rules for immersive gameplay, and has a decent size population. Over 750 people have logged onto the server. It is very important you read the rules, we don't tolerate idiots. + + There are over 200 empty properties that are ready for anyone to own! Join now! + + This is the server state as of Feb. 27, 2011. + ---------------------------------------------------------------------------------- + + Texture Pack: + http://www.minecraftforum.net/viewtopic.php?f=25&t=29164 + + Recording Software: + http://www.fraps.com/download.php + + Video Editing Software: + http://explore.live.com/windows-live-movie-maker?os=other + + Song: + Given to Fly - Pearl Jam + (Off of the 'Yield' album) + + I claim no ownership of this song, all the credit goes to Pearl Jam and their producers. + title: 2011-02-27 - Jesse's Minecraft Server [Trailer - Feb.27] + year: 2011 + s01.e11022701 - Jesse's Minecraft Server [Trailer - Feb.27].nfo + NFO tags: + episodedetails: + aired: 2011-02-27 + download_index: 2 + episode: 11022701 + genre: ytdl-sub + mpaa: TV-14 + plot: + https://www.youtube.com/watch?v=qPybBrXspds + + Website Link: + http://jesseminecraft.webs.com/ + + All you have to do is read the rules, and fill out a quick, little application to join the Server so we know you read them. We do this to keep the griefers/newbs out, it only takes three minutes, it's not that big of a deal. + + Jesse's Minecraft Server is a City Roleplay/Survival Server, there is a currency, public transportation, strict rules for immersive gameplay, and has a decent size population. Over 750 people have logged onto the server. It is very important you read the rules, we don't tolerate idiots. + + There are over 200 empty properties that are ready for anyone to own! Join now! + + This is the server state as of Feb. 27, 2011. + ---------------------------------------------------------------------------------- + + Texture Pack: + http://www.minecraftforum.net/viewtopic.php?f=25&t=29164 + + Recording Software: + http://www.fraps.com/download.php + + Video Editing Software: + http://explore.live.com/windows-live-movie-maker?os=other + + Song: + Given to Fly - Pearl Jam + (Off of the 'Yield' album) + + I claim no ownership of this song, all the credit goes to Pearl Jam and their producers. + season: 1 + subscription_has_download_archive: true + title: 2011-02-27 - Jesse's Minecraft Server [Trailer - Feb.27] + year: 2011 + s01.e11032101 - Jesse's Minecraft Server [Trailer - Mar.21]-thumb.jpg + s01.e11032101 - Jesse's Minecraft Server [Trailer - Mar.21].info.json + s01.e11032101 - Jesse's Minecraft Server [Trailer - Mar.21].mp4 + Video Tags: + contentRating: TV-14 + date: 2011-03-21 + episode_id: 11032101 + genre: ytdl-sub + show: bilateral_test + synopsis: + https://www.youtube.com/watch?v=DBjFvs6HafU + + Website Link: + http://jesseminecraft.webs.com/ + + To get on the whitelist, please look at the website linked above (^^^). Due to the overwhelming amount of people trying to join, I've made it so it costs $2 to become a member through paypal. All of it is explained on the website. + + Jesse's Minecraft Server is a City Roleplay/Survival Server, there is a currency, public transportation, strict rules for immersive gameplay, and has a decent size population. Over 1000 people have logged onto the server. It is very important you read the rules, we don't tolerate idiots. + + There are over 300 empty properties that are ready for anyone to own! Join now! + + This is the server state as of Mar. 21, 2011. + --------------------------------------------------------------------------------­-- + + Texture Pack: + http://www.minecraftforum.net/viewtopic.php?f=25&t=29164 + + Recording Software: + http://www.fraps.com/download.php + + Video Editing Software: + http://explore.live.com/windows-live-movie-maker?os=other + + Song: + Indifference - Pearl Jam + (Off of the 'Vs.' album) + + I claim no ownership of this song, all the credit goes to Pearl Jam and their producers. + title: 2011-03-21 - Jesse's Minecraft Server [Trailer - Mar.21] + year: 2011 + s01.e11032101 - Jesse's Minecraft Server [Trailer - Mar.21].nfo + NFO tags: + episodedetails: + aired: 2011-03-21 + download_index: 3 + episode: 11032101 + genre: ytdl-sub + mpaa: TV-14 + plot: + https://www.youtube.com/watch?v=DBjFvs6HafU + + Website Link: + http://jesseminecraft.webs.com/ + + To get on the whitelist, please look at the website linked above (^^^). Due to the overwhelming amount of people trying to join, I've made it so it costs $2 to become a member through paypal. All of it is explained on the website. + + Jesse's Minecraft Server is a City Roleplay/Survival Server, there is a currency, public transportation, strict rules for immersive gameplay, and has a decent size population. Over 1000 people have logged onto the server. It is very important you read the rules, we don't tolerate idiots. + + There are over 300 empty properties that are ready for anyone to own! Join now! + + This is the server state as of Mar. 21, 2011. + --------------------------------------------------------------------------------­-- + + Texture Pack: + http://www.minecraftforum.net/viewtopic.php?f=25&t=29164 + + Recording Software: + http://www.fraps.com/download.php + + Video Editing Software: + http://explore.live.com/windows-live-movie-maker?os=other + + Song: + Indifference - Pearl Jam + (Off of the 'Vs.' album) + + I claim no ownership of this song, all the credit goes to Pearl Jam and their producers. + season: 1 + subscription_has_download_archive: true + title: 2011-03-21 - Jesse's Minecraft Server [Trailer - Mar.21] + year: 2011 + +Files modified: +---------------------------------------- +{output_directory} + .ytdl-sub-bilateral_test-download-archive.json \ No newline at end of file diff --git a/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_p1.txt b/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_p1.txt index d6bc9afc..d1476d0b 100644 --- a/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_p1.txt +++ b/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_p1.txt @@ -36,6 +36,7 @@ Files created: NFO tags: episodedetails: aired: 2011-02-01 + download_index: 1 episode: 20101 genre: ytdl-sub mpaa: TV-14 diff --git a/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_p2.txt b/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_p2.txt index 1a869572..bb7ca07e 100644 --- a/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_p2.txt +++ b/tests/resources/transaction_log_summaries/youtube/test_playlist_bilateral_p2.txt @@ -45,6 +45,7 @@ Files created: NFO tags: episodedetails: aired: 2011-02-27 + download_index: 2 episode: 22701 genre: ytdl-sub mpaa: TV-14 @@ -125,6 +126,7 @@ Files created: NFO tags: episodedetails: aired: 2011-03-21 + download_index: 3 episode: 32101 genre: ytdl-sub mpaa: TV-14