From 36bbcd5ca1ba42260e7028940e8835b14f9ca3d0 Mon Sep 17 00:00:00 2001 From: nathom Date: Mon, 19 Apr 2021 22:36:32 -0700 Subject: [PATCH] Fix soundcloud downloads --- streamrip/bases.py | 7 +++++-- streamrip/tracklists.py | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/streamrip/bases.py b/streamrip/bases.py index f53ef247..a9141bd8 100644 --- a/streamrip/bases.py +++ b/streamrip/bases.py @@ -219,7 +219,7 @@ def download( return False elif self.client.source == "soundcloud": - self._soundcloud_download(dl_info, self.path) + self._soundcloud_download(dl_info) else: raise InvalidSourceError(self.client.source) @@ -765,7 +765,10 @@ def download(self, **kwargs): else: for item in self: - click.secho(f'\nDownloading "{item!s}"', fg="blue") + 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") target(item, **kwargs) self.downloaded = True diff --git a/streamrip/tracklists.py b/streamrip/tracklists.py index 631d81e5..71efc58d 100644 --- a/streamrip/tracklists.py +++ b/streamrip/tracklists.py @@ -373,7 +373,7 @@ def gen_cover(track): elif self.client.source == "soundcloud": 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"] tracklist = self.meta["tracks"] @@ -415,8 +415,10 @@ def _prepare_download(self, parent_folder: str = "StreamripDownloads", **kwargs) self.download_message() def _download_item(self, item: Track, **kwargs): + kwargs['parent_folder'] = self.folder if self.client.source == "soundcloud": item.load_meta() + click.secho(f"Downloading {item!s}", fg='blue') if kwargs.get("set_playlist_to_album", False): item["album"] = self.name