audio done
This commit is contained in:
parent
fb37086aa9
commit
a19388706f
7 changed files with 30 additions and 28 deletions
|
|
@ -5,7 +5,6 @@ presets:
|
|||
output_directory: "{music_directory}"
|
||||
file_name: "{track_full_path}"
|
||||
thumbnail_name: "{album_cover_path}"
|
||||
download_archive_name: ".{subscription_name_sanitized}-download-archive.json"
|
||||
maintain_download_archive: True
|
||||
|
||||
ytdl_options:
|
||||
|
|
@ -39,8 +38,8 @@ presets:
|
|||
|
||||
# Track Overrides
|
||||
track_title: "{title}"
|
||||
track_album: "Singles"
|
||||
track_artist: "{channel}"
|
||||
track_album: "{title}"
|
||||
track_artist: "{subscription_name}"
|
||||
track_album_artist: "{track_artist}"
|
||||
track_number: "1"
|
||||
track_number_padded: "01"
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ from ytdl_sub.subscriptions.subscription import Subscription
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def single_song_preset_dict_old_format(output_directory):
|
||||
def single_preset_dict_old_format(output_directory):
|
||||
return {
|
||||
"preset": "single",
|
||||
"preset": "Single",
|
||||
# test multi-tags
|
||||
"music_tags": {"embed_thumbnail": True, "tags": {"genres": ["multi_tag_1", "multi_tag_2"]}},
|
||||
"format": "worst[ext=mp4]", # download the worst format so it is fast
|
||||
|
|
@ -16,6 +16,7 @@ def single_song_preset_dict_old_format(output_directory):
|
|||
"postprocessor_args": {"ffmpeg": ["-bitexact"]}, # Must add this for reproducibility
|
||||
},
|
||||
"overrides": {
|
||||
"track_artist": "YouTube",
|
||||
"url": "https://www.youtube.com/watch?v=2lAe1cqCOXo",
|
||||
"music_directory": output_directory,
|
||||
},
|
||||
|
|
@ -23,9 +24,9 @@ def single_song_preset_dict_old_format(output_directory):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def single_song_preset_dict(output_directory):
|
||||
def single_preset_dict(output_directory):
|
||||
return {
|
||||
"preset": "single",
|
||||
"preset": "Single",
|
||||
# test multi-tags
|
||||
"music_tags": {"genres": ["multi_tag_1", "multi_tag_2"]},
|
||||
# test the new embed_thumbnail plugin
|
||||
|
|
@ -35,6 +36,7 @@ def single_song_preset_dict(output_directory):
|
|||
"postprocessor_args": {"ffmpeg": ["-bitexact"]}, # Must add this for reproducibility
|
||||
},
|
||||
"overrides": {
|
||||
"track_artist": "YouTube",
|
||||
"url": "https://www.youtube.com/watch?v=2lAe1cqCOXo",
|
||||
"music_directory": output_directory,
|
||||
},
|
||||
|
|
@ -42,20 +44,21 @@ def single_song_preset_dict(output_directory):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
def single_song_best_format_preset_dict(single_song_preset_dict):
|
||||
return dict(single_song_preset_dict, **{"audio_extract": {"codec": "best"}})
|
||||
def single_best_format_preset_dict(single_preset_dict):
|
||||
return dict(single_preset_dict, **{"audio_extract": {"codec": "best"}})
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def multiple_songs_preset_dict(output_directory):
|
||||
def youtube_release_preset_dict(output_directory):
|
||||
return {
|
||||
"preset": "albums_from_playlists",
|
||||
"preset": "YouTube Releases",
|
||||
"audio_extract": {"codec": "vorbis", "quality": 140},
|
||||
"format": "worst[ext=mp4]", # download the worst format so it is fast
|
||||
"ytdl_options": {
|
||||
"postprocessor_args": {"ffmpeg": ["-bitexact"]}, # Must add this for reproducibility
|
||||
},
|
||||
"overrides": {
|
||||
"track_artist": "Project Zombie",
|
||||
"url": "https://youtube.com/playlist?list=PL5BC0FC26BECA5A35",
|
||||
"music_directory": output_directory,
|
||||
},
|
||||
|
|
@ -67,14 +70,14 @@ class TestAudioExtract:
|
|||
def test_audio_extract_single_song_old_format(
|
||||
self,
|
||||
music_audio_config,
|
||||
single_song_preset_dict_old_format,
|
||||
single_preset_dict_old_format,
|
||||
output_directory,
|
||||
dry_run,
|
||||
):
|
||||
subscription = Subscription.from_dict(
|
||||
config=music_audio_config,
|
||||
preset_name="single_song_test",
|
||||
preset_dict=single_song_preset_dict_old_format,
|
||||
preset_dict=single_preset_dict_old_format,
|
||||
)
|
||||
|
||||
transaction_log = subscription.download(dry_run=dry_run)
|
||||
|
|
@ -93,14 +96,14 @@ class TestAudioExtract:
|
|||
def test_audio_extract_single_song(
|
||||
self,
|
||||
music_audio_config,
|
||||
single_song_preset_dict,
|
||||
single_preset_dict,
|
||||
output_directory,
|
||||
dry_run,
|
||||
):
|
||||
subscription = Subscription.from_dict(
|
||||
config=music_audio_config,
|
||||
preset_name="single_song_test",
|
||||
preset_dict=single_song_preset_dict,
|
||||
preset_dict=single_preset_dict,
|
||||
)
|
||||
|
||||
transaction_log = subscription.download(dry_run=dry_run)
|
||||
|
|
@ -119,14 +122,14 @@ class TestAudioExtract:
|
|||
def test_audio_extract_single_song_best_format(
|
||||
self,
|
||||
music_audio_config,
|
||||
single_song_best_format_preset_dict,
|
||||
single_best_format_preset_dict,
|
||||
output_directory,
|
||||
dry_run,
|
||||
):
|
||||
subscription = Subscription.from_dict(
|
||||
config=music_audio_config,
|
||||
preset_name="single_song_best_test",
|
||||
preset_dict=single_song_best_format_preset_dict,
|
||||
preset_dict=single_best_format_preset_dict,
|
||||
)
|
||||
|
||||
transaction_log = subscription.download(dry_run=dry_run)
|
||||
|
|
@ -145,14 +148,14 @@ class TestAudioExtract:
|
|||
def test_audio_extract_multiple_songs(
|
||||
self,
|
||||
music_audio_config,
|
||||
multiple_songs_preset_dict,
|
||||
youtube_release_preset_dict,
|
||||
output_directory,
|
||||
dry_run,
|
||||
):
|
||||
subscription = Subscription.from_dict(
|
||||
config=music_audio_config,
|
||||
preset_name="multiple_songs_test",
|
||||
preset_dict=multiple_songs_preset_dict,
|
||||
preset_dict=youtube_release_preset_dict,
|
||||
)
|
||||
|
||||
transaction_log = subscription.download(dry_run=dry_run)
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@ from ytdl_sub.utils.exceptions import ValidationException
|
|||
@pytest.fixture
|
||||
def yt_album_as_chapters_preset_dict(output_directory):
|
||||
return {
|
||||
"preset": "albums_from_chapters",
|
||||
"preset": "YouTube Full Albums",
|
||||
"format": "worst[ext=mp4]", # download the worst format so it is fast
|
||||
"ytdl_options": {
|
||||
"postprocessor_args": {"ffmpeg": ["-bitexact"]}, # Must add this for reproducibility
|
||||
},
|
||||
"overrides": {
|
||||
"url": "https://www.youtube.com/watch?v=zeR2_YjlXWA",
|
||||
"subscription_value": "https://www.youtube.com/watch?v=zeR2_YjlXWA",
|
||||
"music_directory": output_directory,
|
||||
},
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ class TestSplitByChapters:
|
|||
):
|
||||
subscription = Subscription.from_dict(
|
||||
config=music_audio_config,
|
||||
preset_name="split_by_chapters_video",
|
||||
preset_name="Proved Records",
|
||||
preset_dict=yt_album_as_chapters_preset_dict,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
".ytdl-sub-single_song_test-download-archive.json": "c8ff22ec3304c9f8dab18cedaed4e8b4",
|
||||
"YouTube/[2019] YouTube Rewind 2019: For the Record | #YouTubeRewind/01 - YouTube Rewind 2019: For the Record | #YouTubeRewind.mp3": "33c69b0dce605e9f78fe23246ce442dd",
|
||||
".ytdl-sub-single_song_test-download-archive.json": "f179ccfe0a9b3a76ae62122a3ccb58fd",
|
||||
"YouTube/[2019] YouTube Rewind 2019: For the Record | #YouTubeRewind/01 - YouTube Rewind 2019: For the Record | #YouTubeRewind.m4a": "4b03133e9422a9ce196d271beb15ceef",
|
||||
"YouTube/[2019] YouTube Rewind 2019: For the Record | #YouTubeRewind/folder.jpg": "50ee47c80f679029f5d3503bb91b045a"
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
".ytdl-sub-single_song_test-download-archive.json": "c8ff22ec3304c9f8dab18cedaed4e8b4",
|
||||
"YouTube/[2019] YouTube Rewind 2019: For the Record | #YouTubeRewind/01 - YouTube Rewind 2019: For the Record | #YouTubeRewind.mp3": "37b38834eda1293ad503e00dcff7c4dc",
|
||||
".ytdl-sub-single_song_test-download-archive.json": "f179ccfe0a9b3a76ae62122a3ccb58fd",
|
||||
"YouTube/[2019] YouTube Rewind 2019: For the Record | #YouTubeRewind/01 - YouTube Rewind 2019: For the Record | #YouTubeRewind.m4a": "4b03133e9422a9ce196d271beb15ceef",
|
||||
"YouTube/[2019] YouTube Rewind 2019: For the Record | #YouTubeRewind/folder.jpg": "50ee47c80f679029f5d3503bb91b045a"
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ Files created:
|
|||
{output_directory}
|
||||
.ytdl-sub-single_song_test-download-archive.json
|
||||
{output_directory}/YouTube/[2019] YouTube Rewind 2019: For the Record | #YouTubeRewind
|
||||
01 - YouTube Rewind 2019: For the Record | #YouTubeRewind.mp3
|
||||
01 - YouTube Rewind 2019: For the Record | #YouTubeRewind.m4a
|
||||
Music Tags:
|
||||
album: YouTube Rewind 2019: For the Record | #YouTubeRewind
|
||||
albumartist: YouTube
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Files created:
|
|||
{output_directory}
|
||||
.ytdl-sub-single_song_test-download-archive.json
|
||||
{output_directory}/YouTube/[2019] YouTube Rewind 2019: For the Record | #YouTubeRewind
|
||||
01 - YouTube Rewind 2019: For the Record | #YouTubeRewind.mp3
|
||||
01 - YouTube Rewind 2019: For the Record | #YouTubeRewind.m4a
|
||||
Embedded Thumbnail, Music Tags:
|
||||
album: YouTube Rewind 2019: For the Record | #YouTubeRewind
|
||||
albumartist: YouTube
|
||||
|
|
|
|||
Loading…
Reference in a new issue