(self, playlistId)
return False
只返回包含其中音乐信息的列表。
只返回包含其中音乐信息的列表。
只返回包含其中音乐信息的列表。
def getRandomSongFromPlaylist(self, playlistId) -> list:
        """
            只返回包含其中音乐信息的列表。
        """
        allSong = self.details_playlist(playlistId)
        if allSong:
            tracks = allSong['tracks']
            SongInfoList = []
            for i in tracks:
                songInfo = SongInfo(music_id=i['id'],
                                    music_img=i['album']['blurPicUrl'],
                                    url="http(0)",
                                    lyric=None,
                                    time=i['duration'],
                                    name=i['name'],
                                    author='-'.join([x['name']
                                                     for x in i['artists']])
                                    )
                SongInfoList.append(songInfo)

            return SongInfoList

        return False
def getRandomSongFromPlaylist ( self , playlistId ) -> list : allSong = self . details_playlist ( playlistId ) if allSong : tracks = allSong [ 'tracks' ] SongInfoList = [ ] for i in tracks : songInfo = SongInfo ( music_id = i [ 'id' ] , music_img = i [ 'album' ] [ 'blurPicUrl' ] , url = "http(0)" , lyric = None , time = i [ 'duration' ] , name = i [ 'name' ] , author = '-' . join ( [ x [ 'name' ] for x in i [ 'artists' ] ] ) ) SongInfoList . append ( songInfo ) return SongInfoList return False