[BACKEND] Shared multi-url helper preset, can now disable grabbing poster/fanart (#807)
This commit is contained in:
parent
8a27cad94e
commit
e257210e4a
4 changed files with 30 additions and 36 deletions
|
|
@ -79,6 +79,10 @@ class UrlDownloaderThumbnailPlugin(SourcePluginExtension):
|
||||||
thumbnail_name = self.overrides.apply_formatter(thumbnail_info.name, entry=entry)
|
thumbnail_name = self.overrides.apply_formatter(thumbnail_info.name, entry=entry)
|
||||||
thumbnail_id = self.overrides.apply_formatter(thumbnail_info.uid)
|
thumbnail_id = self.overrides.apply_formatter(thumbnail_info.uid)
|
||||||
|
|
||||||
|
# If the thumbnail name is an empty string, completely ignore trying to download it
|
||||||
|
if not thumbnail_name:
|
||||||
|
continue
|
||||||
|
|
||||||
# If latest entry, always update the thumbnail on each entry
|
# If latest entry, always update the thumbnail on each entry
|
||||||
if thumbnail_id == ThumbnailTypes.LATEST_ENTRY:
|
if thumbnail_id == ThumbnailTypes.LATEST_ENTRY:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,26 @@
|
||||||
|
|
||||||
presets:
|
presets:
|
||||||
|
|
||||||
_single_url_base:
|
##################################################################################
|
||||||
overrides:
|
# Multi urls in the form of
|
||||||
subscription_value: ""
|
#
|
||||||
url: "{subscription_value}"
|
# "Subscription Name":
|
||||||
|
# - "url"
|
||||||
_multi_url_base:
|
# - "url2"
|
||||||
|
# or
|
||||||
|
#
|
||||||
|
# "Subscription Name": "url"
|
||||||
|
#
|
||||||
|
# where url tries to grab channel avatar + banner
|
||||||
|
#
|
||||||
|
_multi_url:
|
||||||
download:
|
download:
|
||||||
|
- url: "{url}"
|
||||||
|
playlist_thumbnails:
|
||||||
|
- name: "{avatar_uncropped_thumbnail_file_name}"
|
||||||
|
uid: "avatar_uncropped"
|
||||||
|
- name: "{banner_uncropped_thumbnail_file_name}"
|
||||||
|
uid: "banner_uncropped"
|
||||||
- url: "{url2}"
|
- url: "{url2}"
|
||||||
- url: "{url3}"
|
- url: "{url3}"
|
||||||
- url: "{url4}"
|
- url: "{url4}"
|
||||||
|
|
@ -29,6 +42,9 @@ presets:
|
||||||
- url: "{url19}"
|
- url: "{url19}"
|
||||||
- url: "{url20}"
|
- url: "{url20}"
|
||||||
overrides:
|
overrides:
|
||||||
|
avatar_uncropped_thumbnail_file_name: ""
|
||||||
|
banner_uncropped_thumbnail_file_name: ""
|
||||||
|
subscription_value: ""
|
||||||
subscription_value_2: ""
|
subscription_value_2: ""
|
||||||
subscription_value_3: ""
|
subscription_value_3: ""
|
||||||
subscription_value_4: ""
|
subscription_value_4: ""
|
||||||
|
|
@ -48,6 +64,7 @@ presets:
|
||||||
subscription_value_18: ""
|
subscription_value_18: ""
|
||||||
subscription_value_19: ""
|
subscription_value_19: ""
|
||||||
subscription_value_20: ""
|
subscription_value_20: ""
|
||||||
|
url: "{subscription_value}"
|
||||||
url2: "{subscription_value_2}"
|
url2: "{subscription_value_2}"
|
||||||
url3: "{subscription_value_3}"
|
url3: "{subscription_value_3}"
|
||||||
url4: "{subscription_value_4}"
|
url4: "{subscription_value_4}"
|
||||||
|
|
@ -66,31 +83,4 @@ presets:
|
||||||
url17: "{subscription_value_17}"
|
url17: "{subscription_value_17}"
|
||||||
url18: "{subscription_value_18}"
|
url18: "{subscription_value_18}"
|
||||||
url19: "{subscription_value_19}"
|
url19: "{subscription_value_19}"
|
||||||
url20: "{subscription_value_20}"
|
url20: "{subscription_value_20}"
|
||||||
|
|
||||||
_single_url:
|
|
||||||
preset: "_single_url_base"
|
|
||||||
download:
|
|
||||||
- "{url}"
|
|
||||||
|
|
||||||
_single_url_with_avatar_and_banner:
|
|
||||||
preset: "_single_url_base"
|
|
||||||
download:
|
|
||||||
- url: "{url}"
|
|
||||||
playlist_thumbnails:
|
|
||||||
- name: "{avatar_uncropped_thumbnail_file_name}"
|
|
||||||
uid: "avatar_uncropped"
|
|
||||||
- name: "{banner_uncropped_thumbnail_file_name}"
|
|
||||||
uid: "banner_uncropped"
|
|
||||||
|
|
||||||
##################################################################################
|
|
||||||
|
|
||||||
_multi_url:
|
|
||||||
preset:
|
|
||||||
- "_single_url"
|
|
||||||
- "_multi_url_base"
|
|
||||||
|
|
||||||
_multi_url_with_avatar_and_banner:
|
|
||||||
preset:
|
|
||||||
- "_single_url_with_avatar_and_banner"
|
|
||||||
- "_multi_url_base"
|
|
||||||
|
|
@ -33,7 +33,7 @@ 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:
|
||||||
preset: "_multi_url_with_avatar_and_banner"
|
preset: "_multi_url"
|
||||||
overrides:
|
overrides:
|
||||||
avatar_uncropped_thumbnail_file_name: "{tv_show_poster_file_name}"
|
avatar_uncropped_thumbnail_file_name: "{tv_show_poster_file_name}"
|
||||||
banner_uncropped_thumbnail_file_name: "{tv_show_fanart_file_name}"
|
banner_uncropped_thumbnail_file_name: "{tv_show_fanart_file_name}"
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ from ytdl_sub.utils.exceptions import ValidationException
|
||||||
def regex_subscription_dict_base(output_directory):
|
def regex_subscription_dict_base(output_directory):
|
||||||
return {
|
return {
|
||||||
"preset": "Jellyfin Music Videos",
|
"preset": "Jellyfin Music Videos",
|
||||||
"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},
|
||||||
"format": "best[height<=480]", # download the worst format so it is fast
|
"format": "best[height<=480]", # download the worst format so it is fast
|
||||||
|
|
@ -43,6 +42,7 @@ def regex_subscription_dict_base(output_directory):
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"in_regex_default": "in regex default",
|
"in_regex_default": "in regex default",
|
||||||
|
"url": "https://youtube.com/playlist?list=PL5BC0FC26BECA5A35",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue