From 8990483cdb73e46e7b0a7a26893a2c7e84ee0c7f Mon Sep 17 00:00:00 2001 From: 7x11x13 Date: Sun, 14 Jul 2024 12:41:34 -0400 Subject: [PATCH] Write FLACs to tempfiles --- scdl/__init__.py | 2 +- scdl/scdl.py | 7 ++++--- tests/utils.py | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scdl/__init__.py b/scdl/__init__.py index 98ccd82..b385482 100644 --- a/scdl/__init__.py +++ b/scdl/__init__.py @@ -1,3 +1,3 @@ """Python Soundcloud Music Downloader.""" -__version__ = "v2.11.0" +__version__ = "v2.11.1" diff --git a/scdl/scdl.py b/scdl/scdl.py index d91b447..a155014 100644 --- a/scdl/scdl.py +++ b/scdl/scdl.py @@ -1203,9 +1203,8 @@ def build_ffmpeg_encoding_args( supported = get_ffmpeg_supported_options() ffmpeg_args = [ "ffmpeg", - # Disable all the useless stuff "-loglevel", - "error", + "debug" if kwargs["debug"] else "error", # Input stream "-i", input_file, @@ -1428,7 +1427,7 @@ def _get_ffmpeg_pipe( def _is_unsupported_codec_for_streaming(codec: str) -> bool: - return codec in ("ipod",) + return codec in ("ipod", "flac") def _re_encode_ffmpeg( @@ -1514,6 +1513,8 @@ def read_stdout() -> None: if stdin_thread: stdin_thread.join() + logger.debug(f"FFmpeg output: {errors_output}") + # Make sure that process has exited and get its exit code pipe.wait() if pipe.returncode != 0: diff --git a/tests/utils.py b/tests/utils.py index 48fe316..eaa5847 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -42,6 +42,7 @@ def assert_track( if check_metadata: f = music_tag.load_file(file) + assert f["#length"].value assert f["title"].value == expected_title assert f["artist"].value == expected_artist if expected_genre: