diff options
| author | Robert Honz <exislow+github@gmail.com> | 2025-01-03 16:06:13 +0100 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2025-01-03 16:06:13 +0100 |
| commit | 5012c5d4de84e0c8f05377029f63e4cc6e9ad53a (patch) | |
| tree | bd6e85393908239351ea885675e283d1c8ff3e4c /tidal_dl_ng | |
| parent | 73408b4730199b7c13f1948cb81ccfd0cab14717 (diff) | |
| download | tidal-dl-ng-5012c5d4de84e0c8f05377029f63e4cc6e9ad53a.tar.gz | |
👷 Moved to maintained `python-ffmpeg`.
Diffstat (limited to 'tidal_dl_ng')
| -rw-r--r-- | tidal_dl_ng/download.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index e02d0cd..6175e4c 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -8,7 +8,7 @@ from collections.abc import Callable from concurrent import futures from uuid import uuid4 -import ffmpeg +from ffmpeg import FFmpeg import m3u8 import requests from requests.adapters import HTTPAdapter, Retry @@ -762,29 +762,33 @@ class Download: def _video_convert(self, path_file: pathlib.Path) -> pathlib.Path: path_file_out: pathlib.Path = path_file.with_suffix(AudioExtensions.MP4) - result, _ = ( - ffmpeg.input(path_file) - .output(str(path_file_out), map=0, c="copy", loglevel="quiet") - .run(cmd=self.settings.data.path_binary_ffmpeg) + ffmpeg = ( + FFmpeg(executable=self.settings.data.path_binary_ffmpeg) + .option("y") + .input(url=path_file) + .output(url=path_file_out, codec="copy", map=0, loglevel="quiet") ) + ffmpeg.execute() + return path_file_out def _extract_flac(self, path_media_src: pathlib.Path) -> pathlib.Path: path_media_out = path_media_src.with_suffix(AudioExtensions.FLAC) - result, _ = ( - ffmpeg.input(path_media_src) + ffmpeg = ( + FFmpeg(executable=self.settings.data.path_binary_ffmpeg) + .input(url=path_media_src) .output( - str(path_media_out), - map=0, + url=path_media_out, map=0, movflags="use_metadata_tags", acodec="copy", map_metadata="0:g", - loglevel="quiet", + loglevel="quiet" ) - .run(cmd=self.settings.data.path_binary_ffmpeg) ) + ffmpeg.execute() + return path_media_out def _extract_video_stream(self, m3u8_variant: m3u8.M3U8, quality: int) -> (m3u8.M3U8 | bool, str): |
