if 'search' in request: hakusana = getKeyboard() items = p.parse("http://areena.yle.fi/.rss?media=video&q=" + hakusana) print items for item in items: url = sys.argv[0] + "?item_url=" + item[1] li = xbmcgui.ListItem(item[0], iconImage=item[2]) li.setInfo('video', {'Title': item[0]}) li.setProperty("PageURL", item[1]); xbmcplugin.addDirectoryItem(handle=handle, url=url, listitem=li, isFolder=False) xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True) if 'item_url' in request: print request item_url = request['item_url'] areena = AreenaNGDownloader() try: os.remove("/tmp/areenasub.fin.srt") except: pass output = areena.print_urls(item_url, False).rstrip() print output item = xbmcgui.ListItem("YLE"); params = output.split(" ") skip = 0 for param in params: skip+=1 if skip != 1: print param.split("=",1)[0],param.split("=",1)[1] item.setProperty(param.split("=",1)[0], param.split("=",1)[1].replace(" ", "")) xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(item.getProperty("tcUrl")+"/"+item.getProperty("playpath") + output)
if 'search' in request: hakusana = getKeyboard() items = p.parse("http://areena.yle.fi/.rss?media=video&q=" + hakusana) print items for item in items: url = sys.argv[0] + "?item_url=" + item[1] li = xbmcgui.ListItem(item[0], iconImage=item[2]) li.setInfo('video', {'Title': item[0]}) li.setProperty("PageURL", item[1]); xbmcplugin.addDirectoryItem(handle=handle, url=url, listitem=li, isFolder=False) xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True) if 'item_url' in request: print request item_url = request['item_url'] areena = AreenaNGDownloader() subfilename = os.tempnam() print "subfilename:", subfilename #try: # os.remove("/tmp/areenasub.fin.srt") #except: # pass output, subfilename = areena.print_urls(item_url, False, subfile=subfilename) output = output.rstrip() print subfilename print output item = xbmcgui.ListItem("YLE"); params = output.split(" ") skip = 0 for param in params:
print items for item in items: url = sys.argv[0] + "?item_url=" + item[1] li = xbmcgui.ListItem(item[0], iconImage=item[2]) li.setInfo('video', {'Title': item[0]}) li.setProperty("PageURL", item[1]) xbmcplugin.addDirectoryItem(handle=handle, url=url, listitem=li, isFolder=False) xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True) if 'item_url' in request: print request item_url = request['item_url'] areena = AreenaNGDownloader() try: os.remove("/tmp/areenasub.fin.srt") except: pass output = areena.print_urls(item_url, False).rstrip() print output item = xbmcgui.ListItem("YLE") params = output.split(" ") skip = 0 for param in params: skip += 1 if skip != 1: print param.split("=", 1)[0], param.split("=", 1)[1] item.setProperty( param.split("=", 1)[0],