diff --git a/musicbot/audiocontroller.py b/musicbot/audiocontroller.py index b5d09635..1b260653 100644 --- a/musicbot/audiocontroller.py +++ b/musicbot/audiocontroller.py @@ -327,6 +327,7 @@ async def play_song(self, song: Song): before_options="-reconnect 1 -reconnect_streamed 1" " -reconnect_delay_max 5", options="-loglevel error", + stderr=sys.stderr, ), after=self.next_song, ) @@ -351,16 +352,16 @@ async def process_song(self, track: str) -> Optional[Song]: Starts playing if it is the first song""" loaded_song = await loader.load_song(track) - if isinstance(loaded_song, Song): + if not loaded_song: + return None + elif isinstance(loaded_song, Song): self.playlist.add(loaded_song) - elif isinstance(loaded_song, list): + else: for song in loaded_song: self.playlist.add(song) loaded_song = Song( linkutils.Origins.Playlist, linkutils.Sites.Unknown ) - else: - return None if self.current_song is None: print("Playing {}".format(track)) diff --git a/musicbot/linkutils.py b/musicbot/linkutils.py index 3cc856f1..19da22dd 100644 --- a/musicbot/linkutils.py +++ b/musicbot/linkutils.py @@ -99,7 +99,9 @@ async def get_spotify_playlist(url: str) -> list: ) async with aiohttp.ClientSession(headers=headers) as session: - async with session.get(url + "&nd=1") as response: + if "?si=" in url: + url += "&nd=1" + async with session.get(url) as response: page = await response.text() soup = BeautifulSoup(page, "html.parser")