diff --git a/poetry.lock b/poetry.lock index 5386a73..f66f37a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -675,18 +675,15 @@ files = [ [[package]] name = "isodate" -version = "0.6.1" +version = "0.7.2" description = "An ISO 8601 date/time/duration parser and formatter" optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "isodate-0.6.1-py2.py3-none-any.whl", hash = "sha256:0751eece944162659049d35f4f549ed815792b38793f07cf73381c1c87cbed96"}, - {file = "isodate-0.6.1.tar.gz", hash = "sha256:48c5881de7e8b0a0d648cb024c8062dc84e7b840ed81e864c7614fd3c127bde9"}, + {file = "isodate-0.7.2-py3-none-any.whl", hash = "sha256:28009937d8031054830160fce6d409ed342816b543597cece116d966c6d99e15"}, + {file = "isodate-0.7.2.tar.gz", hash = "sha256:4cd1aa0f43ca76f4a6c6c0292a85f40b35ec2e43e315b59f06e6d32171a953e6"}, ] -[package.dependencies] -six = "*" - [[package]] name = "isort" version = "5.13.2" @@ -2023,22 +2020,22 @@ pbr = ">=2.0.0" [[package]] name = "tidalapi" -version = "0.7.6" +version = "0.8.0" description = "Unofficial API for TIDAL music streaming service." optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "tidalapi-0.7.6-py3-none-any.whl", hash = "sha256:ac9afe91296d2db71381e70470a710c052ce45b5014c4735bd1908ca3938f233"}, - {file = "tidalapi-0.7.6.tar.gz", hash = "sha256:5fa537e13d6c3383fe245a4e7dc23b0a650b7066784825f03f67c51ca8b57161"}, + {file = "tidalapi-0.8.0-py3-none-any.whl", hash = "sha256:114b8cf127bb9d6f02796b446f9202571989fbd5c3c62b69b58c43d9ada77e38"}, + {file = "tidalapi-0.8.0.tar.gz", hash = "sha256:da0fca3cb790db6475526d724d868d079554203eb9b0636af7ff60f7e023a690"}, ] [package.dependencies] -isodate = ">=0.6.1,<0.7.0" +isodate = ">=0.7.2,<0.8.0" mpegdash = ">=0.4.0,<0.5.0" python-dateutil = ">=2.8.2,<3.0.0" ratelimit = ">=2.2.1,<3.0.0" -requests = ">=2.28.0,<3.0.0" -typing-extensions = ">=4.10.0,<5.0.0" +requests = ">=2.32.3,<3.0.0" +typing-extensions = ">=4.12.2,<5.0.0" [[package]] name = "tokenize-rt" @@ -2239,4 +2236,4 @@ gui = ["pyqtdarktheme-fork", "pyside6"] [metadata] lock-version = "2.0" python-versions = ">=3.10,<3.13" -content-hash = "15808a09d378226205d3abaa3aa116ba8579e092e875ef2855c87912c36e5918" +content-hash = "92af866c0916091be26c50790b79c210f70a939fc8c89c9e44857d30b76bc7bd" diff --git a/pyproject.toml b/pyproject.toml index d11b76a..74fe3ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,6 @@ python = ">=3.10,<3.13" requests = "~2.32.3" mutagen = "^1.47.0" pycryptodome = "^3.21.0" -tidalapi = "~0.8.0" dataclasses-json = "^0.6.7" pathvalidate = "^3.2.1" m3u8 = "^6.0.0" @@ -41,6 +40,7 @@ rich = "^13.9.4" toml = "^0.10.2" typer = "^0.12.5" ffmpeg-python = "^0.2.0" +tidalapi = "^0.8.0" [tool.poetry.extras] gui = ["pyside6", "pyqtdarktheme-fork"] diff --git a/tidal_dl_ng/dialog.py b/tidal_dl_ng/dialog.py index cfd4e24..23f1dc8 100644 --- a/tidal_dl_ng/dialog.py +++ b/tidal_dl_ng/dialog.py @@ -171,7 +171,6 @@ class DialogPreferences(QtWidgets.QDialog): "download_delay", "video_convert_mp4", "extract_flac", - "downgrade_on_hi_res", ] def gui_populate(self): diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index d6b9e15..9bab8e5 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -211,10 +211,6 @@ class Download: file_extension: str if isinstance(media, Track): - # If hi_res is forbidden in settings and highest track quality is hi_res, downgrade to high_lossless. - if self.settings.data.downgrade_on_hi_res and media.get_stream().audio_quality == Quality.hi_res: - quality_audio = Quality.high_lossless - # If a quality is explicitly set, change it. if quality_audio: quality_audio_old: Quality = self.adjust_quality_audio(quality_audio) diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py index 65429f9..55e2b97 100644 --- a/tidal_dl_ng/gui.py +++ b/tidal_dl_ng/gui.py @@ -618,7 +618,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): if ( self.settings.data.quality_audio == quality_highest or self.settings.data.quality_audio == Quality.hi_res_lossless - or (self.settings.data.quality_audio == Quality.hi_res and quality_highest == Quality.hi_res) ): quality = quality_highest else: diff --git a/tidal_dl_ng/helper/decryption.py b/tidal_dl_ng/helper/decryption.py index 2fa2ec0..ebb946a 100644 --- a/tidal_dl_ng/helper/decryption.py +++ b/tidal_dl_ng/helper/decryption.py @@ -37,7 +37,8 @@ def decrypt_security_token(security_token: str) -> (str, str): def decrypt_file(path_file_encrypted: str, path_file_destination: str, key: str, nonce: str) -> None: """ - Decrypts an encrypted MQA file given the file, key and nonce + Decrypts an encrypted MQA file given the file, key and nonce. + TODO: Is it really only necessary for MQA of for all other formats, too? """ # Initialize counter and file decryptor diff --git a/tidal_dl_ng/helper/tidal.py b/tidal_dl_ng/helper/tidal.py index aec5320..a85b7f3 100644 --- a/tidal_dl_ng/helper/tidal.py +++ b/tidal_dl_ng/helper/tidal.py @@ -188,8 +188,6 @@ def quality_audio_highest(media: Track | Album) -> Quality: if MediaMetadataTags.hires_lossless in media.media_metadata_tags: quality = Quality.hi_res_lossless - elif MediaMetadataTags.mqa in media.media_metadata_tags: - quality = Quality.hi_res elif MediaMetadataTags.lossless in media.media_metadata_tags: quality = Quality.high_lossless else: diff --git a/tidal_dl_ng/model/cfg.py b/tidal_dl_ng/model/cfg.py index bda0ae9..17a8464 100644 --- a/tidal_dl_ng/model/cfg.py +++ b/tidal_dl_ng/model/cfg.py @@ -36,7 +36,6 @@ class Settings: path_binary_ffmpeg: str = "" metadata_cover_dimension: CoverDimensions = CoverDimensions.Px320 extract_flac: bool = True - downgrade_on_hi_res: bool = False @dataclass_json @@ -59,7 +58,7 @@ class HelpSettings: quality_audio: str = ( 'Desired audio download quality: "LOW" (96kbps), "HIGH" (320kbps), ' '"LOSSLESS" (16 Bit, 44,1 kHz), ' - '"HI_RES" (MQA 24 Bit, 96 kHz), "HI_RES_LOSSLESS" (up to 24 Bit, 192 kHz)' + '"HI_RES_LOSSLESS" (up to 24 Bit, 192 kHz)' ) quality_video: str = 'Desired video download quality: "360", "480", "720", "1080"' # TODO: Describe possible variables. @@ -80,9 +79,6 @@ class HelpSettings: "The dimensions of the cover image embedded into the track. Possible values: 320x320, 640x640x 1280x1280." ) extract_flac: str = "Extract FLAC audio tracks from MP4 containers and save them as `*.flac` (uses FFmpeg)." - downgrade_on_hi_res: bool = ( - "Never download HI_RES (MQA) quality. Downgrade to the next best available quality instead." - ) @dataclass_json diff --git a/tidal_dl_ng/ui/dialog_settings.py b/tidal_dl_ng/ui/dialog_settings.py index 3f45cea..15ac0fe 100644 --- a/tidal_dl_ng/ui/dialog_settings.py +++ b/tidal_dl_ng/ui/dialog_settings.py @@ -1,7 +1,7 @@ ################################################################################ ## Form generated from reading UI file 'dialog_settings.ui' ## -## Created by: Qt User Interface Compiler version 6.7.0 +## Created by: Qt User Interface Compiler version 6.8.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ @@ -26,7 +26,7 @@ class Ui_DialogSettings: def setupUi(self, DialogSettings): if not DialogSettings.objectName(): DialogSettings.setObjectName("DialogSettings") - DialogSettings.resize(640, 682) + DialogSettings.resize(640, 705) sizePolicy = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding) sizePolicy.setHorizontalStretch(100) sizePolicy.setVerticalStretch(100) @@ -131,19 +131,6 @@ class Ui_DialogSettings: self.lv_flags.addLayout(self.lh_flag_3) - self.horizontalLayout = QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.lv_flag_downgrade_on_hi_res = QVBoxLayout() - self.lv_flag_downgrade_on_hi_res.setObjectName("lv_flag_downgrade_on_hi_res") - self.cb_downgrade_on_hi_res = QCheckBox(self.gb_flags) - self.cb_downgrade_on_hi_res.setObjectName("cb_downgrade_on_hi_res") - - self.lv_flag_downgrade_on_hi_res.addWidget(self.cb_downgrade_on_hi_res) - - self.horizontalLayout.addLayout(self.lv_flag_downgrade_on_hi_res) - - self.lv_flags.addLayout(self.horizontalLayout) - self.lv_main.addWidget(self.gb_flags) self.gb_choices = QGroupBox(DialogSettings) @@ -235,7 +222,7 @@ class Ui_DialogSettings: self.lh_choices_cover_dimension = QHBoxLayout() self.lh_choices_cover_dimension.setObjectName("lh_choices_cover_dimension") - self.lh_choices_cover_dimension.setSizeConstraint(QLayout.SetDefaultConstraint) + self.lh_choices_cover_dimension.setSizeConstraint(QLayout.SizeConstraint.SetDefaultConstraint) self.l_icon_metadata_cover_dimension = QLabel(self.gb_choices) self.l_icon_metadata_cover_dimension.setObjectName("l_icon_metadata_cover_dimension") sizePolicy4.setHeightForWidth(self.l_icon_metadata_cover_dimension.sizePolicy().hasHeightForWidth()) @@ -494,8 +481,8 @@ class Ui_DialogSettings: self.bb_dialog = QDialogButtonBox(DialogSettings) self.bb_dialog.setObjectName("bb_dialog") - self.bb_dialog.setOrientation(Qt.Horizontal) - self.bb_dialog.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) + self.bb_dialog.setOrientation(Qt.Orientation.Horizontal) + self.bb_dialog.setStandardButtons(QDialogButtonBox.StandardButton.Cancel | QDialogButtonBox.StandardButton.Ok) self.lv_main.addWidget(self.bb_dialog) @@ -521,7 +508,6 @@ class Ui_DialogSettings: self.cb_lyrics_file.setText(QCoreApplication.translate("DialogSettings", "CheckBox", None)) self.cb_download_delay.setText(QCoreApplication.translate("DialogSettings", "CheckBox", None)) self.cb_extract_flac.setText(QCoreApplication.translate("DialogSettings", "CheckBox", None)) - self.cb_downgrade_on_hi_res.setText(QCoreApplication.translate("DialogSettings", "CheckBox", None)) self.gb_choices.setTitle(QCoreApplication.translate("DialogSettings", "Choices", None)) self.l_icon_skip_existing.setText(QCoreApplication.translate("DialogSettings", "TextLabel", None)) self.l_skip_existing.setText(QCoreApplication.translate("DialogSettings", "TextLabel", None)) diff --git a/tidal_dl_ng/ui/dialog_settings.ui b/tidal_dl_ng/ui/dialog_settings.ui index 962a19f..da0fc4a 100644 --- a/tidal_dl_ng/ui/dialog_settings.ui +++ b/tidal_dl_ng/ui/dialog_settings.ui @@ -7,7 +7,7 @@ 0 0 640 - 682 + 705 @@ -184,21 +184,6 @@ - - - - - - - - CheckBox - - - - - - - @@ -316,7 +301,7 @@ - QLayout::SetDefaultConstraint + QLayout::SizeConstraint::SetDefaultConstraint @@ -679,10 +664,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok