本文整理汇总了Python中api.NetEase.personal_fm方法的典型用法代码示例。如果您正苦于以下问题:Python NetEase.personal_fm方法的具体用法?Python NetEase.personal_fm怎么用?Python NetEase.personal_fm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api.NetEase
的用法示例。
在下文中一共展示了NetEase.personal_fm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from api import NetEase [as 别名]
# 或者: from api.NetEase import personal_fm [as 别名]
#.........这里部分代码省略.........
self.datatype = self.storage.database['player_info']['player_list_type']
self.title = self.storage.database['player_info']['player_list_title']
self.datalist = []
for i in self.storage.database['player_info']['player_list']:
self.datalist.append(self.storage.database['songs'][i])
self.index = self.storage.database['player_info']['idx']
self.offset = self.storage.database['player_info']['idx'] / self.step * self.step
def get_new_fm(self):
if self.userid is None:
if self.storage.database['user']['user_id'] == "":
# 使用本地存储了账户登录
if self.storage.database['user']['username'] != "":
user_info = self.netease.login(self.storage.database['user']['username'],
self.storage.database['user']['password'])
# 本地没有存储账户,或本地账户失效,则引导录入
if self.storage.database['user']['username'] == "" or user_info['code'] != 200:
data = self.ui.build_login()
# 取消登录
if data == -1:
return
user_info = data[0]
self.storage.database['user']['username'] = data[1][0]
self.storage.database['user']['password'] = data[1][1]
self.storage.database['user']['user_id'] = user_info['account']['id']
self.storage.database['user']['nickname'] = user_info['profile']['nickname']
self.username = user_info['profile']['nickname']
self.userid = user_info['account']['id']
else:
self.userid = self.storage.database['user']['user_id']
myplaylist = []
for count in range(0, 1):
myplaylist += self.netease.personal_fm()
time.sleep(0.2)
return self.netease.dig_info(myplaylist, "fmsongs")
def choice_channel(self, idx):
# 排行榜
netease = self.netease
if idx == 0:
self.datalist = netease.return_toplists()
self.title += ' > 排行榜'
self.datatype = 'toplists'
# 艺术家
elif idx == 1:
artists = netease.top_artists()
self.datalist = netease.dig_info(artists, 'artists')
self.title += ' > 艺术家'
self.datatype = 'artists'
# 新碟上架
elif idx == 2:
albums = netease.new_albums()
self.datalist = netease.dig_info(albums, 'albums')
self.title += ' > 新碟上架'
self.datatype = 'albums'
# 精选歌单
elif idx == 3:
self.datalist = [
{
'title': '全站置顶',
'datatype': 'top_playlists',
'callback': netease.top_playlists