Skip to content

Commit

Permalink
Fix soundcloud downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
nathom committed Apr 20, 2021
1 parent bb752a9 commit 36bbcd5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions streamrip/bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion streamrip/tracklists.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 36bbcd5

Please sign in to comment.