Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. def MainMenu():
  2.     oc = ObjectContainer()
  3.  
  4.     # Live stream
  5.     response = JSON.ObjectFromURL(API_PATH + '/chats/?api_key=' + ApiKey() + '&format=json')
  6.     chats = response['results']
  7.  
  8.     for chat in chats:
  9.         url = 'http://www.twitch.tv/' + chat['channel_name']
  10.         try:
  11.             thumb = chat['image']['super_url']
  12.         except:
  13.             thumb = R(ICON)
  14.  
  15.         oc.add(
  16.             VideoClipObject(
  17.                 url=url,
  18.                 title='LIVE: ' + chat['title'],
  19.                 summary=chat['deck'],
  20.                 source_title='Twitch.tv',
  21.                 thumb=thumb,
  22.                 art=R(ART),
  23.                 rating_key=chat['channel_name']
  24.             )
  25.         )
  26.  
  27.     oc.add(
  28.         DirectoryObject(
  29.             key='/video/giantbomb/videos',
  30.             title='Latest',
  31.             summary='Watch the newest stuff.',
  32.             thumb=R(ICON),
  33.             art=R(ART)
  34.         )
  35.     )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement