def browse_channel(url, page, provider, cookie=''): #MAIN TREE BROWSER IS HERE! if provider == "977musiccom": jsonChannels = R977Musiccom.getChannels(page, cookie) for item in jsonChannels: mode = 4 image = icon if item.has_key("thumbnail"): image = item["thumbnail"] if item.has_key("finalLink"): mode = 2 add_dir(item["title"], item["link"], mode, image, "977musiccom", item["link"], '', R977Musiccom.cookie) elif provider == "radionet": jsonChannels = Radionet.getChannels(page, cookie) mode = 102 for item in jsonChannels: image = icon if item.has_key("thumbnail"): image = item["thumbnail"] add_dir(item["title"], item["link"], mode, image, "radionet", item["link"], '', Radionet.cookie) elif provider == "redmp3cc": jsonChannels = Redmp3cc.getChannels(page, cookie) for item in jsonChannels: mode = 4 image = icon if item.has_key("thumbnail"): image = item["thumbnail"] if item["link"].find(".html") == -1: mode = 103 logger.info("detected final link: " + item["link"]) add_dir(item["title"], item["link"], mode, image, "redmp3cc", item["link"], '', Redmp3cc.cookie) elif provider == 'fildonet': jsonChannels = Fildonet.getChannels(page, cookie) for item in jsonChannels: mode = 4 image = icon if item.has_key("thumbnail"): image = item["thumbnail"] if item["link"].find(".mp3") != -1: mode = 2 item["link"] = Fildonet.parseLinkToLoadBalancer(item["link"]) logger.info("detected final file: " + item["link"]) add_dir(item["title"], item["link"], mode, image, "fildonet", item["link"], '', Redmp3cc.cookie) logger.info(provider)
def browse_channel(url,page,provider,cookie=''): #MAIN TREE BROWSER IS HERE! if provider == "977musiccom": jsonChannels = R977Musiccom.getChannels(page,cookie) for item in jsonChannels: mode = 4 image = icon if item.has_key("thumbnail"): image = item["thumbnail"] if item.has_key("finalLink"): mode = 2 add_dir(item["title"],item["link"],mode,image,"977musiccom",item["link"],'',R977Musiccom.cookie) elif provider== "radionet": jsonChannels = Radionet.getChannels(page,cookie) mode = 102 for item in jsonChannels: image = icon if item.has_key("thumbnail"): image = item["thumbnail"] add_dir(item["title"],item["link"],mode,image,"radionet",item["link"],'',Radionet.cookie) elif provider== "redmp3cc": jsonChannels = Redmp3cc.getChannels(page,cookie) for item in jsonChannels: mode = 4 image = icon if item.has_key("thumbnail"): image = item["thumbnail"] if item["link"].find(".html")==-1: mode = 103 logger.info("detected final link: "+item["link"]) add_dir(item["title"],item["link"],mode,image,"redmp3cc",item["link"],'',Redmp3cc.cookie) elif provider == 'fildonet': jsonChannels = Fildonet.getChannels(page,cookie) for item in jsonChannels: mode = 4 image = icon if item.has_key("thumbnail"): image = item["thumbnail"] if item["link"].find(".mp3")!=-1: mode = 2 item["link"] = Fildonet.parseLinkToLoadBalancer(item["link"]) logger.info("detected final file: "+item["link"]) add_dir(item["title"],item["link"],mode,image,"fildonet",item["link"],'',Redmp3cc.cookie) logger.info(provider)
def init(): params = get_params() url = "" mode = None page = "" cookie = "" try: page = urllib.unquote_plus(params["page"]) except: pass try: url = urllib.unquote_plus(params["url"]) except: pass try: mode = int(params["mode"]) except: pass try: provider = urllib.unquote_plus(params["provider"]) except: pass try: logger.info("cookie was filled with: " + params["cookie"]) cookie = urllib.unquote_plus(params["cookie"]) except: pass #print "Mode: "+str(mode) print "URL: " + str(url) print "cookie: " + str(cookie) if mode == None: #init get_main_dirs() elif mode == 1: #get channels get_dirs(url, '', page) elif mode == 2: #open multimedia file in player open(url, page) elif mode == 3: browse_channels(url, page) elif mode == 4: browse_channel(url, page, provider, cookie) #main logic elif mode == 5: open_channel(url, page) elif mode == 0: #update if xbmcgui.Dialog().yesno(addon.getLocalizedString(10011), updater.getUpdateInfo(), "", "", addon.getLocalizedString(11013), addon.getLocalizedString(11014)): updater.update() get_main_dirs() elif mode == 100: #decode provider link logger.info("decoding: " + url) link = Decoder.decodeLink(url) logger.info("decoded: " + link) open(link, page) elif mode == 101: jsonChannels = R977Musiccom.getChannels(page, cookie) url = jsonChannels[0]["link"] logger.info("found link: " + url + ", launching...") open(url, page) #same that 2, but reserved for rtmp elif mode == 102: jsonChannels = Radionet.getChannels(page, cookie) url = jsonChannels[0]["link"] logger.info("found link: " + url + ", launching...") open(url, page) #same that 2, but reserved for rtmp elif mode == 103: jsonChannels = Redmp3cc.getChannels(url, cookie) url = jsonChannels[0]["link"] logger.info("found link: " + url + ", launching...") open(url, page) #same that 2, but reserved for rtmp logger.info("remove temp: " + url) #os.remove(url) xbmcplugin.endOfDirectory(int(sys.argv[1]))
def init(): params=get_params() url="" mode=None page="" cookie="" try: page=urllib.unquote_plus(params["page"]) except: pass try: url=urllib.unquote_plus(params["url"]) except: pass try: mode=int(params["mode"]) except: pass try: provider=urllib.unquote_plus(params["provider"]) except: pass try: logger.info("cookie was filled with: "+params["cookie"]) cookie=urllib.unquote_plus(params["cookie"]) except: pass #print "Mode: "+str(mode) print "URL: "+str(url) print "cookie: "+str(cookie) if mode==None: #init get_main_dirs() elif mode==1: #get channels get_dirs(url, '', page) elif mode == 2: #open multimedia file in player open(url,page) elif mode == 3: browse_channels(url,page) elif mode == 4: browse_channel(url,page,provider,cookie) #main logic elif mode == 5: open_channel(url,page) elif mode == 0: #update if xbmcgui.Dialog().yesno(addon.getLocalizedString(10011),updater.getUpdateInfo(), "", "", addon.getLocalizedString(11013), addon.getLocalizedString(11014) ): updater.update() get_main_dirs() elif mode == 100: #decode provider link logger.info("decoding: "+url) link = Decoder.decodeLink(url) logger.info("decoded: "+link) open(link,page) elif mode == 101: jsonChannels = R977Musiccom.getChannels(page,cookie) url = jsonChannels[0]["link"] logger.info("found link: "+url+", launching...") open(url,page) #same that 2, but reserved for rtmp elif mode == 102: jsonChannels = Radionet.getChannels(page,cookie) url = jsonChannels[0]["link"] logger.info("found link: "+url+", launching...") open(url,page) #same that 2, but reserved for rtmp elif mode == 103: jsonChannels = Redmp3cc.getChannels(url,cookie) url = jsonChannels[0]["link"] logger.info("found link: "+url+", launching...") open(url,page) #same that 2, but reserved for rtmp logger.info("remove temp: "+url) #os.remove(url) xbmcplugin.endOfDirectory(int(sys.argv[1]))