From 733b281b034544ff80f5abdfe177854b19233030 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Fri, 27 Oct 2023 22:52:45 -0700 Subject: [PATCH] bitexact on video tags --- src/ytdl_sub/utils/ffmpeg.py | 2 +- tests/e2e/plugins/test_file_convert.py | 2 +- .../plugins/file_convert/output.json | 2 +- .../plugins/file_convert/output_custom_ffmpeg.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ytdl_sub/utils/ffmpeg.py b/src/ytdl_sub/utils/ffmpeg.py index a3aa75b3..6d16814d 100644 --- a/src/ytdl_sub/utils/ffmpeg.py +++ b/src/ytdl_sub/utils/ffmpeg.py @@ -202,7 +202,7 @@ def add_ffmpeg_metadata_key_values(file_path: str, key_values: Dict[str, str]) - ] for key, value in key_values.items(): ffmpeg_args.extend(["-metadata", f"{key}={value}"]) - ffmpeg_args.extend(["-codec", "copy", tmp_file_path]) + ffmpeg_args.extend(["-codec", "copy", "-bitexact", tmp_file_path]) FFMPEG.run(ffmpeg_args) FileHandler.move(tmp_file_path, file_path) diff --git a/tests/e2e/plugins/test_file_convert.py b/tests/e2e/plugins/test_file_convert.py index 4723d64e..e3832172 100644 --- a/tests/e2e/plugins/test_file_convert.py +++ b/tests/e2e/plugins/test_file_convert.py @@ -12,7 +12,7 @@ def preset_dict(output_directory): "preset": "Jellyfin Music Videos", "download": "https://www.youtube.com/watch?v=2zYF9JLHDmA", "output_options": {"output_directory": output_directory}, - "format": "worst[ext=mp4]", # download the worst format so it is fast + "format": "best[ext=mp4]", # download the worst format so it is fast "ytdl_options": { "postprocessor_args": {"ffmpeg": ["-bitexact"]}, # Must add this for reproducibility }, diff --git a/tests/resources/expected_downloads_summaries/plugins/file_convert/output.json b/tests/resources/expected_downloads_summaries/plugins/file_convert/output.json index 0dd8606d..e671b0c2 100644 --- a/tests/resources/expected_downloads_summaries/plugins/file_convert/output.json +++ b/tests/resources/expected_downloads_summaries/plugins/file_convert/output.json @@ -1,6 +1,6 @@ { ".ytdl-sub-file_convert_test-download-archive.json": "f720289a704349fbe38ef5ed451af724", "file_convert_test/When you hear Hugh Jackman is returning as Wolverine in Deadpool 3.jpg": "662fcaadf6e80d63591bac19a5fdffb0", - "file_convert_test/When you hear Hugh Jackman is returning as Wolverine in Deadpool 3.mp4": "21d860268f6a27f4ec65d8278ee7b229", + "file_convert_test/When you hear Hugh Jackman is returning as Wolverine in Deadpool 3.mp4": "14ebeb4b5d4e283701530e61c741598b", "file_convert_test/When you hear Hugh Jackman is returning as Wolverine in Deadpool 3.nfo": "752e6b6eea853c8a1f62faa4b841b292" } \ No newline at end of file diff --git a/tests/resources/expected_downloads_summaries/plugins/file_convert/output_custom_ffmpeg.json b/tests/resources/expected_downloads_summaries/plugins/file_convert/output_custom_ffmpeg.json index 7dafd51a..b04173d0 100644 --- a/tests/resources/expected_downloads_summaries/plugins/file_convert/output_custom_ffmpeg.json +++ b/tests/resources/expected_downloads_summaries/plugins/file_convert/output_custom_ffmpeg.json @@ -1,6 +1,6 @@ { ".ytdl-sub-file_convert_test-download-archive.json": "8fa4bf42c9686f8520ce107e48b73215", "file_convert_test/When you hear Hugh Jackman is returning as Wolverine in Deadpool 3.jpg": "662fcaadf6e80d63591bac19a5fdffb0", - "file_convert_test/When you hear Hugh Jackman is returning as Wolverine in Deadpool 3.mkv": "c354b9d9f542bc1762b7103adbf56ee6", + "file_convert_test/When you hear Hugh Jackman is returning as Wolverine in Deadpool 3.mkv": "5a59b7454a7d7a07ef27fec438ba8e21", "file_convert_test/When you hear Hugh Jackman is returning as Wolverine in Deadpool 3.nfo": "752e6b6eea853c8a1f62faa4b841b292" } \ No newline at end of file