mirror of
https://github.com/nathom/streamrip.git
synced 2024-09-19 11:18:45 -04:00
Merge pull request #299 from aberfan/main
Fixes BUG: search track on tidal fails with AttributeError #291, maybe others.
This commit is contained in:
commit
76a99deccb
4 changed files with 39 additions and 9 deletions
17
.github/stale.yml
vendored
Normal file
17
.github/stale.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 60
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
10
README.md
10
README.md
|
@ -20,7 +20,7 @@ A scriptable stream downloader for Qobuz, Tidal, Deezer and SoundCloud.
|
|||
|
||||
## Installation
|
||||
|
||||
First, ensure [Python](https://www.python.org/downloads/) (version 3.8 or greater) and [pip](https://pip.pypa.io/en/stable/installing/) are installed. Then run the following in the command line:
|
||||
First, ensure [Python](https://www.python.org/downloads/) (version 3.8 or greater) and [pip](https://pip.pypa.io/en/stable/installing/) are installed. If you are on Windows, install [Microsoft Visual C++ Tools](https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170). Then run the following in the command line:
|
||||
|
||||
```bash
|
||||
pip3 install streamrip --upgrade
|
||||
|
@ -178,3 +178,11 @@ Thanks to Vitiko98, Sorrow446, and DashLt for their contributions to this projec
|
|||
|
||||
|
||||
I will not be responsible for how you use `streamrip`. By using `streamrip`, you agree to the terms and conditions of the Qobuz, Tidal, and Deezer APIs.
|
||||
|
||||
## Donations/Sponsorship
|
||||
|
||||
<a href="https://www.buymeacoffee.com/nathom" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
|
||||
|
||||
|
||||
Consider contributing some funds [here](https://www.buymeacoffee.com/nathom), which will go towards holding
|
||||
the premium subscriptions that I need to debug and improve streamrip. Thanks for your support!
|
||||
|
|
|
@ -659,20 +659,20 @@ class Track(Media):
|
|||
audio[k] = v
|
||||
|
||||
if embed_cover and cover is None:
|
||||
assert hasattr(self, "cover_path")
|
||||
cover = Tracklist.get_cover_obj(
|
||||
self.cover_path, self.container, self.client.source
|
||||
)
|
||||
) if hasattr(self,"cover_path") else None
|
||||
|
||||
if isinstance(audio, FLAC):
|
||||
if embed_cover:
|
||||
if embed_cover and cover:
|
||||
audio.add_picture(cover)
|
||||
audio.save()
|
||||
elif isinstance(audio, ID3):
|
||||
if embed_cover:
|
||||
if embed_cover and cover:
|
||||
audio.add(cover)
|
||||
audio.save(self.path, "v2_version=3")
|
||||
elif isinstance(audio, MP4):
|
||||
if cover:
|
||||
audio["covr"] = [cover]
|
||||
audio.save()
|
||||
else:
|
||||
|
@ -1530,9 +1530,9 @@ class Album(Tracklist, Media):
|
|||
kwargs.get("max_artwork_width", 1e9),
|
||||
kwargs.get("max_artwork_height", 1e9),
|
||||
),
|
||||
)
|
||||
) if self.cover_urls else None
|
||||
|
||||
if kwargs.get("embed_cover", True): # embed by default
|
||||
if cover_path and kwargs.get("embed_cover", True): # embed by default
|
||||
logger.debug("Getting cover_obj from %s", cover_path)
|
||||
# container generated when formatting folder name
|
||||
self.cover_obj = self.get_cover_obj(
|
||||
|
|
|
@ -179,6 +179,9 @@ def tidal_cover_url(uuid, size):
|
|||
possibles = (80, 160, 320, 640, 1280)
|
||||
assert size in possibles, f"size must be in {possibles}"
|
||||
|
||||
# A common occurance is a valid size but no uuid
|
||||
if not uuid:
|
||||
return None
|
||||
return TIDAL_COVER_URL.format(uuid=uuid.replace("-", "/"), height=size, width=size)
|
||||
|
||||
|
||||
|
@ -335,6 +338,8 @@ def get_cover_urls(resp: dict, source: str) -> dict:
|
|||
|
||||
if source == "tidal":
|
||||
uuid = resp["cover"]
|
||||
if not uuid:
|
||||
return None
|
||||
return {
|
||||
sk: tidal_cover_url(uuid, size)
|
||||
for sk, size in zip(COVER_SIZES, (160, 320, 640, 1280))
|
||||
|
|
Loading…
Reference in a new issue