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)
评论列表
文章目录