Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
Use get_audio_properties instead of mutagen (#674)
Arkadiy Illarionovd6168ee143ac
diff --git a/.gitignore b/.gitignoreindex 2c4681f05..1866efcbe 100644--- a/.gitignore+++ b/.gitignore@@ -3,3 +3,6 @@/Test-AppData-Dir//AppData//Downloads/++# Python cache+__pycache__diff --git a/cyberdrop_dl/utils/sorting.py b/cyberdrop_dl/utils/sorting.pyindex cc7052776..2169d5c19 100644--- a/cyberdrop_dl/utils/sorting.py+++ b/cyberdrop_dl/utils/sorting.py@@ -3,11 +3,10 @@ import itertoolsfrom pathlib import Pathfrom typing import TYPE_CHECKING-import mutagen-from videoprops import get_video_propertiesfrom PIL import Image+from videoprops import get_audio_properties, get_video_properties-from cyberdrop_dl.utils.utilities import FILE_FORMATS, purge_dir, log_with_color+from cyberdrop_dl.utils.utilities import FILE_FORMATS, log_with_color, purge_dirif TYPE_CHECKING:from cyberdrop_dl.managers.manager import Manager@@ -88,10 +87,10 @@ class Sorter:"""Sorts an audio file into the sorted audio folder"""self.audio_count += 1- file_info = mutagen.File(file).info- length = file_info.length- bitrate = file_info.bitrate- sample_rate = file_info.sample_rate+ props = get_audio_properties(str(file))+ length = str(props['duration'])+ bitrate = str(props['bit_rate'])+ sample_rate = str(props['sample_rate'])parent_name = file.parent.namefilename, ext = file.stem, file.suffix