fixed issues from version parity

This commit is contained in:
RemixDev 2021-12-23 19:25:45 +01:00
parent 6b41e6cb0a
commit eb84a392ba
No known key found for this signature in database
GPG Key ID: B33962B465BDB51C
3 changed files with 7 additions and 2 deletions

View File

@ -112,7 +112,11 @@ def getPreferredBitrate(dz, track, preferredBitrate, shouldFallback, feelingLuck
nonlocal wrongLicense, isGeolocked
url = None
# Check the track with the legit method
if formatName.lower() in track.filesizes and track.filesizes[formatName.lower()] != "0":
wrongLicense = (
(formatName == "FLAC" or formatName.startswidth("MP4_RA")) and not dz.current_user.get('can_stream_lossless') or \
formatName == "MP3_320" and not dz.current_user.get('can_stream_hq')
)
if track.filesizes.get(formatName.lower()) and track.filesizes[formatName.lower()] != "0":
try:
url = dz.get_track_url(track.trackToken, formatName)
except (WrongLicense, WrongGeolocation) as e:

View File

@ -91,7 +91,7 @@ class Album:
self.date.year = release_date[0:4]
self.date.fixDayMonth()
self.discTotal = albumAPI.get('nb_disk')
self.discTotal = albumAPI.get('nb_disk', "1")
self.copyright = albumAPI.get('copyright')
if self.pic.md5 == "":

View File

@ -63,6 +63,7 @@ class Track:
self.trackTokenExpiration = trackAPI['track_token_expire']
self.MD5 = trackAPI.get('md5_origin')
self.mediaVersion = trackAPI['media_version']
self.filesizes = trackAPI['filesizes']
self.fallbackID = "0"
if 'fallback_id' in trackAPI:
self.fallbackID = trackAPI['fallback_id']