def appendDifferentStreams(item): url = item[1] schedule.getEventAtTime(scheduleDb[item[0]]) try: li = xbmcgui.ListItem( ">>> " + item[0] + " " + schedule.getEventAtTime(scheduleDb[item[0]]), iconImage=item[2] ) except: li = xbmcgui.ListItem(">>> " + item[0], iconImage=item[2]) xbmcplugin.addDirectoryItem(int(sys.argv[1]), url=url, listitem=li)
def list_all_items(): try: response = urllib.urlopen("http://streams.magazinmixt.ro/streams.json") source = response.read().decode("utf-8") except: response = "" if source: a = json.loads(source) # dict with data for i in a["groups"]: if i["name"] not in excluded: for j in i["channels"]: if ( j["status"] == 2 and j["country"] not in ["cz", "ru", "pl", "pr", "rs", "md", "hu", "tr"] and "\xd0" not in j["name"].encode("utf-8") ): if j["protocol"] == "sop": try: container.append([str(j["name"]), j["address"], 2, j["thumbnail"], 1, False]) except: container.append( [ str(j["name"]), j["address"], 2, "http://screenshots.en.sftcdn.net/blog/en/2008/10/sopcast-logo.png", 1, False, ] ) elif j["protocol"] == "acestream": try: container.append([str(j["name"]), j["address"], 1, j["thumbnail"], 1, False]) except: container.append( [ str(j["name"]), j["address"], 1, "http://screenshots.en.sftcdn.net/blog/en/2008/10/sopcast-logo.png", 2, False, ] ) else: try: containerOtherType.append([str(j["name"]), j["address"], j["thumbnail"]]) except: containerOtherType.append( [ str(j["name"]), j["address"], "http://anthrobotic.com/wp-content/uploads/2015/01/ANTHROBOTIC-VIDEO-ICON-e1420760465461.png", ] ) container.sort(key=lambda x: x[0]) containerOtherType.sort(key=lambda x: x[0]) delimiter3() xbmcplugin.addDirectoryItem( int(sys.argv[1]), url="http://82.76.249.75/digiedge2/tvpaprikahq/playlist.m3u8", listitem=xbmcgui.ListItem("Paprika test", iconImage=""), ) xbmcplugin.addDirectoryItem( int(sys.argv[1]), url="http://rtmp.infomaniak.ch/livecast/ladeux/chunklist.m3u8", listitem=xbmcgui.ListItem("La Deux test", iconImage=""), ) xbmcplugin.addDirectoryItem( int(sys.argv[1]), url="http://streaming-hub.com/tv/i/tf1_1@97468/master.m3u8", listitem=xbmcgui.ListItem("TF1 test", iconImage=""), ) xbmcplugin.addDirectoryItem( int(sys.argv[1]), url="http://stream01.yamgo.com/iPhone/HLS_TS/broadcast/strictly_belly_dancing-tablet.3gp/strictly_belly_dancing-tablet.3gp-mr647k.m3u8", listitem=xbmcgui.ListItem("Bellytest", iconImage=""), ) xbmcplugin.addDirectoryItem( int(sys.argv[1]), url="http://204.107.27.233/live/1729.high.stream/playlist.m3u8", listitem=xbmcgui.ListItem("Arte", iconImage=""), ) delimiter3() for i in container: print "*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*" print schedule.getEventAtTime(scheduleDb["Acasa"]) try: print "******************** " + scheduleDb[i[0]] addDir(i[0] + " " + schedule.getEventAtTime(scheduleDb[i[0]]), i[1], i[2], i[3], i[4], i[5]) except Exception, e: print "#####################11111#####################" print e print "#####################22222#####################" try: addDir(i[0], i[1], i[2], i[3], i[4], i[5]) except: pass # delimiter2() # torrent_tv() # delimiter() for i in containerOtherType: try: appendDifferentStreams(i) except: continue