[REFACTOR] Support simple download (#671)
* [REFACTOR] Support simple `download` * fix test * asdfas
This commit is contained in:
parent
598b1da8a4
commit
a9e6a80111
20 changed files with 385 additions and 423 deletions
|
|
@ -13,6 +13,5 @@
|
||||||
#
|
#
|
||||||
rammstein_music_videos:
|
rammstein_music_videos:
|
||||||
preset: "video"
|
preset: "video"
|
||||||
download:
|
download: "https://youtube.com/playlist?list=PLVTLbc6i-h_iuhdwUfuPDLFLXG2QQnz-x"
|
||||||
url: "https://youtube.com/playlist?list=PLVTLbc6i-h_iuhdwUfuPDLFLXG2QQnz-x"
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,26 +165,25 @@ presets:
|
||||||
|
|
||||||
# Download using the multi_url strategy
|
# Download using the multi_url strategy
|
||||||
download:
|
download:
|
||||||
urls:
|
# The first URL will be all the artist's tracks.
|
||||||
# The first URL will be all the artist's tracks.
|
# Treat these as singles - an album with a single track
|
||||||
# Treat these as singles - an album with a single track
|
- url: "{sc_artist_url}/tracks"
|
||||||
- url: "{sc_artist_url}/tracks"
|
variables:
|
||||||
variables:
|
sc_track_album: "{title}"
|
||||||
sc_track_album: "{title}"
|
sc_track_number: "1"
|
||||||
sc_track_number: "1"
|
sc_track_number_padded: "01"
|
||||||
sc_track_number_padded: "01"
|
sc_track_total: "1"
|
||||||
sc_track_total: "1"
|
sc_track_year: "{upload_year}"
|
||||||
sc_track_year: "{upload_year}"
|
# Set the second URL to the artist's albums. If a track belongs to both
|
||||||
# Set the second URL to the artist's albums. If a track belongs to both
|
# to an album and tracks (in the URL above), it will resolve to this
|
||||||
# to an album and tracks (in the URL above), it will resolve to this
|
# URL and include the album metadata we set below.
|
||||||
# URL and include the album metadata we set below.
|
- url: "{sc_artist_url}/albums"
|
||||||
- url: "{sc_artist_url}/albums"
|
variables:
|
||||||
variables:
|
sc_track_album: "{playlist_title}"
|
||||||
sc_track_album: "{playlist_title}"
|
sc_track_number: "{playlist_index}"
|
||||||
sc_track_number: "{playlist_index}"
|
sc_track_number_padded: "{playlist_index_padded}"
|
||||||
sc_track_number_padded: "{playlist_index_padded}"
|
sc_track_total: "{playlist_count}"
|
||||||
sc_track_total: "{playlist_count}"
|
sc_track_year: "{playlist_max_upload_year}"
|
||||||
sc_track_year: "{playlist_max_upload_year}"
|
|
||||||
|
|
||||||
# Override various track properties using playlist variables.
|
# Override various track properties using playlist variables.
|
||||||
overrides:
|
overrides:
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,10 @@ configuration:
|
||||||
|
|
||||||
presets:
|
presets:
|
||||||
music_video:
|
music_video:
|
||||||
# Set the download details
|
# We will only use a single URL to download music video(s).
|
||||||
|
# Make {url} an override variable to set later.
|
||||||
download:
|
download:
|
||||||
# We will only use a single URL to download music video(s).
|
- "{url}"
|
||||||
# Make {url} an override variable to set later.
|
|
||||||
url: "{url}"
|
|
||||||
|
|
||||||
# For advanced YTDL users only; any YTDL parameter can be set here.
|
# For advanced YTDL users only; any YTDL parameter can be set here.
|
||||||
# To download age-restricted videos, you will need to set your cookie
|
# To download age-restricted videos, you will need to set your cookie
|
||||||
|
|
|
||||||
|
|
@ -146,8 +146,27 @@ class UrlValidator(StrictDictValidator):
|
||||||
return self._download_reverse.value
|
return self._download_reverse.value
|
||||||
|
|
||||||
|
|
||||||
class UrlListValidator(ListValidator[UrlValidator]):
|
class UrlStringOrDictValidator(UrlValidator):
|
||||||
_inner_list_type = UrlValidator
|
"""
|
||||||
|
URL validator that supports a single string like:
|
||||||
|
|
||||||
|
download:
|
||||||
|
- "https://"
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
download:
|
||||||
|
- url: "https://"
|
||||||
|
"""
|
||||||
|
|
||||||
|
_expected_value_type = (dict, str)
|
||||||
|
|
||||||
|
def __init__(self, name, value):
|
||||||
|
super().__init__(name, {"url": value} if isinstance(value, str) else value)
|
||||||
|
|
||||||
|
|
||||||
|
class UrlListValidator(ListValidator[UrlStringOrDictValidator]):
|
||||||
|
_inner_list_type = UrlStringOrDictValidator
|
||||||
_expected_value_type_name = "collection url list"
|
_expected_value_type_name = "collection url list"
|
||||||
|
|
||||||
def __init__(self, name, value):
|
def __init__(self, name, value):
|
||||||
|
|
@ -197,17 +216,11 @@ class MultiUrlValidator(OptionsValidator):
|
||||||
# Pop old required field in case it's still there
|
# Pop old required field in case it's still there
|
||||||
value_copy.pop("download_strategy", None)
|
value_copy.pop("download_strategy", None)
|
||||||
|
|
||||||
if "urls" in value_copy:
|
# Deal with old multi-url download strategy
|
||||||
self._urls = UrlListValidator(name=name, value=value_copy["urls"])
|
if isinstance(value, dict) and "urls" in value_copy:
|
||||||
else:
|
self._urls = UrlListValidator(name=name, value=value_copy["urls"])
|
||||||
# Validate using a single URL validator first
|
|
||||||
_ = UrlValidator(name=name, value=value_copy)
|
|
||||||
self._urls = UrlListValidator(name=name, value=[value_copy])
|
|
||||||
else:
|
else:
|
||||||
# Should error here. TODO: Add simplifications download here (string, list)
|
self._urls = UrlListValidator(name=name, value=value_copy)
|
||||||
self._urls = UrlListValidator(
|
|
||||||
name=name, value=UrlValidator(name=name, value=value_copy)
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def urls(self) -> UrlListValidator:
|
def urls(self) -> UrlListValidator:
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
presets:
|
presets:
|
||||||
|
|
||||||
_view:
|
_view:
|
||||||
download:
|
download: "{url}"
|
||||||
url: "{url}"
|
|
||||||
output_options:
|
output_options:
|
||||||
output_directory: "/tmp/ytdl-sub-view"
|
output_directory: "/tmp/ytdl-sub-view"
|
||||||
file_name: "{uid}.{ext}"
|
file_name: "{uid}.{ext}"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ presets:
|
||||||
# TODO: Update this
|
# TODO: Update this
|
||||||
kodi_music_video:
|
kodi_music_video:
|
||||||
download:
|
download:
|
||||||
url: "{music_video_url}"
|
- "{music_video_url}"
|
||||||
|
|
||||||
output_options:
|
output_options:
|
||||||
output_directory: "{music_video_directory}"
|
output_directory: "{music_video_directory}"
|
||||||
|
|
|
||||||
|
|
@ -34,32 +34,31 @@ presets:
|
||||||
# TV show from one or more sources. Uses {url}'s avatar and banner as poster and fanart
|
# TV show from one or more sources. Uses {url}'s avatar and banner as poster and fanart
|
||||||
_tv_show_by_date:
|
_tv_show_by_date:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{url}"
|
||||||
- url: "{url}"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{tv_show_poster_file_name}"
|
||||||
- name: "{tv_show_poster_file_name}"
|
uid: "avatar_uncropped"
|
||||||
uid: "avatar_uncropped"
|
- name: "{tv_show_fanart_file_name}"
|
||||||
- name: "{tv_show_fanart_file_name}"
|
uid: "banner_uncropped"
|
||||||
uid: "banner_uncropped"
|
- url: "{url2}"
|
||||||
- url: "{url2}"
|
- url: "{url3}"
|
||||||
- url: "{url3}"
|
- url: "{url4}"
|
||||||
- url: "{url4}"
|
- url: "{url5}"
|
||||||
- url: "{url5}"
|
- url: "{url6}"
|
||||||
- url: "{url6}"
|
- url: "{url7}"
|
||||||
- url: "{url7}"
|
- url: "{url8}"
|
||||||
- url: "{url8}"
|
- url: "{url9}"
|
||||||
- url: "{url9}"
|
- url: "{url10}"
|
||||||
- url: "{url10}"
|
- url: "{url11}"
|
||||||
- url: "{url11}"
|
- url: "{url12}"
|
||||||
- url: "{url12}"
|
- url: "{url13}"
|
||||||
- url: "{url13}"
|
- url: "{url14}"
|
||||||
- url: "{url14}"
|
- url: "{url15}"
|
||||||
- url: "{url15}"
|
- url: "{url16}"
|
||||||
- url: "{url16}"
|
- url: "{url17}"
|
||||||
- url: "{url17}"
|
- url: "{url18}"
|
||||||
- url: "{url18}"
|
- url: "{url19}"
|
||||||
- url: "{url19}"
|
- url: "{url20}"
|
||||||
- url: "{url20}"
|
|
||||||
overrides:
|
overrides:
|
||||||
url2: ""
|
url2: ""
|
||||||
url3: ""
|
url3: ""
|
||||||
|
|
|
||||||
|
|
@ -21,20 +21,19 @@ presets:
|
||||||
|
|
||||||
collection_season_1:
|
collection_season_1:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_1_url}"
|
||||||
- url: "{collection_season_1_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "1"
|
||||||
collection_season_number: "1"
|
collection_season_number_padded: "01"
|
||||||
collection_season_number_padded: "01"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
# Use latest_entry first, then see if YT channel artwork exists
|
||||||
# Use latest_entry first, then see if YT channel artwork exists
|
# ONLY FOR SEASON 1! The channel artwork will be the show's artwork.
|
||||||
# ONLY FOR SEASON 1! The channel artwork will be the show's artwork.
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
- name: "{tv_show_poster_file_name}"
|
||||||
- name: "{tv_show_poster_file_name}"
|
uid: "avatar_uncropped"
|
||||||
uid: "avatar_uncropped"
|
- name: "{tv_show_fanart_file_name}"
|
||||||
- name: "{tv_show_fanart_file_name}"
|
uid: "banner_uncropped"
|
||||||
uid: "banner_uncropped"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -45,14 +44,13 @@ presets:
|
||||||
|
|
||||||
collection_season_2:
|
collection_season_2:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_2_url}"
|
||||||
- url: "{collection_season_2_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "2"
|
||||||
collection_season_number: "2"
|
collection_season_number_padded: "02"
|
||||||
collection_season_number_padded: "02"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -63,14 +61,13 @@ presets:
|
||||||
|
|
||||||
collection_season_3:
|
collection_season_3:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_3_url}"
|
||||||
- url: "{collection_season_3_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "3"
|
||||||
collection_season_number: "3"
|
collection_season_number_padded: "03"
|
||||||
collection_season_number_padded: "03"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -81,14 +78,13 @@ presets:
|
||||||
|
|
||||||
collection_season_4:
|
collection_season_4:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_4_url}"
|
||||||
- url: "{collection_season_4_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "4"
|
||||||
collection_season_number: "4"
|
collection_season_number_padded: "04"
|
||||||
collection_season_number_padded: "04"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -99,14 +95,13 @@ presets:
|
||||||
|
|
||||||
collection_season_5:
|
collection_season_5:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_5_url}"
|
||||||
- url: "{collection_season_5_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "5"
|
||||||
collection_season_number: "5"
|
collection_season_number_padded: "05"
|
||||||
collection_season_number_padded: "05"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -117,14 +112,13 @@ presets:
|
||||||
|
|
||||||
collection_season_6:
|
collection_season_6:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_6_url}"
|
||||||
- url: "{collection_season_6_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "6"
|
||||||
collection_season_number: "6"
|
collection_season_number_padded: "06"
|
||||||
collection_season_number_padded: "06"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -135,14 +129,13 @@ presets:
|
||||||
|
|
||||||
collection_season_7:
|
collection_season_7:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_7_url}"
|
||||||
- url: "{collection_season_7_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "7"
|
||||||
collection_season_number: "7"
|
collection_season_number_padded: "07"
|
||||||
collection_season_number_padded: "07"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -153,14 +146,13 @@ presets:
|
||||||
|
|
||||||
collection_season_8:
|
collection_season_8:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_8_url}"
|
||||||
- url: "{collection_season_8_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "8"
|
||||||
collection_season_number: "8"
|
collection_season_number_padded: "08"
|
||||||
collection_season_number_padded: "08"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -171,14 +163,13 @@ presets:
|
||||||
|
|
||||||
collection_season_9:
|
collection_season_9:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_9_url}"
|
||||||
- url: "{collection_season_9_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "9"
|
||||||
collection_season_number: "9"
|
collection_season_number_padded: "09"
|
||||||
collection_season_number_padded: "09"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -189,14 +180,13 @@ presets:
|
||||||
|
|
||||||
collection_season_10:
|
collection_season_10:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_10_url}"
|
||||||
- url: "{collection_season_10_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "10"
|
||||||
collection_season_number: "10"
|
collection_season_number_padded: "10"
|
||||||
collection_season_number_padded: "10"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -207,14 +197,13 @@ presets:
|
||||||
|
|
||||||
collection_season_11:
|
collection_season_11:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_11_url}"
|
||||||
- url: "{collection_season_11_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "11"
|
||||||
collection_season_number: "11"
|
collection_season_number_padded: "11"
|
||||||
collection_season_number_padded: "11"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -225,14 +214,13 @@ presets:
|
||||||
|
|
||||||
collection_season_12:
|
collection_season_12:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_12_url}"
|
||||||
- url: "{collection_season_12_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "12"
|
||||||
collection_season_number: "12"
|
collection_season_number_padded: "12"
|
||||||
collection_season_number_padded: "12"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -243,14 +231,13 @@ presets:
|
||||||
|
|
||||||
collection_season_13:
|
collection_season_13:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_13_url}"
|
||||||
- url: "{collection_season_13_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "13"
|
||||||
collection_season_number: "13"
|
collection_season_number_padded: "13"
|
||||||
collection_season_number_padded: "13"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -261,14 +248,13 @@ presets:
|
||||||
|
|
||||||
collection_season_14:
|
collection_season_14:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_14_url}"
|
||||||
- url: "{collection_season_14_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "14"
|
||||||
collection_season_number: "14"
|
collection_season_number_padded: "14"
|
||||||
collection_season_number_padded: "14"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -279,14 +265,13 @@ presets:
|
||||||
|
|
||||||
collection_season_15:
|
collection_season_15:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_15_url}"
|
||||||
- url: "{collection_season_15_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "15"
|
||||||
collection_season_number: "15"
|
collection_season_number_padded: "15"
|
||||||
collection_season_number_padded: "15"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -297,14 +282,13 @@ presets:
|
||||||
|
|
||||||
collection_season_16:
|
collection_season_16:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_16_url}"
|
||||||
- url: "{collection_season_16_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "16"
|
||||||
collection_season_number: "16"
|
collection_season_number_padded: "16"
|
||||||
collection_season_number_padded: "16"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -315,14 +299,13 @@ presets:
|
||||||
|
|
||||||
collection_season_17:
|
collection_season_17:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_17_url}"
|
||||||
- url: "{collection_season_17_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "17"
|
||||||
collection_season_number: "17"
|
collection_season_number_padded: "17"
|
||||||
collection_season_number_padded: "17"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -333,14 +316,13 @@ presets:
|
||||||
|
|
||||||
collection_season_18:
|
collection_season_18:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_18_url}"
|
||||||
- url: "{collection_season_18_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "18"
|
||||||
collection_season_number: "18"
|
collection_season_number_padded: "18"
|
||||||
collection_season_number_padded: "18"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -351,14 +333,13 @@ presets:
|
||||||
|
|
||||||
collection_season_19:
|
collection_season_19:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_19_url}"
|
||||||
- url: "{collection_season_19_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "19"
|
||||||
collection_season_number: "19"
|
collection_season_number_padded: "19"
|
||||||
collection_season_number_padded: "19"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -369,14 +350,13 @@ presets:
|
||||||
|
|
||||||
collection_season_20:
|
collection_season_20:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_20_url}"
|
||||||
- url: "{collection_season_20_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "20"
|
||||||
collection_season_number: "20"
|
collection_season_number_padded: "20"
|
||||||
collection_season_number_padded: "20"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -387,14 +367,13 @@ presets:
|
||||||
|
|
||||||
collection_season_21:
|
collection_season_21:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_21_url}"
|
||||||
- url: "{collection_season_21_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "21"
|
||||||
collection_season_number: "21"
|
collection_season_number_padded: "21"
|
||||||
collection_season_number_padded: "21"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -405,14 +384,13 @@ presets:
|
||||||
|
|
||||||
collection_season_22:
|
collection_season_22:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_22_url}"
|
||||||
- url: "{collection_season_22_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "22"
|
||||||
collection_season_number: "22"
|
collection_season_number_padded: "22"
|
||||||
collection_season_number_padded: "22"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -423,14 +401,13 @@ presets:
|
||||||
|
|
||||||
collection_season_23:
|
collection_season_23:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_23_url}"
|
||||||
- url: "{collection_season_23_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "23"
|
||||||
collection_season_number: "23"
|
collection_season_number_padded: "23"
|
||||||
collection_season_number_padded: "23"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -441,14 +418,13 @@ presets:
|
||||||
|
|
||||||
collection_season_24:
|
collection_season_24:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_24_url}"
|
||||||
- url: "{collection_season_24_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "24"
|
||||||
collection_season_number: "24"
|
collection_season_number_padded: "24"
|
||||||
collection_season_number_padded: "24"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -459,14 +435,13 @@ presets:
|
||||||
|
|
||||||
collection_season_25:
|
collection_season_25:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_25_url}"
|
||||||
- url: "{collection_season_25_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "25"
|
||||||
collection_season_number: "25"
|
collection_season_number_padded: "25"
|
||||||
collection_season_number_padded: "25"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -477,14 +452,13 @@ presets:
|
||||||
|
|
||||||
collection_season_26:
|
collection_season_26:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_26_url}"
|
||||||
- url: "{collection_season_26_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "26"
|
||||||
collection_season_number: "26"
|
collection_season_number_padded: "26"
|
||||||
collection_season_number_padded: "26"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -495,14 +469,13 @@ presets:
|
||||||
|
|
||||||
collection_season_27:
|
collection_season_27:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_27_url}"
|
||||||
- url: "{collection_season_27_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "27"
|
||||||
collection_season_number: "27"
|
collection_season_number_padded: "27"
|
||||||
collection_season_number_padded: "27"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -513,14 +486,13 @@ presets:
|
||||||
|
|
||||||
collection_season_28:
|
collection_season_28:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_28_url}"
|
||||||
- url: "{collection_season_28_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "28"
|
||||||
collection_season_number: "28"
|
collection_season_number_padded: "28"
|
||||||
collection_season_number_padded: "28"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -531,14 +503,13 @@ presets:
|
||||||
|
|
||||||
collection_season_29:
|
collection_season_29:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_29_url}"
|
||||||
- url: "{collection_season_29_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "29"
|
||||||
collection_season_number: "29"
|
collection_season_number_padded: "29"
|
||||||
collection_season_number_padded: "29"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -549,14 +520,13 @@ presets:
|
||||||
|
|
||||||
collection_season_30:
|
collection_season_30:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_30_url}"
|
||||||
- url: "{collection_season_30_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "30"
|
||||||
collection_season_number: "30"
|
collection_season_number_padded: "30"
|
||||||
collection_season_number_padded: "30"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -567,14 +537,13 @@ presets:
|
||||||
|
|
||||||
collection_season_31:
|
collection_season_31:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_31_url}"
|
||||||
- url: "{collection_season_31_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "31"
|
||||||
collection_season_number: "31"
|
collection_season_number_padded: "31"
|
||||||
collection_season_number_padded: "31"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -585,14 +554,13 @@ presets:
|
||||||
|
|
||||||
collection_season_32:
|
collection_season_32:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_32_url}"
|
||||||
- url: "{collection_season_32_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "32"
|
||||||
collection_season_number: "32"
|
collection_season_number_padded: "32"
|
||||||
collection_season_number_padded: "32"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -603,14 +571,13 @@ presets:
|
||||||
|
|
||||||
collection_season_33:
|
collection_season_33:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_33_url}"
|
||||||
- url: "{collection_season_33_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "33"
|
||||||
collection_season_number: "33"
|
collection_season_number_padded: "33"
|
||||||
collection_season_number_padded: "33"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -621,14 +588,13 @@ presets:
|
||||||
|
|
||||||
collection_season_34:
|
collection_season_34:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_34_url}"
|
||||||
- url: "{collection_season_34_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "34"
|
||||||
collection_season_number: "34"
|
collection_season_number_padded: "34"
|
||||||
collection_season_number_padded: "34"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -639,14 +605,13 @@ presets:
|
||||||
|
|
||||||
collection_season_35:
|
collection_season_35:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_35_url}"
|
||||||
- url: "{collection_season_35_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "35"
|
||||||
collection_season_number: "35"
|
collection_season_number_padded: "35"
|
||||||
collection_season_number_padded: "35"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -657,14 +622,13 @@ presets:
|
||||||
|
|
||||||
collection_season_36:
|
collection_season_36:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_36_url}"
|
||||||
- url: "{collection_season_36_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "36"
|
||||||
collection_season_number: "36"
|
collection_season_number_padded: "36"
|
||||||
collection_season_number_padded: "36"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -675,14 +639,13 @@ presets:
|
||||||
|
|
||||||
collection_season_37:
|
collection_season_37:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_37_url}"
|
||||||
- url: "{collection_season_37_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "37"
|
||||||
collection_season_number: "37"
|
collection_season_number_padded: "37"
|
||||||
collection_season_number_padded: "37"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -693,14 +656,13 @@ presets:
|
||||||
|
|
||||||
collection_season_38:
|
collection_season_38:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_38_url}"
|
||||||
- url: "{collection_season_38_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "38"
|
||||||
collection_season_number: "38"
|
collection_season_number_padded: "38"
|
||||||
collection_season_number_padded: "38"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -711,14 +673,13 @@ presets:
|
||||||
|
|
||||||
collection_season_39:
|
collection_season_39:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_39_url}"
|
||||||
- url: "{collection_season_39_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "39"
|
||||||
collection_season_number: "39"
|
collection_season_number_padded: "39"
|
||||||
collection_season_number_padded: "39"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -729,14 +690,13 @@ presets:
|
||||||
|
|
||||||
collection_season_40:
|
collection_season_40:
|
||||||
download:
|
download:
|
||||||
urls:
|
- url: "{collection_season_40_url}"
|
||||||
- url: "{collection_season_40_url}"
|
variables:
|
||||||
variables:
|
collection_season_number: "40"
|
||||||
collection_season_number: "40"
|
collection_season_number_padded: "40"
|
||||||
collection_season_number_padded: "40"
|
playlist_thumbnails:
|
||||||
playlist_thumbnails:
|
- name: "{season_poster_file_name}"
|
||||||
- name: "{season_poster_file_name}"
|
uid: "latest_entry"
|
||||||
uid: "latest_entry"
|
|
||||||
|
|
||||||
output_directory_nfo_tags:
|
output_directory_nfo_tags:
|
||||||
tags:
|
tags:
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
def sponsorblock_and_subs_preset_dict(output_directory) -> Dict:
|
def sponsorblock_and_subs_preset_dict(output_directory) -> Dict:
|
||||||
return {
|
return {
|
||||||
"preset": "music_video",
|
"preset": "music_video",
|
||||||
"download": {"url": "https://www.youtube.com/watch?v=-wJOUAuKZm8"},
|
"download": "https://www.youtube.com/watch?v=-wJOUAuKZm8",
|
||||||
# override the output directory with our fixture-generated dir
|
# override the output directory with our fixture-generated dir
|
||||||
"output_options": {"output_directory": output_directory},
|
"output_options": {"output_directory": output_directory},
|
||||||
"subtitles": {
|
"subtitles": {
|
||||||
|
|
@ -46,9 +46,7 @@ def sponsorblock_and_subs_preset_dict(output_directory) -> Dict:
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def chapters_from_comments_preset_dict(sponsorblock_and_subs_preset_dict: Dict) -> Dict:
|
def chapters_from_comments_preset_dict(sponsorblock_and_subs_preset_dict: Dict) -> Dict:
|
||||||
sponsorblock_and_subs_preset_dict["download"][
|
sponsorblock_and_subs_preset_dict["download"] = "https://www.youtube.com/watch?v=MO5AWAqe01Y"
|
||||||
"url"
|
|
||||||
] = "https://www.youtube.com/watch?v=MO5AWAqe01Y"
|
|
||||||
sponsorblock_and_subs_preset_dict["chapters"] = {
|
sponsorblock_and_subs_preset_dict["chapters"] = {
|
||||||
"embed_chapters": True,
|
"embed_chapters": True,
|
||||||
"allow_chapters_from_comments": True,
|
"allow_chapters_from_comments": True,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
def preset_dict(output_directory):
|
def preset_dict(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "music_video",
|
"preset": "music_video",
|
||||||
"download": {"url": "https://www.youtube.com/watch?v=2zYF9JLHDmA"},
|
"download": "https://www.youtube.com/watch?v=2zYF9JLHDmA",
|
||||||
"output_options": {"output_directory": output_directory},
|
"output_options": {"output_directory": output_directory},
|
||||||
# download the worst format so it is fast
|
# download the worst format so it is fast
|
||||||
"ytdl_options": {
|
"ytdl_options": {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
def preset_dict(output_directory):
|
def preset_dict(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "music_video",
|
"preset": "music_video",
|
||||||
"download": {"url": "https://www.youtube.com/watch?v=2zYF9JLHDmA"},
|
"download": "https://www.youtube.com/watch?v=2zYF9JLHDmA",
|
||||||
"output_options": {"output_directory": output_directory},
|
"output_options": {"output_directory": output_directory},
|
||||||
# download the worst format so it is fast
|
# download the worst format so it is fast
|
||||||
"ytdl_options": {
|
"ytdl_options": {
|
||||||
|
|
@ -23,7 +23,7 @@ def preset_dict(output_directory):
|
||||||
def playlist_preset_dict(output_directory):
|
def playlist_preset_dict(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "music_video",
|
"preset": "music_video",
|
||||||
"download": {"url": "https://www.youtube.com/playlist?list=PL5BC0FC26BECA5A35"},
|
"download": "https://www.youtube.com/playlist?list=PL5BC0FC26BECA5A35",
|
||||||
"output_options": {"output_directory": output_directory},
|
"output_options": {"output_directory": output_directory},
|
||||||
# download the worst format so it is fast
|
# download the worst format so it is fast
|
||||||
"ytdl_options": {
|
"ytdl_options": {
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,7 @@ from ytdl_sub.utils.exceptions import ValidationException
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def single_song_video_dict(output_directory):
|
def single_song_video_dict(output_directory):
|
||||||
return {
|
return {
|
||||||
"download": {
|
"download": "https://www.youtube.com/watch?v=2lAe1cqCOXo",
|
||||||
"url": "https://www.youtube.com/watch?v=2lAe1cqCOXo",
|
|
||||||
},
|
|
||||||
"output_options": {"output_directory": output_directory, "file_name": "will_error.mp4"},
|
"output_options": {"output_directory": output_directory, "file_name": "will_error.mp4"},
|
||||||
# test multi-tags
|
# test multi-tags
|
||||||
"music_tags": {"genres": ["multi_tag_1", "multi_tag_2"]},
|
"music_tags": {"genres": ["multi_tag_1", "multi_tag_2"]},
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
def subscription_dict(output_directory):
|
def subscription_dict(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "music_video",
|
"preset": "music_video",
|
||||||
"download": {"url": "https://www.youtube.com/shorts/ucYmEqmlhFw"},
|
"download": "https://www.youtube.com/shorts/ucYmEqmlhFw",
|
||||||
# override the output directory with our fixture-generated dir
|
# override the output directory with our fixture-generated dir
|
||||||
"output_options": {"output_directory": output_directory},
|
"output_options": {"output_directory": output_directory},
|
||||||
# download the worst format so it is fast
|
# download the worst format so it is fast
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ from ytdl_sub.utils.exceptions import ValidationException
|
||||||
def regex_subscription_dict_base(output_directory):
|
def regex_subscription_dict_base(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "music_video",
|
"preset": "music_video",
|
||||||
"download": {"url": "https://youtube.com/playlist?list=PL5BC0FC26BECA5A35"},
|
"download": "https://youtube.com/playlist?list=PL5BC0FC26BECA5A35",
|
||||||
# override the output directory with our fixture-generated dir
|
# override the output directory with our fixture-generated dir
|
||||||
"output_options": {"output_directory": output_directory},
|
"output_options": {"output_directory": output_directory},
|
||||||
# download the worst format so it is fast
|
# download the worst format so it is fast
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ class TestSplitByChapters:
|
||||||
mergedeep.merge(
|
mergedeep.merge(
|
||||||
yt_album_as_chapters_with_regex_preset_dict,
|
yt_album_as_chapters_with_regex_preset_dict,
|
||||||
{
|
{
|
||||||
"download": {"url": "https://youtube.com/watch?v=HKTNxEqsN3Q"},
|
"download": "https://youtube.com/watch?v=HKTNxEqsN3Q",
|
||||||
"split_by_chapters": {"when_no_chapters": when_no_chapters},
|
"split_by_chapters": {"when_no_chapters": when_no_chapters},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
def single_video_subs_embed_preset_dict(output_directory):
|
def single_video_subs_embed_preset_dict(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "music_video",
|
"preset": "music_video",
|
||||||
"download": {"url": "https://www.youtube.com/watch?v=2lAe1cqCOXo"},
|
"download": "https://www.youtube.com/watch?v=2lAe1cqCOXo",
|
||||||
# override the output directory with our fixture-generated dir
|
# override the output directory with our fixture-generated dir
|
||||||
"output_options": {"output_directory": output_directory},
|
"output_options": {"output_directory": output_directory},
|
||||||
"subtitles": {
|
"subtitles": {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ from ytdl_sub.subscriptions.subscription import Subscription
|
||||||
def single_video_preset_dict_old_video_tags_format(output_directory):
|
def single_video_preset_dict_old_video_tags_format(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "music_video",
|
"preset": "music_video",
|
||||||
"download": {"url": "https://youtube.com/watch?v=HKTNxEqsN3Q"},
|
"download": "https://youtube.com/watch?v=HKTNxEqsN3Q",
|
||||||
# override the output directory with our fixture-generated dir
|
# override the output directory with our fixture-generated dir
|
||||||
"output_options": {
|
"output_options": {
|
||||||
"output_directory": output_directory,
|
"output_directory": output_directory,
|
||||||
|
|
@ -37,7 +37,7 @@ def single_video_preset_dict_old_video_tags_format(output_directory):
|
||||||
def single_video_preset_dict(output_directory):
|
def single_video_preset_dict(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "music_video",
|
"preset": "music_video",
|
||||||
"download": {"url": "https://youtube.com/watch?v=HKTNxEqsN3Q"},
|
"download": "https://youtube.com/watch?v=HKTNxEqsN3Q",
|
||||||
# override the output directory with our fixture-generated dir
|
# override the output directory with our fixture-generated dir
|
||||||
"output_options": {
|
"output_options": {
|
||||||
"output_directory": output_directory,
|
"output_directory": output_directory,
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,8 @@ class TestConfigFilePartiallyValidatesPresets:
|
||||||
def test_error__download_args(self):
|
def test_error__download_args(self):
|
||||||
self._partial_validate(
|
self._partial_validate(
|
||||||
preset_dict={"download": {"bad_key": "nope"}},
|
preset_dict={"download": {"bad_key": "nope"}},
|
||||||
expected_error_message="Validation error in partial_preset.download: "
|
expected_error_message="Validation error in partial_preset.download.1: "
|
||||||
"'partial_preset.download' contains the field 'bad_key' which is not allowed. "
|
"'partial_preset.download.1' contains the field 'bad_key' which is not allowed. "
|
||||||
"Allowed fields: download_reverse, playlist_thumbnails, source_thumbnails, url, "
|
"Allowed fields: download_reverse, playlist_thumbnails, source_thumbnails, url, "
|
||||||
"variables",
|
"variables",
|
||||||
)
|
)
|
||||||
|
|
@ -77,7 +77,7 @@ class TestConfigFilePartiallyValidatesPresets:
|
||||||
"preset_dict",
|
"preset_dict",
|
||||||
[
|
[
|
||||||
{"nfo_tags": {"tags": {"key-1": {"attributes": {"test": "2"}}}}},
|
{"nfo_tags": {"tags": {"key-1": {"attributes": {"test": "2"}}}}},
|
||||||
{"download": {"urls": [{"variables_to_set": {"name": "value"}}]}},
|
{"download": [{"variables_to_set": {"name": "value"}}]},
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_partial_validate__incomplete_list_item(self, preset_dict):
|
def test_partial_validate__incomplete_list_item(self, preset_dict):
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,12 @@ class TestPreset:
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"download_value",
|
"download_value",
|
||||||
[
|
[
|
||||||
{"url": "youtube.com/watch?v=123abc"},
|
{"url": "youtube.com/watch?v=123abc"}, # url download strategy
|
||||||
{"urls": [{"url": "youtube.com/watch?v=123abc"}]},
|
{"urls": [{"url": "youtube.com/watch?v=123abc"}]}, # multi-url download strategy
|
||||||
###########################################################
|
"youtube.com/watch?v=123abc", # single string
|
||||||
##### OLD download_strategy format
|
["youtube.com/watch?v=123abc", "youtube.com/watch?v=123xyz"], # list of strings
|
||||||
|
[{"url": "youtube.com/watch?v=123abc"}, "youtube.com/watch?v=123abc"], # dict and str
|
||||||
|
# OLD download_strategy format
|
||||||
{"download_strategy": "url", "url": "youtube.com/watch?v=123abc"},
|
{"download_strategy": "url", "url": "youtube.com/watch?v=123abc"},
|
||||||
{"download_strategy": "multi-url", "urls": [{"url": "youtube.com/watch?v=123abc"}]},
|
{"download_strategy": "multi-url", "urls": [{"url": "youtube.com/watch?v=123abc"}]},
|
||||||
],
|
],
|
||||||
|
|
@ -201,9 +203,7 @@ class TestPreset:
|
||||||
config=config_file,
|
config=config_file,
|
||||||
name="test",
|
name="test",
|
||||||
value={
|
value={
|
||||||
"download": {
|
"download": [{"url": "non-empty url"}, {"url": ""}], # empty url
|
||||||
"urls": [{"url": "non-empty url"}, {"url": ""}], # empty url
|
|
||||||
},
|
|
||||||
"output_options": output_options,
|
"output_options": output_options,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
@ -222,9 +222,7 @@ class TestPreset:
|
||||||
config=config_file,
|
config=config_file,
|
||||||
name="test",
|
name="test",
|
||||||
value={
|
value={
|
||||||
"download": {
|
"download": [{"url": "{url}"}, {"url": "{url2}"}],
|
||||||
"urls": [{"url": "{url}"}, {"url": "{url2}"}],
|
|
||||||
},
|
|
||||||
"output_options": output_options,
|
"output_options": output_options,
|
||||||
"overrides": {"url": "", "url2": ""},
|
"overrides": {"url": "", "url2": ""},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class TestPrebuiltTVShowPresets:
|
||||||
preset_name="preset_test",
|
preset_name="preset_test",
|
||||||
preset_dict={
|
preset_dict={
|
||||||
"preset": parent_presets,
|
"preset": parent_presets,
|
||||||
"download": {"urls": [{"url": "https://second.url"}]},
|
"download": "https://second.url",
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"url": "https://your.name.here",
|
"url": "https://your.name.here",
|
||||||
"tv_show_name": "test-compile",
|
"tv_show_name": "test-compile",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue