ps_vue.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:plugin.video.psvue 作者: eracknaphobia 项目源码 文件源码
def list_timeline():
    url = 'https://sentv-user-ext.totsuko.tv/sentv_user_ext/ws/v2/profile/'

    json_source = get_json(url + PROF_ID)

    if 'body' in json_source and 'watch_history' in json_source['body']:
        watch_history = json_source['body']['watch_history']
        air_dict = {}
        air_list = []
        for airing in watch_history:
            xbmc.log(str(airing['airing_id']) + ' ' + str(airing['last_watch_date']))
            air_dict[str(airing['last_watch_date'])] = str(airing['airing_id'])
            air_list.append(str(airing['last_watch_date']))

    else:
        dialog.notification('No airing ID found', msg, xbmcgui.NOTIFICATION_INFO, 9000)
        sys.exit()

    json_source = get_json(EPG_URL + '/timeline/' + air_dict[air_list[0]])

    for strand in json_source['body']['strands']:
        if strand['id'] == 'now_playing':
            addDir('[B][I][COLOR=FFFFFF66]Now Playing[/COLOR][/B][/I]', 998, ICON)
            for program in strand['programs']:
                list_episode(program)
        elif strand['id'] == 'watched_episodes':
            addDir('[B][I][COLOR=FFFFFF66]Watched Episodes[/COLOR][/B][/I]', 998, ICON)
            for program in reversed(strand['programs']):
                list_episode(program)
        elif strand['id'] == 'coming_up':
            addDir('[B][I][COLOR=FFFFFF66]Coming Up On Channel:[/COLOR][/B][/I]'+'      '+strand['programs'][0]['channel']['name_short'], 998, ICON)
            for program in strand['programs']:
                list_episode(program)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号