From e8d0c25eee25d4b3069108484b99fa1f85df04a9 Mon Sep 17 00:00:00 2001 From: Twentysix Date: Sat, 14 May 2016 04:03:42 +0200 Subject: [PATCH] Fixed !playlist add for soundcloud --- cogs/audio.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cogs/audio.py b/cogs/audio.py index c2204650b..1251a18fd 100644 --- a/cogs/audio.py +++ b/cogs/audio.py @@ -575,12 +575,14 @@ class Audio: await asyncio.sleep(0.5) for entry in d.song.entries: - if entry.url[4] != "s": - song_url = "https{}".format(entry.url[4:]) + if entry["url"][4] != "s": + song_url = "https{}".format(entry["url"][4:]) playlist.append(song_url) else: playlist.append(entry.url) + return playlist + async def _parse_yt_playlist(self, url): d = Downloader(url) d.start() @@ -1122,7 +1124,7 @@ class Audio: if self._valid_playable_url(url): try: - await self.bot.say("Enumerating song list...this could take" + await self.bot.say("Enumerating song list... This could take" " a few moments.") songlist = await self._parse_playlist(url) except InvalidPlaylist: @@ -1136,7 +1138,8 @@ class Audio: playlist.server = server self._save_playlist(server, name, playlist) - await self.bot.say("Playlist '{}' saved.".format(name)) + await self.bot.say("Playlist '{}' saved. Tracks: {}".format(name, + len(songlist))) else: await self.bot.say("That URL is not a valid Soundcloud or YouTube" " playlist link. If you think this is in error"