fixed issues from version parity
This commit is contained in:
parent
6b41e6cb0a
commit
eb84a392ba
|
@ -112,7 +112,11 @@ def getPreferredBitrate(dz, track, preferredBitrate, shouldFallback, feelingLuck
|
||||||
nonlocal wrongLicense, isGeolocked
|
nonlocal wrongLicense, isGeolocked
|
||||||
url = None
|
url = None
|
||||||
# Check the track with the legit method
|
# 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:
|
try:
|
||||||
url = dz.get_track_url(track.trackToken, formatName)
|
url = dz.get_track_url(track.trackToken, formatName)
|
||||||
except (WrongLicense, WrongGeolocation) as e:
|
except (WrongLicense, WrongGeolocation) as e:
|
||||||
|
|
|
@ -91,7 +91,7 @@ class Album:
|
||||||
self.date.year = release_date[0:4]
|
self.date.year = release_date[0:4]
|
||||||
self.date.fixDayMonth()
|
self.date.fixDayMonth()
|
||||||
|
|
||||||
self.discTotal = albumAPI.get('nb_disk')
|
self.discTotal = albumAPI.get('nb_disk', "1")
|
||||||
self.copyright = albumAPI.get('copyright')
|
self.copyright = albumAPI.get('copyright')
|
||||||
|
|
||||||
if self.pic.md5 == "":
|
if self.pic.md5 == "":
|
||||||
|
|
|
@ -63,6 +63,7 @@ class Track:
|
||||||
self.trackTokenExpiration = trackAPI['track_token_expire']
|
self.trackTokenExpiration = trackAPI['track_token_expire']
|
||||||
self.MD5 = trackAPI.get('md5_origin')
|
self.MD5 = trackAPI.get('md5_origin')
|
||||||
self.mediaVersion = trackAPI['media_version']
|
self.mediaVersion = trackAPI['media_version']
|
||||||
|
self.filesizes = trackAPI['filesizes']
|
||||||
self.fallbackID = "0"
|
self.fallbackID = "0"
|
||||||
if 'fallback_id' in trackAPI:
|
if 'fallback_id' in trackAPI:
|
||||||
self.fallbackID = trackAPI['fallback_id']
|
self.fallbackID = trackAPI['fallback_id']
|
||||||
|
|
Loading…
Reference in New Issue