PKCE login is no longer required for HI_RES_LOSSLESS. Fixes #153
This commit is contained in:
@@ -113,13 +113,8 @@ class Tidal(BaseConfig, metaclass=SingletonMeta):
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def login_token(self, do_pkce: bool = True) -> bool:
|
def login_token(self, do_pkce: bool = False) -> bool:
|
||||||
result = False
|
result = False
|
||||||
|
|
||||||
# Do not login via PKCE, if HiRes LOSSLESS is not set as global audio quality.
|
|
||||||
if self.session.audio_quality != tidalapi.media.Quality.hi_res_lossless:
|
|
||||||
do_pkce = False
|
|
||||||
|
|
||||||
self.is_pkce = do_pkce
|
self.is_pkce = do_pkce
|
||||||
|
|
||||||
if self.token_from_storage:
|
if self.token_from_storage:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ from rich.progress import Progress, TaskID
|
|||||||
from tidalapi import Album, Mix, Playlist, Session, Track, UserPlaylist, Video
|
from tidalapi import Album, Mix, Playlist, Session, Track, UserPlaylist, Video
|
||||||
from tidalapi.media import AudioExtensions, Codec, Quality, StreamManifest, VideoExtensions
|
from tidalapi.media import AudioExtensions, Codec, Quality, StreamManifest, VideoExtensions
|
||||||
|
|
||||||
from tidal_dl_ng.config import Settings, Tidal
|
from tidal_dl_ng.config import Settings
|
||||||
from tidal_dl_ng.constants import EXTENSION_LYRICS, REQUESTS_TIMEOUT_SEC, MediaType, QualityVideo, SkipExisting
|
from tidal_dl_ng.constants import EXTENSION_LYRICS, REQUESTS_TIMEOUT_SEC, MediaType, QualityVideo, SkipExisting
|
||||||
from tidal_dl_ng.helper.decryption import decrypt_file, decrypt_security_token
|
from tidal_dl_ng.helper.decryption import decrypt_file, decrypt_security_token
|
||||||
from tidal_dl_ng.helper.exceptions import MediaMissing
|
from tidal_dl_ng.helper.exceptions import MediaMissing
|
||||||
@@ -307,13 +307,6 @@ class Download:
|
|||||||
# Save original quality settings
|
# Save original quality settings
|
||||||
quality_old: Quality = self.session.audio_quality
|
quality_old: Quality = self.session.audio_quality
|
||||||
self.session.audio_quality = quality
|
self.session.audio_quality = quality
|
||||||
tidal: Tidal = Tidal()
|
|
||||||
|
|
||||||
# If track is not requested as hires_lossless do not use PKCE, because BTS downloads are faster than MPD.
|
|
||||||
if quality == Quality.hi_res_lossless and not tidal.is_pkce:
|
|
||||||
tidal.login_token(do_pkce=True)
|
|
||||||
elif quality != Quality.hi_res_lossless and tidal.is_pkce:
|
|
||||||
tidal.login_token(do_pkce=False)
|
|
||||||
|
|
||||||
return quality_old
|
return quality_old
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user