[FEATURE] Prebuilt Music Videos
This commit is contained in:
parent
4789035821
commit
095b14a8c1
12 changed files with 350 additions and 31 deletions
|
|
@ -19,3 +19,8 @@ presets:
|
|||
overrides:
|
||||
file_uid: "{uid_sanitized_plex}"
|
||||
file_title: "{title_sanitized_plex}"
|
||||
|
||||
_plex_video_base:
|
||||
preset:
|
||||
- "_plex_base"
|
||||
format: "(bv*[ext=mp4][vcodec~='^((he|a)vc|h26[45])']+ba[ext=m4a]) / (bv[ext=mp4]*+ba[ext=m4a]/b)"
|
||||
9
src/ytdl_sub/prebuilt_presets/music_videos/__init__.py
Normal file
9
src/ytdl_sub/prebuilt_presets/music_videos/__init__.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from ytdl_sub.prebuilt_presets import PrebuiltPresets
|
||||
|
||||
|
||||
class MusicVideoPresets(PrebuiltPresets):
|
||||
preset_names = {
|
||||
"Kodi Music Videos",
|
||||
"Jellyfin Music Videos",
|
||||
"Plex Music Videos",
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
presets:
|
||||
# TODO: Update this
|
||||
kodi_music_video:
|
||||
download:
|
||||
- "{music_video_url}"
|
||||
|
||||
output_options:
|
||||
output_directory: "{music_video_directory}"
|
||||
file_name: "{music_video_file_name}.{ext}"
|
||||
thumbnail_name: "{music_video_file_name}-thumb.jpg"
|
||||
|
||||
nfo_tags:
|
||||
nfo_name: "{music_video_name}.nfo"
|
||||
nfo_root: "musicvideo"
|
||||
kodi_safe: True
|
||||
tags:
|
||||
artist: "{music_video_artist}"
|
||||
title: "{music_video_title}"
|
||||
album: "{music_video_album}"
|
||||
year: "{music_video_year}"
|
||||
|
||||
overrides:
|
||||
# MUST DEFINE:
|
||||
# music_video_artist
|
||||
# music_video_directory
|
||||
music_video_title: "{title}"
|
||||
music_video_album: "Music Videos"
|
||||
music_video_year: "{upload_year}"
|
||||
music_video_file_name: "{artist_sanitized}/{music_video_year} - {music_video_title_sanitized}"
|
||||
71
src/ytdl_sub/prebuilt_presets/music_videos/music_videos.yaml
Normal file
71
src/ytdl_sub/prebuilt_presets/music_videos/music_videos.yaml
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
presets:
|
||||
_music_video_base:
|
||||
download:
|
||||
- "{url}"
|
||||
|
||||
output_options:
|
||||
output_directory: "{music_video_directory}"
|
||||
file_name: "{music_video_file_name}.{ext}"
|
||||
thumbnail_name: "{music_video_file_name}.jpg"
|
||||
|
||||
overrides:
|
||||
# MUST DEFINE:
|
||||
# music_video_directory
|
||||
|
||||
# Defaults
|
||||
music_video_genre_default: "ytdl-sub"
|
||||
music_video_album_default: "Music Videos"
|
||||
|
||||
# Subscription overrides
|
||||
subscription_indent_1: "{music_video_genre_default}"
|
||||
url: "{subscription_value}"
|
||||
|
||||
# Music Video Overrides
|
||||
music_video_title: "{title}"
|
||||
music_video_album: "{music_video_album_default}"
|
||||
music_video_artist: "{subscription_name}"
|
||||
music_video_year: "{upload_year}"
|
||||
music_video_date: "{upload_date_standardized}"
|
||||
music_video_genre: "{subscription_indent_1}"
|
||||
|
||||
# Directory Overrides
|
||||
music_video_file_name: "{music_video_artist_sanitized}/{music_video_title_sanitized}"
|
||||
|
||||
_music_video_nfo:
|
||||
nfo_tags:
|
||||
nfo_name: "{music_video_file_name}.nfo"
|
||||
nfo_root: "musicvideo"
|
||||
tags:
|
||||
artist: "{music_video_artist}"
|
||||
title: "{music_video_title}"
|
||||
album: "{music_video_album}"
|
||||
# Kodi v20 to not use year, so removing
|
||||
premiered: "{music_video_date}"
|
||||
|
||||
_music_video_tags:
|
||||
video_tags:
|
||||
artist: "{music_video_artist}"
|
||||
title: "{music_video_title}"
|
||||
album: "{music_video_album}"
|
||||
year: "{music_video_year}"
|
||||
premiered: "{music_video_date}"
|
||||
|
||||
"Jellyfin Music Videos":
|
||||
preset:
|
||||
- "_base"
|
||||
- "_music_video_base"
|
||||
- "_music_video_nfo"
|
||||
- "_music_video_tags"
|
||||
|
||||
"Kodi Music Videos":
|
||||
preset:
|
||||
- "_kodi_base"
|
||||
- "_music_video_base"
|
||||
- "_music_video_nfo"
|
||||
- "_music_video_tags"
|
||||
|
||||
"Plex Music Videos":
|
||||
preset:
|
||||
- "_plex_video_base"
|
||||
- "_music_video_base"
|
||||
- "_music_video_tags"
|
||||
|
|
@ -3,10 +3,9 @@ presets:
|
|||
|
||||
_plex_tv_show: # Default Highest Resolution, No AV1, which is not currently supported by plex
|
||||
preset:
|
||||
- "_plex_base"
|
||||
- "_plex_video_base"
|
||||
- "_episode_base"
|
||||
- "_episode_video_tags"
|
||||
format: "(bv*[ext=mp4][vcodec~='^((he|a)vc|h26[45])']+ba[ext=m4a]) / (bv[ext=mp4]*+ba[ext=m4a]/b)"
|
||||
overrides:
|
||||
tv_show_poster_file_name: "poster.jpg"
|
||||
tv_show_fanart_file_name: "fanart.jpg"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"subscription_test/Mock Entry 20-1.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 20-1.mp4": "5404e6d81e626fd47acce084205f00e5",
|
||||
"subscription_test/Mock Entry 20-1.nfo": "7541e471c3ace8c8f2c943df8fe906cf",
|
||||
"subscription_test/Mock Entry 20-2.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 20-2.mp4": "a4468591d27db0138c3e268eb680f3fc",
|
||||
"subscription_test/Mock Entry 20-2.nfo": "6053acb34368b91b3c794d082b3e5fe1",
|
||||
"subscription_test/Mock Entry 20-3.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 20-3.mp4": "9402798c0344f17f4312c022f5ff720f",
|
||||
"subscription_test/Mock Entry 20-3.nfo": "a0f78a99335d2f53d379ca4ec0e492eb",
|
||||
"subscription_test/Mock Entry 21-1.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 21-1.mp4": "d937ef9c52386799115f66f74df2a89e",
|
||||
"subscription_test/Mock Entry 21-1.nfo": "dc2dfb1c6e33679221a52bb37b8adf1c"
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"subscription_test/Mock Entry 20-1.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 20-1.mp4": "5404e6d81e626fd47acce084205f00e5",
|
||||
"subscription_test/Mock Entry 20-1.nfo": "7541e471c3ace8c8f2c943df8fe906cf",
|
||||
"subscription_test/Mock Entry 20-2.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 20-2.mp4": "a4468591d27db0138c3e268eb680f3fc",
|
||||
"subscription_test/Mock Entry 20-2.nfo": "6053acb34368b91b3c794d082b3e5fe1",
|
||||
"subscription_test/Mock Entry 20-3.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 20-3.mp4": "9402798c0344f17f4312c022f5ff720f",
|
||||
"subscription_test/Mock Entry 20-3.nfo": "a0f78a99335d2f53d379ca4ec0e492eb",
|
||||
"subscription_test/Mock Entry 21-1.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 21-1.mp4": "d937ef9c52386799115f66f74df2a89e",
|
||||
"subscription_test/Mock Entry 21-1.nfo": "dc2dfb1c6e33679221a52bb37b8adf1c"
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"subscription_test/Mock Entry 20-1.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 20-1.mp4": "5404e6d81e626fd47acce084205f00e5",
|
||||
"subscription_test/Mock Entry 20-2.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 20-2.mp4": "a4468591d27db0138c3e268eb680f3fc",
|
||||
"subscription_test/Mock Entry 20-3.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 20-3.mp4": "9402798c0344f17f4312c022f5ff720f",
|
||||
"subscription_test/Mock Entry 21-1.jpg": "e80c508c4818454300133fe1dc1a9cd7",
|
||||
"subscription_test/Mock Entry 21-1.mp4": "d937ef9c52386799115f66f74df2a89e"
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
Files created:
|
||||
----------------------------------------
|
||||
{output_directory}/subscription_test
|
||||
Mock Entry 20-1.jpg
|
||||
Mock Entry 20-1.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-08
|
||||
title: Mock Entry 20-1
|
||||
year: 2020
|
||||
Mock Entry 20-1.nfo
|
||||
NFO tags:
|
||||
musicvideo:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-08
|
||||
title: Mock Entry 20-1
|
||||
Mock Entry 20-2.jpg
|
||||
Mock Entry 20-2.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-08
|
||||
title: Mock Entry 20-2
|
||||
year: 2020
|
||||
Mock Entry 20-2.nfo
|
||||
NFO tags:
|
||||
musicvideo:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-08
|
||||
title: Mock Entry 20-2
|
||||
Mock Entry 20-3.jpg
|
||||
Mock Entry 20-3.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-07
|
||||
title: Mock Entry 20-3
|
||||
year: 2020
|
||||
Mock Entry 20-3.nfo
|
||||
NFO tags:
|
||||
musicvideo:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-07
|
||||
title: Mock Entry 20-3
|
||||
Mock Entry 21-1.jpg
|
||||
Mock Entry 21-1.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2021-08-08
|
||||
title: Mock Entry 21-1
|
||||
year: 2021
|
||||
Mock Entry 21-1.nfo
|
||||
NFO tags:
|
||||
musicvideo:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2021-08-08
|
||||
title: Mock Entry 21-1
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
Files created:
|
||||
----------------------------------------
|
||||
{output_directory}/subscription_test
|
||||
Mock Entry 20-1.jpg
|
||||
Mock Entry 20-1.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-08
|
||||
title: Mock Entry 20-1
|
||||
year: 2020
|
||||
Mock Entry 20-1.nfo
|
||||
NFO tags:
|
||||
musicvideo:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-08
|
||||
title: Mock Entry 20-1
|
||||
Mock Entry 20-2.jpg
|
||||
Mock Entry 20-2.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-08
|
||||
title: Mock Entry 20-2
|
||||
year: 2020
|
||||
Mock Entry 20-2.nfo
|
||||
NFO tags:
|
||||
musicvideo:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-08
|
||||
title: Mock Entry 20-2
|
||||
Mock Entry 20-3.jpg
|
||||
Mock Entry 20-3.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-07
|
||||
title: Mock Entry 20-3
|
||||
year: 2020
|
||||
Mock Entry 20-3.nfo
|
||||
NFO tags:
|
||||
musicvideo:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-07
|
||||
title: Mock Entry 20-3
|
||||
Mock Entry 21-1.jpg
|
||||
Mock Entry 21-1.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2021-08-08
|
||||
title: Mock Entry 21-1
|
||||
year: 2021
|
||||
Mock Entry 21-1.nfo
|
||||
NFO tags:
|
||||
musicvideo:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2021-08-08
|
||||
title: Mock Entry 21-1
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
Files created:
|
||||
----------------------------------------
|
||||
{output_directory}/subscription_test
|
||||
Mock Entry 20-1.jpg
|
||||
Mock Entry 20-1.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-08
|
||||
title: Mock Entry 20-1
|
||||
year: 2020
|
||||
Mock Entry 20-2.jpg
|
||||
Mock Entry 20-2.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-08
|
||||
title: Mock Entry 20-2
|
||||
year: 2020
|
||||
Mock Entry 20-3.jpg
|
||||
Mock Entry 20-3.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2020-08-07
|
||||
title: Mock Entry 20-3
|
||||
year: 2020
|
||||
Mock Entry 21-1.jpg
|
||||
Mock Entry 21-1.mp4
|
||||
Video Tags:
|
||||
album: Music Videos
|
||||
artist: subscription_test
|
||||
premiered: 2021-08-08
|
||||
title: Mock Entry 21-1
|
||||
year: 2021
|
||||
|
|
@ -7,6 +7,7 @@ from expected_download import assert_expected_downloads
|
|||
from expected_transaction_log import assert_transaction_log_matches
|
||||
|
||||
from ytdl_sub.prebuilt_presets.music import MusicPresets
|
||||
from ytdl_sub.prebuilt_presets.music_videos import MusicVideoPresets
|
||||
from ytdl_sub.prebuilt_presets.tv_show import TvShowByDateEpisodeFormattingPresets
|
||||
from ytdl_sub.prebuilt_presets.tv_show import TvShowByDatePresets
|
||||
from ytdl_sub.prebuilt_presets.tv_show import TvShowCollectionEpisodeFormattingPresets
|
||||
|
|
@ -411,3 +412,67 @@ class TestPrebuiltMusicPresets:
|
|||
dry_run=False,
|
||||
expected_download_summary_file_name=f"{expected_summary_name}.json",
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("music_video_preset", MusicVideoPresets.preset_names)
|
||||
class TestPrebuiltMusicVideoPresets:
|
||||
def test_compilation(
|
||||
self,
|
||||
config,
|
||||
music_video_preset: str,
|
||||
):
|
||||
_ = Subscription.from_dict(
|
||||
config=config,
|
||||
preset_name="preset_test",
|
||||
preset_dict={
|
||||
"preset": [
|
||||
music_video_preset,
|
||||
],
|
||||
"overrides": {
|
||||
"music_video_directory": "/music_videos",
|
||||
"subscription_value": "https://your.name.here",
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
def test_presets_run(
|
||||
self,
|
||||
config,
|
||||
subscription_name,
|
||||
output_directory,
|
||||
mock_download_collection_entries,
|
||||
music_video_preset: str,
|
||||
):
|
||||
expected_summary_name = f"unit/music_videos/{music_video_preset}"
|
||||
|
||||
preset_dict = {
|
||||
"preset": [
|
||||
music_video_preset,
|
||||
],
|
||||
"overrides": {
|
||||
"url": "https://your.name.here",
|
||||
"music_video_directory": output_directory,
|
||||
},
|
||||
}
|
||||
|
||||
subscription = Subscription.from_dict(
|
||||
config=config,
|
||||
preset_name=subscription_name,
|
||||
preset_dict=preset_dict,
|
||||
)
|
||||
|
||||
with mock_download_collection_entries(
|
||||
is_youtube_channel=False, num_urls=1, is_extracted_audio=False
|
||||
):
|
||||
transaction_log = subscription.download(dry_run=False)
|
||||
|
||||
assert_transaction_log_matches(
|
||||
output_directory=output_directory,
|
||||
transaction_log=transaction_log,
|
||||
transaction_log_summary_file_name=f"{expected_summary_name}.txt",
|
||||
)
|
||||
assert_expected_downloads(
|
||||
output_directory=output_directory,
|
||||
dry_run=False,
|
||||
expected_download_summary_file_name=f"{expected_summary_name}.json",
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue