Optimized FLAC downloading, why didn't I notice that earlier

This commit is contained in:
Dniel97
2022-12-18 14:32:03 +01:00
parent da4e8d4df4
commit 5daa2c6933
2 changed files with 6 additions and 5 deletions

View File

@@ -162,7 +162,7 @@ class ModuleInterface:
def check_subscription(self, subscription: str) -> bool:
# returns true if "disable_subscription_checks" is enabled or subscription is HIFI Plus
if not self.disable_subscription_check and subscription not in {'HIFI', 'PREMIUM_PLUS'}:
self.print(f'{module_information.service_name}: Account is not a HiFi Plus account, '
self.print(f'{module_information.service_name}: Account does not have a HiFi (Plus) subscription, '
f'detected subscription: {subscription}')
return False
return True
@@ -424,10 +424,10 @@ class ModuleInterface:
# check if album is only available in LOSSLESS and STEREO, so it switches to the MOBILE_DEFAULT which will
# get FLACs faster, instead of using MPEG-DASH
# TODO: Can the MOBILE_DEFAULT" be deleted?
# lmao what did I smoke when I wrote this, track_data and not album_data!
if (self.settings['force_non_spatial'] or (
(quality_tier is QualityEnum.LOSSLESS or album_data.get('audioQuality') == 'LOSSLESS')
and album_data.get('audioModes') == ['STEREO'])) and SessionType.MOBILE_DEFAULT.name in self.available_sessions:
(quality_tier is QualityEnum.LOSSLESS or track_data.get('audioQuality') == 'LOSSLESS')
and track_data.get('audioModes') == ['STEREO'])) and SessionType.MOBILE_DEFAULT.name in self.available_sessions:
self.session.default = SessionType.MOBILE_DEFAULT
elif (track_data.get('audioModes') == ['SONY_360RA']
or ('DOLBY_ATMOS' in track_data.get('audioModes') and self.settings['prefer_ac4'])) \

View File

@@ -332,7 +332,8 @@ class TidalSession(ABC):
def get_subscription(self) -> str:
if self.access_token:
r = requests.get('https://api.tidal.com/v1/users/' + str(self.user_id) + '/subscription',
r = requests.get(f'https://api.tidal.com/v1/users/{self.user_id}/subscription',
params={'countryCode': self.country_code},
headers=self.auth_headers())
if r.status_code != 200:
raise TidalAuthError(r.json()['userMessage'])