mirror of
https://github.com/nathom/streamrip.git
synced 2025-05-14 07:04:51 -04:00
Fix soundcloud downloads
This commit is contained in:
parent
bb752a9121
commit
36bbcd5ca1
2 changed files with 8 additions and 3 deletions
|
@ -219,7 +219,7 @@ class Track:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
elif self.client.source == "soundcloud":
|
elif self.client.source == "soundcloud":
|
||||||
self._soundcloud_download(dl_info, self.path)
|
self._soundcloud_download(dl_info)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise InvalidSourceError(self.client.source)
|
raise InvalidSourceError(self.client.source)
|
||||||
|
@ -765,6 +765,9 @@ class Tracklist(list):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for item in self:
|
for item in self:
|
||||||
|
if self.client.source != 'soundcloud':
|
||||||
|
# soundcloud only gets metadata after `target` is called
|
||||||
|
# message will be printed in `target`
|
||||||
click.secho(f'\nDownloading "{item!s}"', fg="blue")
|
click.secho(f'\nDownloading "{item!s}"', fg="blue")
|
||||||
target(item, **kwargs)
|
target(item, **kwargs)
|
||||||
|
|
||||||
|
|
|
@ -373,7 +373,7 @@ class Playlist(Tracklist):
|
||||||
|
|
||||||
elif self.client.source == "soundcloud":
|
elif self.client.source == "soundcloud":
|
||||||
self.name = self.meta["title"]
|
self.name = self.meta["title"]
|
||||||
self.image = self.meta.get("artwork_url").replace("large", "t500x500")
|
# self.image = self.meta.get("artwork_url").replace("large", "t500x500")
|
||||||
self.creator = self.meta["user"]["username"]
|
self.creator = self.meta["user"]["username"]
|
||||||
tracklist = self.meta["tracks"]
|
tracklist = self.meta["tracks"]
|
||||||
|
|
||||||
|
@ -415,8 +415,10 @@ class Playlist(Tracklist):
|
||||||
self.download_message()
|
self.download_message()
|
||||||
|
|
||||||
def _download_item(self, item: Track, **kwargs):
|
def _download_item(self, item: Track, **kwargs):
|
||||||
|
kwargs['parent_folder'] = self.folder
|
||||||
if self.client.source == "soundcloud":
|
if self.client.source == "soundcloud":
|
||||||
item.load_meta()
|
item.load_meta()
|
||||||
|
click.secho(f"Downloading {item!s}", fg='blue')
|
||||||
|
|
||||||
if kwargs.get("set_playlist_to_album", False):
|
if kwargs.get("set_playlist_to_album", False):
|
||||||
item["album"] = self.name
|
item["album"] = self.name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue