mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-20 02:05:41 -04:00
Fix #139
This commit is contained in:
parent
767e3c844e
commit
2980a2a722
3 changed files with 1189 additions and 1185 deletions
|
@ -534,7 +534,7 @@ class DeezerClient(Client):
|
||||||
dl_info["fallback_id"] = safe_get(track_info, "FALLBACK", "SNG_ID")
|
dl_info["fallback_id"] = safe_get(track_info, "FALLBACK", "SNG_ID")
|
||||||
|
|
||||||
format_info = get_quality(quality, "deezer")
|
format_info = get_quality(quality, "deezer")
|
||||||
assert isinstance(format_info, tuple)
|
assert isinstance(format_info, tuple) # for typing
|
||||||
format_no, format_str = format_info
|
format_no, format_str = format_info
|
||||||
|
|
||||||
dl_info["size_to_quality"] = {
|
dl_info["size_to_quality"] = {
|
||||||
|
|
|
@ -1561,6 +1561,8 @@ class Album(Tracklist, Media):
|
||||||
)
|
)
|
||||||
if stat1 is not None and stat2 is not None
|
if stat1 is not None and stat2 is not None
|
||||||
)
|
)
|
||||||
|
logger.debug("Sampling rate, bit depth = %s", stats)
|
||||||
|
|
||||||
if not stats:
|
if not stats:
|
||||||
stats = (None, None)
|
stats = (None, None)
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ class TrackMetadata:
|
||||||
:type album: Optional[dict]
|
:type album: Optional[dict]
|
||||||
"""
|
"""
|
||||||
# embedded information
|
# embedded information
|
||||||
|
# TODO: add this to static attrs
|
||||||
self.title: str
|
self.title: str
|
||||||
self.album: str
|
self.album: str
|
||||||
self.albumartist: str
|
self.albumartist: str
|
||||||
|
@ -193,13 +194,14 @@ class TrackMetadata:
|
||||||
self.albumartist = safe_get(resp, "artist", "name")
|
self.albumartist = safe_get(resp, "artist", "name")
|
||||||
self.label = resp.get("label")
|
self.label = resp.get("label")
|
||||||
self.url = resp.get("link")
|
self.url = resp.get("link")
|
||||||
|
self.explicit = bool(resp.get("parental_warning"))
|
||||||
|
|
||||||
# not embedded
|
# not embedded
|
||||||
self.explicit = bool(resp.get("parental_warning"))
|
|
||||||
self.quality = 2
|
self.quality = 2
|
||||||
self.bit_depth = None
|
self.bit_depth = 16
|
||||||
|
self.sampling_rate = 44100
|
||||||
|
|
||||||
self.cover_urls = get_cover_urls(resp, self.__source)
|
self.cover_urls = get_cover_urls(resp, self.__source)
|
||||||
self.sampling_rate = None
|
|
||||||
self.streamable = True
|
self.streamable = True
|
||||||
|
|
||||||
elif self.__source == "soundcloud":
|
elif self.__source == "soundcloud":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue