def play_livetv(params): plugintools.log("ruyaiptv.play_livetv "+repr(params)) token = plugintools.get_setting("token") if token=="": return mediaurl = params.get("url") plugintools.log("ruyaiptv.play_livetv mediaurl="+repr(mediaurl)) if "|" in params.get("url"): if plugintools.get_setting("quality_selector_live")=="0": plugintools.log("ruyaiptv.play_livetv asking for quality") selected = plugintools.selector(["Watch in SD","Watch in HD"],"Select quality") if selected==-1: return elif plugintools.get_setting("quality_selector_live")=="1": plugintools.log("ruyaiptv.play_livetv default to SD quality") selected = 0 elif plugintools.get_setting("quality_selector_live")=="2": plugintools.log("ruyaiptv.play_livetv default to HD quality") selected = 1 mediaurl = params.get("url").split("|")[selected] plugintools.log("ruyaiptv.play_livetv mediaurl="+repr(mediaurl)) plugintools.log("ruyaiptv.play_livetv mediaurl="+repr(mediaurl)) mediaurl = api.get_livetv_url(token,mediaurl) plugintools.log("ruyaiptv.play_livetv mediaurl="+repr(mediaurl)) plugintools.play_resolved_url( mediaurl )
def get_json_response(service,parameters): plugintools.log("ruyaiptv.api.get_json_response service="+service+", parameters="+repr(parameters)) base_url = get_base_url() # Adds session token s = plugintools.get_setting("token") parameters["s"] = s # Adds origin server o = plugintools.get_setting("server") parameters["o"] = o # Service call service_url = urlparse.urljoin(base_url,service) plugintools.log("ruyaiptv.api.get_json_response service_url="+service_url) service_parameters = urllib.urlencode(parameters) plugintools.log("ruyaiptv.api.get_json_response parameters="+service_parameters) try: body , response_headers = plugintools.read_body_and_headers( service_url , post=service_parameters ) except: import traceback plugintools.log("ruyaiptv.api.get_json_response "+traceback.format_exc()) json_response = jsontools.load_json(body) return json_response
def ACCOUNT(): f = urllib.urlopen("http://www.canyouseeme.org/") html_doc = f.read() f.close() m = re.search('(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',html_doc) s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 80)) user = plugintools.get_setting("username") key = base64.b64encode(plugintools.get_setting("beta")) if key=="tvsupertuga=": beta = "[COLOR lime]Yes[/COLOR]" else: beta = "[COLOR red]No[/COLOR]" if check=="true": a = "[COLOR lime]Yes[/COLOR]" else: a = "[COLOR red]No[/COLOR]" if auto=="true": b = "[COLOR lime]Yes[/COLOR]" else: b = "[COLOR red]No[/COLOR]" Common.addItem('[COLOR cyan]Version: [/COLOR][COLOR lime]%s' % version + " " + codename + "[/COLOR]",BASEURL,200,ICON,FANART,'') Common.addItem('[COLOR cyan]BETA Tester: [/COLOR]' + beta,BASEURL,200,ICON,FANART,'') Common.addItem('[COLOR cyan]Check For Updates: [/COLOR]' + a,BASEURL,200,ICON,FANART,'') Common.addItem('[COLOR cyan]Auto Updates: [/COLOR]' + b,BASEURL,200,ICON,FANART,'') Common.addItem('[COLOR cyan]Local IP: [/COLOR][COLOR yellow]' + s.getsockname()[0] + '[/COLOR]',BASEURL,200,ICON,FANART,'') Common.addItem('[COLOR cyan]External IP: [/COLOR][COLOR yellow]' + m.group(0) + '[/COLOR]',BASEURL,200,ICON,FANART,'')
def get_json_response(service, parameters): plugintools.log("ruyaiptv.api.get_json_response service=" + service + ", parameters=" + repr(parameters)) base_url = get_base_url() # Adds session token s = plugintools.get_setting("token") parameters["s"] = s # Adds origin server o = plugintools.get_setting("server") parameters["o"] = o # Service call service_url = urlparse.urljoin(base_url, service) plugintools.log("ruyaiptv.api.get_json_response service_url=" + service_url) service_parameters = urllib.urlencode(parameters) plugintools.log("ruyaiptv.api.get_json_response parameters=" + service_parameters) try: body, response_headers = plugintools.read_body_and_headers( service_url, post=service_parameters) except: import traceback plugintools.log("ruyaiptv.api.get_json_response " + traceback.format_exc()) json_response = jsontools.load_json(body) return json_response
def ACCOUNT(): f = urllib.urlopen("http://www.canyouseeme.org/") html_doc = f.read() f.close() m = re.search('(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)',html_doc) s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 80)) user = plugintools.get_setting("username") key = base64.b64encode(plugintools.get_setting("beta")) if key=="d2F0ZXJtZWxsb24=": beta = "[COLOR lime]Yes[/COLOR]" else: beta = "[COLOR red]No[/COLOR]" if check=="true": a = "[COLOR lime]Yes[/COLOR]" else: a = "[COLOR red]No[/COLOR]" if auto=="true": b = "[COLOR lime]Yes[/COLOR]" else: b = "[COLOR red]No[/COLOR]" Common.addItem('[COLOR cyan]Version: [/COLOR][COLOR lime]%s' % version + " " + codename + "[/COLOR]",BASEURL,200,ICON,FANART,'') Common.addItem('[COLOR cyan]BETA Tester: [/COLOR]' + beta,BASEURL,200,ICON,FANART,'') Common.addItem('[COLOR cyan]Check For Updates: [/COLOR]' + a,BASEURL,200,ICON,FANART,'') Common.addItem('[COLOR cyan]Auto Updates: [/COLOR]' + b,BASEURL,200,ICON,FANART,'') Common.addItem('[COLOR cyan]Local IP: [/COLOR][COLOR yellow]' + s.getsockname()[0] + '[/COLOR]',BASEURL,200,ICON,FANART,'') Common.addItem('[COLOR cyan]External IP: [/COLOR][COLOR yellow]' + m.group(0) + '[/COLOR]',BASEURL,200,ICON,FANART,'')
def user_credentials_available(): """ Checking if user credentials are set and asking for redirecting to settings if no credentials are available :return: """ global parsec_user global parsec_passwd parsec_user = plugintools.get_setting("parsec_user") parsec_passwd = plugintools.get_setting("parsec_passwd") plugintools.log("parsec checking existance of credentials") if parsec_user != "" and parsec_passwd != "": return True else: answer = xbmcgui.Dialog().yesno( LANG_PARSEC, LANG_MESSAGE_NO_CREDENTIALS, LANG_QUESTION_TO_SETTINGS ) if answer == True: plugintools.open_settings_dialog() redirect_to_beginning() return False
def get_parsec_session_id(): """ Central method for generating/offering parsec session id :return: """ global parsec_session_id if parsec_session_id == False: parsec_user = plugintools.get_setting("parsec_user") parsec_passwd = plugintools.get_setting("parsec_passwd") values = {'email': parsec_user, 'password': parsec_passwd, 'expiration_type': 'short'} headers = {'User-Agent': user_agent} data = urllib.urlencode(values) req = urllib2.Request(API_AUTHURL, data, headers) response = urllib2.urlopen(req) data = json.load(response) parsec_session_id = data['session_id'] plugintools.log("Received parsec sessionid:" + parsec_session_id) return parsec_session_id
def settingsChanged(self): try: # utils.log("Settings changed - update") old_settings = utils.refreshAddon() if plugintools.get_setting("enable_kodi_library") == 'true' and old_settings.getSetting('enable_kodi_library') == 'false': self.vaderClass.generate_strm_files() self.enable_kodi_library = plugintools.get_setting('enable_kodi_library') if (plugintools.get_setting("username") != vaderClass.username or (plugintools.get_setting("password") != vaderClass.password )): utils.log("Settings changed - update user/pass : "******"username") + " : " + old_settings.getSetting('username') ) self.vaderClass.deleteAllCache() self.vaderClass.updateUserPass() self.authString = self.vaderClass.authorise() if self.authString == 'Active': self.vaderClass.generate_strm_files() if (utils.getSetting("categorySetupLastSet") != old_settings.getSetting('categorySetupLastSet')): utils.log("Settings changed - update categories") self.vaderClass.deleteAllCache() self.vaderClass.updatePVRSettings() self.vaderClass.set_enabled_categories() except Exception as e: utils.log("Error updating settings \n{0}\n{1}".format(e, traceback.format_exc())) pass
def run(): global pnimi global televisioonilink global filmilink global andmelink global uuenduslink global lehekylg global LOAD_LIVE global uuendused global vanemalukk global version version = int(get_live("MQ==")) kasutajanimi=plugintools.get_setting("Username") salasona=plugintools.get_setting("Password") if not kasutajanimi: kasutajanimi = "NONE" salasona="NONE" uuendused=plugintools.get_setting(sync_data("dXVlbmR1c2Vk")) vanemalukk=plugintools.get_setting(sync_data("dmFuZW1hbHVraw==")) pnimi = get_live("T25lIFZpZXcg") LOAD_LIVE = os.path.join( plugintools.get_runtime_path() , "resources" , "art" ) plugintools.log(pnimi+get_live("U3RhcnRpbmcgdXA=")) televisioonilink = get_live("JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfbGl2ZV9jYXRlZ29yaWVz")%(lehekylg,kasutajanimi,salasona) filmilink = vod_channels("JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfdm9kX2NhdGVnb3JpZXM=")%(lehekylg,kasutajanimi,salasona) andmelink = vod_channels("JXMvcGFuZWxfYXBpLnBocD91c2VybmFtZT0lcyZwYXNzd29yZD0lcw==")%(lehekylg,kasutajanimi,salasona) params = plugintools.get_params() if params.get("action") is None: peamenyy(params) else: action = params.get("action") exec action+"(params)" plugintools.close_item_list()
def run_cronjob(params): kasutajanimi = plugintools.get_setting("Username") salasona = plugintools.get_setting("Password") lopplink = params.get("url") lopplink = lopplink.replace("%username", kasutajanimi) lopplink = lopplink.replace("%password", salasona) # lopplink = lopplink.replace(".ts", ".m3u8") listitem = xbmcgui.ListItem(path=lopplink) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
def run_cronjob(params): kasutajanimi=plugintools.get_setting("Username") salasona=plugintools.get_setting("Password") lopplink = params.get("url") lopplink = lopplink.replace("%username", kasutajanimi) lopplink = lopplink.replace("%password", salasona) lopplink = lopplink.replace(".ts", ".m3u8") listitem = xbmcgui.ListItem(path=lopplink) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
def run_cronjob(params): kasutajanimi=plugintools.get_setting("Username") salasona=plugintools.get_setting("Password") lopplink = params.get("url") if "http://" not in lopplink: lopplink = get_live("http://%s:%s/enigma.php/live/%s/%s/%s")%(lehekylg,kasutajanimi,salasona,lopplink) lopplink = lopplink[:-2] lopplink = lopplink + "ts" listitem = xbmcgui.ListItem(path=lopplink) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
def get_anonymous_account_or_request_new(): # Obtiene el ID anónimo, o calcula uno si no lo tiene if plugintools.get_setting("account_anonymous_id")=="": result = accounts_get_new_anonymous_account() if not result["error"]: plugintools.set_setting( "account_anonymous_id" , result["body"]["anonymous_id"] ) return plugintools.get_setting("account_anonymous_id")
def run_cronjob(params): kasutajanimi=plugintools.get_setting("Username") salasona=plugintools.get_setting("Password") lopplink = params.get("url") if "http://" not in lopplink: lopplink = get_live("aHR0cDovL29uZXN0cmVhbS5kZG5zLm5ldDo1NDU0L2xpdmUvJXMvJXMvJXM=")%(kasutajanimi,salasona,lopplink) lopplink = lopplink[:-2] lopplink = lopplink + "m3u8" listitem = xbmcgui.ListItem(path=lopplink) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
def run_cronjobxxx(params): kasutajanimi=plugintools.get_setting("Username") salasona=plugintools.get_setting("Password") lopplink = params.get("url") if "http://" not in lopplink: lopplink = get_live("aHR0cDovL290dHR2LmdhOjIwOTUvbGl2ZS8lcy8lcy8lcw==")%(kasutajanimi,salasona,lopplink) lopplink = lopplink[:-2] lopplink = lopplink + "m3u8" listitem = xbmcgui.ListItem(path=lopplink) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
def run_cronjob(params): kasutajanimi=plugintools.get_setting("Username") salasona=plugintools.get_setting("Password") lopplink = params.get("url") if "http://" not in lopplink: lopplink = get_live("aHR0cDovLyVzOiVzL2VuaWdtYS5waHAvbGl2ZS8lcy8lcy8lcw==")%(lehekylg,pordinumber,kasutajanimi,salasona,lopplink) lopplink = lopplink[:-2] lopplink = lopplink + "ts" listitem = xbmcgui.ListItem(path=lopplink) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
def get_anonymous_account_or_request_new(): # Obtiene el ID anónimo, o calcula uno si no lo tiene if plugintools.get_setting("account_anonymous_id") == "": result = accounts_get_new_anonymous_account() if not result["error"]: plugintools.set_setting("account_anonymous_id", result["body"]["anonymous_id"]) return plugintools.get_setting("account_anonymous_id")
def run_cronjobxxx(params): kasutajanimi = plugintools.get_setting("Username") salasona = plugintools.get_setting("Password") lopplink = params.get("url") if "http://" not in lopplink: lopplink = "http://otttv.ga:2095/live/%s/%s/%s" % (kasutajanimi, salasona, lopplink) lopplink = lopplink[:-2] lopplink = lopplink + "m3u8" listitem = xbmcgui.ListItem(path=lopplink) xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem)
def settings(params): plugintools.log("ruyaiptv.settings "+repr(params)) if plugintools.get_setting("pincode")!="": text = plugintools.keyboard_input(default_text="", title="Enter PIN Code") if text==plugintools.get_setting("pincode"): plugintools.open_settings_dialog() else: plugintools.open_settings_dialog()
def loginmu(): show = plugintools.get_setting("series_id") if show is "6": show = "tvshows" plugintools.log("show= "+show) plugintools.modo_vista(show) # Iniciamos login... url = 'http://series.mu/login/' post = 'user='******'&pass='+plugintools.get_setting("seriesmu_pwd") data = scrapertools.cache_page(url, post=post)
def loginmu(): show = plugintools.get_setting("series_id") if show is "6": show = "tvshows" plugintools.log("show= " + show) plugintools.modo_vista(show) # Iniciamos login... url = 'http://series.mu/login/' post = 'user='******'&pass=' + plugintools.get_setting("seriesmu_pwd") data = scrapertools.cache_page(url, post=post)
def p2p_builder_url(url, title_fixed, p2p): if p2p == "ace": p2p_launcher = plugintools.get_setting("p2p_launcher") plugintools.log("p2p_launcher= " + p2p_launcher) if p2p_launcher == "0": url = 'plugin://program.plexus/?url=' + url + '&mode=1&name=' + title_fixed else: url = 'plugin://plugin.video.p2p-streams/?url=' + url + '&mode=1&name=' + title_fixed elif p2p == "sop": p2p_launcher = plugintools.get_setting("p2p_launcher") plugintools.log("p2p_launcher= " + p2p_launcher) if p2p_launcher == "0": url = 'plugin://program.plexus/?url=' + url + '&mode=2&name=' + title_fixed else: url = 'plugin://plugin.video.p2p-streams/?url=' + url + '&mode=2&name=' + title_fixed elif p2p == "torrent": url = urllib.quote_plus(url) addon_torrent = plugintools.get_setting("addon_torrent") if addon_torrent == "Stream": # Stream (por defecto) url = 'plugin://plugin.video.stream/play/' + url elif addon_torrent == "Pulsar": # Pulsar url = 'plugin://plugin.video.pulsar/play?uri=' + url elif addon_torrent == "XBMCtorrent": # XBMCtorrent url = 'plugin://plugin.video.quasar/play?uri=' + url elif addon_torrent == "Plexus": # Plexus url = 'plugin://program.plexus/?url=' + url elif addon_torrent == "Quasar": # Quasar url = 'plugin://plugin.video.quasar/play?uri=' + url elif addon_torrent == "YATP": # YATP url = 'plugin://plugin.video.yatp/play?uri=' + url elif p2p == "magnet": addon_magnet = plugintools.get_setting("addon_magnet") if addon_magnet == "0": # Stream (por defecto) url = 'plugin://plugin.video.stream/play/' + url elif addon_magnet == "1": # Pulsar url = 'plugin://plugin.video.pulsar/play?uri=' + url elif addon_magnet == "2": # Kmediatorrent url = 'plugin://plugin.video.kmediatorrent/play/' + url elif addon_magnet == "3": # XBMCtorrent url = 'plugin://plugin.video.xbmctorrent/play?uri=' + url elif addon_magnet == "4": # Quasar url = 'plugin://plugin.video.quasar/play?uri=' + url elif addon_magnet == "5": # YATP url = 'plugin://plugin.video.yatp/play?uri=' + url plugintools.log("[%s %s] Creando llamada para URL P2P... %s " % (addonName, addonVersion, url)) return url
def general_playlists(params): plugintools.log("soritvch.general_playlists " + repr(params)) #data2 = xbmcgui.Dialog().input("Search to youtube") last_search = plugintools.get_setting("last_search") data2 = plugintools.keyboard_input(last_search) if not data2: cap1 = plugintools.get_localized_string(50001) cap2 = plugintools.get_localized_string(50002) # Canceled plugintools.message(cap1, cap2) exit = sys.exit() return exit data2 = data2.strip() plugintools.set_setting("last_search", data2) data2 = data2.replace(" ", "+") sch_lng = plugintools.get_setting("sch_lng") #plugintools.message("-",sch_lng) url = params.get("url") + data2 + "+" + sch_lng #xbmcgui.Dialog().ok("Search to youtube", url) try: data = plugintools.read(url) except: cap1 = plugintools.get_localized_string(50001) cap2 = plugintools.get_localized_string(50003) # 0 Results plugintools.message(cap1, cap2) exit = sys.exit() return exit plugintools.log("data=" + data) pattern = '<h3 class="yt-lockup-title "><a href="(.*?)</h3>' matches = plugintools.find_multiple_matches(data, pattern) for entry in matches: plugintools.log("=====================================") plugintools.log("entry=" + entry) video_id = plugintools.find_single_match(entry, 'v=(.*?)" class') plugintools.log("video_id=" + video_id) title = plugintools.find_single_match(entry, 'dir="ltr">(.*?)</a>') title2 = plugintools.find_single_match(entry, '"> -(.*?).</span>') title = title + "[COLOR yellow]-" + title2 + "[/COLOR]" title = title.replace('"', '"') title = title.strip() plot = "" thumbnail = "http://img.youtube.com/vi/" + video_id + "/0.jpg" url = "plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=" + video_id plugintools.add_item(action="play", title=title, plot=plot, url=url, thumbnail=thumbnail, isPlayable=False, folder=False)
def stream_video(params): kasutajanimi=plugintools.get_setting("Username") salasona=plugintools.get_setting("Password") CatID = params.get(get_live("dXJs")) #description url = get_live("JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfbGl2ZV9zdHJlYW1zJmNhdF9pZD0lcw==")%(lehekylg,kasutajanimi,salasona,CatID) request = urllib2.Request(url, headers={"Accept" : "application/xml","User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"}) u = urllib2.urlopen(request) tree = ElementTree.parse(u) rootElem = tree.getroot() for channel in tree.findall(sync_data("Y2hhbm5lbA==")): #channel kanalinimi = channel.find(get_live("dGl0bGU=")).text #title kanalinimi = base64.b64decode(kanalinimi) kanalinimi = kanalinimi.partition("[") striimilink = channel.find(get_live("c3RyZWFtX3VybA==")).text #stream_url pony = striimilink if ("%s/enigma2.php")%(lehekylg) in striimilink: pony = striimilink.split(kasutajanimi,1)[1] pony = pony.split(salasona,1)[1] pony = pony.split("/",1)[1] pilt = channel.find(vod_channels("ZGVzY19pbWFnZQ==")).text #desc_image kava = kanalinimi[1]+kanalinimi[2] kava = kava.partition("]") kava = kava[2] kava = kava.partition(" ") kava = kava[2] shou = get_live("W0NPTE9SIHdoaXRlXSVzIFsvQ09MT1JdW0NPTE9SIGdvbGRdJXMgWy9DT0xPUl0=")%(kanalinimi[0],kava) kirjeldus = channel.find(sync_data("ZGVzY3JpcHRpb24=")).text #description if kirjeldus: kirjeldus = base64.b64decode(kirjeldus) nyyd = kirjeldus.partition("(") nyyd = sync_data("Tm93OiA=") +nyyd[0] jargmine = kirjeldus.partition(")\n") jargmine = jargmine[2].partition("(") jargmine = sync_data("TmV4dDog") +jargmine[0] #shou kokku = nyyd+jargmine else: kokku = "" if pilt: plugintools.add_item( action=sync_data("cnVuX2Nyb25qb2I="), title=shou , url=pony, thumbnail=pilt, plot=kokku, fanart=os.path.join(LOAD_LIVE,sync_data("dGhlYXRlci5qcGc=")), extra="", isPlayable=True, folder=False ) else: plugintools.add_item( action=sync_data("cnVuX2Nyb25qb2I="), title=shou , url=pony, thumbnail=os.path.join(LOAD_LIVE,vod_channels("YWxsY2hhbm5lbHMucG5n")) , plot=kokku, fanart=os.path.join(LOAD_LIVE,sync_data("dGhlYXRlci5qcGc=")) , extra="", isPlayable=True, folder=False ) plugintools.set_view( plugintools.EPISODES ) kodi_name = common.KODI_VERSION() if kodi_name == "Jarvis": xbmc.executebuiltin("Container.SetViewMode(504)") elif kodi_name == "Krypton": xbmc.executebuiltin("Container.SetViewMode(55)") else: xbmc.executebuiltin("Container.SetViewMode(50)")
def read_body_and_headers(url, post=None, headers=[], follow_redirects=False, timeout=None): plugintools.log("movie4k.read_body_and_headers url=" + url) expiration = datetime.datetime.now() + datetime.timedelta(days=365) expiration_gmt = expiration.strftime("%a, %d-%b-%Y %H:%M:%S PST") if plugintools.get_setting("prefLanguage") == "0": headers.append([ "Cookie", "onlylanguage=de; expires=" + expiration_gmt + "; xxx2=ok; expires=" + expiration_gmt + ";" ]) elif plugintools.get_setting("prefLanguage") == "1": headers.append([ "Cookie", "onlylanguage=en; expires=" + expiration_gmt + "; xxx2=ok; expires=" + expiration_gmt + ";" ]) elif plugintools.get_setting("prefLanguage") == "2": headers.append([ "Cookie", "onlylanguage=fr; expires=" + expiration_gmt + "; xxx2=ok; expires=" + expiration_gmt + ";" ]) elif plugintools.get_setting("prefLanguage") == "3": headers.append([ "Cookie", "onlylanguage=es; expires=" + expiration_gmt + "; xxx2=ok; expires=" + expiration_gmt + ";" ]) elif plugintools.get_setting("prefLanguage") == "4": headers.append([ "Cookie", "onlylanguage=it; expires=" + expiration_gmt + "; xxx2=ok; expires=" + expiration_gmt + ";" ]) elif plugintools.get_setting("prefLanguage") == "5": headers.append([ "Cookie", "onlylanguage=ru; expires=" + expiration_gmt + "; xxx2=ok; expires=" + expiration_gmt + ";" ]) elif plugintools.get_setting("prefLanguage") == "6": headers.append([ "Cookie", "onlylanguage=jp; expires=" + expiration_gmt + "; xxx2=ok; expires=" + expiration_gmt + ";" ]) elif plugintools.get_setting("prefLanguage") == "7": headers.append([ "Cookie", "onlylanguage=tr; expires=" + expiration_gmt + "; xxx2=ok; expires=" + expiration_gmt + ";" ]) try: body, response_headers = plugintools.read_body_and_headers( url, post, headers, follow_redirects, timeout) except: xbmc.sleep(3) body, response_headers = plugintools.read_body_and_headers( url, post, headers, follow_redirects, timeout) return body, response_headers
def show_mc(): closedTime = plugintools.get_setting('mcClosedTime') if closedTime == None or closedTime == '': plugintools.set_setting('mcClosedTime', '0') closedTime = int((plugintools.get_setting('mcClosedTime'))) timeDiff = time.time() - closedTime mc_quittimer = plugintools.get_setting('mc_quittimer') if time.time() - closedTime > int(mc_quittimer): endOfDirectory(plugin.handle) vaderClass.startMCC() else: endOfDirectory(plugin.handle) xbmc.executebuiltin('Action(Back)')
def read_body_and_headers(url, post=None, headers=[], follow_redirects=False, timeout=None): plugintools.log("movie4k.read_body_and_headers url="+url) expiration = datetime.datetime.now() + datetime.timedelta(days=365) expiration_gmt = expiration.strftime("%a, %d-%b-%Y %H:%M:%S PST") if plugintools.get_setting("prefLanguage")=="0": headers.append(["Cookie","onlylanguage=de; expires="+expiration_gmt+"; xxx2=ok; expires="+expiration_gmt+";"]) elif plugintools.get_setting("prefLanguage")=="1": headers.append(["Cookie","onlylanguage=en; expires="+expiration_gmt+"; xxx2=ok; expires="+expiration_gmt+";"]) elif plugintools.get_setting("prefLanguage")=="2": headers.append(["Cookie","onlylanguage=fr; expires="+expiration_gmt+"; xxx2=ok; expires="+expiration_gmt+";"]) elif plugintools.get_setting("prefLanguage")=="3": headers.append(["Cookie","onlylanguage=es; expires="+expiration_gmt+"; xxx2=ok; expires="+expiration_gmt+";"]) elif plugintools.get_setting("prefLanguage")=="4": headers.append(["Cookie","onlylanguage=it; expires="+expiration_gmt+"; xxx2=ok; expires="+expiration_gmt+";"]) elif plugintools.get_setting("prefLanguage")=="5": headers.append(["Cookie","onlylanguage=ru; expires="+expiration_gmt+"; xxx2=ok; expires="+expiration_gmt+";"]) elif plugintools.get_setting("prefLanguage")=="6": headers.append(["Cookie","onlylanguage=jp; expires="+expiration_gmt+"; xxx2=ok; expires="+expiration_gmt+";"]) elif plugintools.get_setting("prefLanguage")=="7": headers.append(["Cookie","onlylanguage=tr; expires="+expiration_gmt+"; xxx2=ok; expires="+expiration_gmt+";"]) try: body,response_headers = plugintools.read_body_and_headers(url,post,headers,follow_redirects,timeout) except: xbmc.sleep(3) body,response_headers = plugintools.read_body_and_headers(url,post,headers,follow_redirects,timeout) return body,response_headers
def peamenyy(params): plugintools.log(pnimi+vod_channels("TWFpbiBNZW51")+repr(params)) load_channels() if not lehekylg: plugintools.open_settings_dialog() if uuendused == "true": kontrolli_uuendusi() channels = kontroll() if channels == 1 and orig.mode != 5: plugintools.log(pnimi+vod_channels("TG9naW4gU3VjY2Vzcw==")) plugintools.add_item( action=vod_channels("ZXhlY3V0ZV9haW5mbw=="), title="My Account", thumbnail=os.path.join(LOAD_LIVE,vod_channels("bXlhY2MucG5n")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("c2VjdXJpdHlfY2hlY2s="), title="Live TV" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("bGl2ZXR2LnBuZw==")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("ZGV0ZWN0X21vZGlmaWNhdGlvbg=="), title=vod_channels("Vk9E") , thumbnail=os.path.join(LOAD_LIVE,vod_channels("dm9kLnBuZw==")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) orig.AddDir('Clear Cache','Clear Cache',7,orig.Images + 'cache.png') plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title="Settings" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("c2V0dGluZ3MuanBn")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=") ), folder=False ) plugintools.set_view( plugintools.LIST ) elif orig.mode != 5: plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title="Click to login" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("ZGVmYXVsdGxvZ28ucG5n")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=False ) plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title="Settings" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("c2V0dGluZ3MuanBn")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=") ), folder=False ) orig.AddDir('Clear Cache','Clear Cache',7,orig.Images + 'cache.png') if plugintools.get_setting("improve")=="true": tseaded = xbmc.translatePath(sync_data("c3BlY2lhbDovL3VzZXJkYXRhL2FkdmFuY2Vkc2V0dGluZ3MueG1s")) if not os.path.exists(tseaded): file = open( os.path.join(plugintools.get_runtime_path(),vod_channels("cmVzb3VyY2Vz"),sync_data("YWR2YW5jZWRzZXR0aW5ncy54bWw=")) ) data = file.read() file.close() file = open(tseaded,"w") file.write(data) file.close() plugintools.message(pnimi, get_live("TmV3IGFkdmFuY2VkIHN0cmVhbWluZyBzZXR0aW5ncyBhZGRlZC4="))
def isohunt2(params): plugintools.log("movie.ultra.7k IsoHunt GetLink " + repr(params)) url = params.get("url") referer = 'https://isohunt.to/' data = gethttp_referer_headers(url, referer) #Todo: Añadir modo de vista (show) plugintools.log("data= " + data) magnet_match = plugintools.find_single_match(data, '<a href="magnet([^"]+)') magnet_match = 'magnet' + magnet_match plugintools.log("Magnet: " + magnet_match) magnet_match = urllib.quote_plus(magnet_match).strip() addon_magnet = plugintools.get_setting("addon_magnet") if addon_magnet == "0": # Stream (por defecto) magnet_url = 'plugin://plugin.video.stream/play/' + magnet_match magnet_url = magnet_url.strip() elif addon_magnet == "1": # Pulsar magnet_url = 'plugin://plugin.video.pulsar/play?uri=' + magnet_match magnet_url = magnet_url.strip() elif addon_magnet == "2": # KMediaTorrent magnet_url = 'plugin://plugin.video.kmediatorrent/play/' + magnet_match magnet_url = magnet_url.strip() plugintools.log("magnet_url= " + magnet_url) play(magnet_url)
def read_body_and_headers(url, post=None, headers=[], follow_redirects=False, timeout=None): plugintools.log("movie4k.read_body_and_headers url=" + url) expiration = datetime.datetime.now() + datetime.timedelta(days=365) expiration_gmt = expiration.strftime("%a, %d-%b-%Y %H:%M:%S PST") if plugintools.get_setting("only_english") == "true": plugintools.log("movie4k.read_body_and_headers only english") headers.append([ "Cookie", "onlylanguage=en; expires=" + expiration_gmt + "; xxx2=ok; expires=" + expiration_gmt + ";" ]) else: headers.append(["Cookie", "xxx2=ok; expires=" + expiration_gmt + ";"]) try: body, response_headers = plugintools.read_body_and_headers( url, post, headers, follow_redirects, timeout) except: xbmc.sleep(3) body, response_headers = plugintools.read_body_and_headers( url, post, headers, follow_redirects, timeout) return body, response_headers
def gethttp_referer_headers(url, referer, show): plugintools.log("beta.1-0.3.0.gethttp_referer_headers ") show = plugintools.get_setting( "series_id") # Obtenemos modo de vista del usuario para series TV if show is None: show = "tvshows" elif show == "1": show = "seasons" elif show == "2": show = "fanart" elif show == "3": show = "list" elif show == "4": show = "thumbnail" elif show == "5": show = "movies" elif show == "6": show = "tvshows" elif show == "7": show = "episodes" plugintools.log("show= " + show) plugintools.modo_vista(show) request_headers = [] request_headers.append([ "User-Agent", "Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:16.0.1) Gecko/20121011 Firefox/16.0.1" ]) request_headers.append(["Referer", referer]) body, response_headers = plugintools.read_body_and_headers( url, headers=request_headers) print response_headers return body
def lista_capis(params): plugintools.log('[%s %s] lista_capis %s' % (addonName, addonVersion, repr(params))) show = plugintools.get_setting("series_id") if show == "": show = "tvshows" plugintools.modo_vista(show) plugintools.log("show= "+show) thumbnail = params.get("thumbnail") if thumbnail == "": thumbnail = 'http://m1.paperblog.com/i/249/2490697/seriesflv-mejor-alternativa-series-yonkis-L-2whffw.jpeg' fanart = 'http://www.nikopik.com/wp-content/uploads/2011/10/S%C3%A9ries-TV.jpg' sinopsis = params.get("plot") datamovie = {} datamovie["Plot"]=sinopsis url = params.get("url") referer = 'http://www.seriesflv.net/' data = gethttp_referer_headers(url,referer,show) # Carátula de la serie cover = plugintools.find_single_match(data, '<div class="portada">(.*?)</div>') thumbnail = plugintools.find_single_match(cover, 'src="([^"]+)') matches = plugintools.find_multiple_matches(data, '<th class="sape">Capitulos</th>(.*?)</table>') for entry in matches: capis= plugintools.find_multiple_matches(entry, '<td class="sape">(.*?)</td>') for entry in capis: title_capi = plugintools.find_single_match(entry, 'class="color4">(.*?)</a>') url_capi = plugintools.find_single_match(entry, '<a href="([^"]+)') plugintools.add_item(action="chapter_urls", title= title_capi, url= url_capi, info_labels = datamovie , page = show , extra = show , thumbnail = thumbnail , fanart = fanart , folder = True, isPlayable = False)
def getotherhost(url, show): plugintools.log( "GetlinkMu " + url ) # pendiente de crear función getotherlinkmu para servidores no conocidos (hay que extraer url) show = plugintools.get_setting( "series_id") # Obtenemos modo de vista del usuario para series TV if show is None: show = "tvshows" elif show == "1": show = "seasons" elif show == "2": show = "fanart" elif show == "3": show = "list" elif show == "4": show = "thumbnail" elif show == "5": show = "movies" elif show == "6": show = "tvshows" elif show == "7": show = "episodes" plugintools.log("show= " + show) plugintools.modo_vista(show) data = scrapertools.get_header_from_response(url, header_to_get="location") plugintools.log("data= " + data) data = data.split(" ") url = data[0].strip() plugintools.log("url final a devolver= " + url) return url plugintools.log("show= " + show) plugintools.modo_vista(show)
def getlinkmu(params): loginmu() url = params.get("url") show = plugintools.get_setting("series_id") # Obtenemos modo de vista del usuario para series TV if show is None: show = "tvshows" elif show == "1": show = "seasons" elif show == "2": show = "fanart" elif show == "3": show = "list" elif show == "4": show = "thumbnail" elif show == "5": show = "movies" elif show == "6": show = "tvshows" elif show == "7": show = "episodes" params["page"] = show plugintools.log("show= " + show) plugintools.modo_vista(show) # Iniciamos petición de URL que contiene enlaces al capítulo... data = scrapertools.get_header_from_response(url, header_to_get="location") plugintools.log("data= " + data) data = data.split(" ") url = data[0].strip() plugintools.log("url final= " + url) plugintools.log("url= " + url) from resources.tools.resolvers import * if url.find("allmyvideos") >= 0: plugintools.get_params() url = url.replace("http://allmyvideos.net", "http://www.allmyvideos.net").strip() params["url"] = url allmyvideos(params) elif url.find("streamcloud") >= 0: plugintools.get_params() params["url"] = url streamcloud(params) elif url.find("nowvideo.sx") >= 0: plugintools.get_params() url = url.replace("http://nowvideo.sx", "http://www.nowvideo.sx").strip() params["url"] = url nowvideo(params) elif url.find("vidspot") >= 0: plugintools.get_params() url = url.replace("http://vidspot.net", "http://www.vidpot.net").strip() params["url"] = url vidspot(params) elif url.find("playedto") >= 0: plugintools.get_params() params["url"] = url playedto(params) plugintools.log("show= " + show) plugintools.modo_vista(show)
def getotherhost(url,show): plugintools.log("GetlinkMu "+url) # pendiente de crear función getotherlinkmu para servidores no conocidos (hay que extraer url) show = plugintools.get_setting("series_id") # Obtenemos modo de vista del usuario para series TV if show is None: show = "tvshows" elif show == "1": show = "seasons" elif show == "2": show = "fanart" elif show == "3": show = "list" elif show == "4": show = "thumbnail" elif show == "5": show = "movies" elif show == "6": show = "tvshows" elif show == "7": show = "episodes" plugintools.log("show= "+show) plugintools.modo_vista(show) data = scrapertools.get_header_from_response(url, header_to_get="location") plugintools.log("data= "+data) data = data.split(" ") url = data[0].strip() plugintools.log("url final a devolver= "+url) return url plugintools.log("show= "+show) plugintools.modo_vista(show)
def peamenyy(params): xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_TITLE ) plugintools.add_item( action="News", title='News' , url='', thumbnail='', plot='', fanart=os.path.join(LOAD_LIVE,"dGhlYXRlci5qcGc=") , extra="", isPlayable=False, folder=True ) plugintools.add_item( action="Radio", title='Radio' , url='', thumbnail='', plot='', fanart=os.path.join(LOAD_LIVE,"dGhlYXRlci5qcGc=") , extra="", isPlayable=False, folder=True ) plugintools.add_item( action="TOOLS", title='Tools' , url='http://ovh.net/files/100Mio.dat', thumbnail='', plot='', fanart='' , extra="", isPlayable=False, folder=True ) plugintools.log(pnimi+vod_channels("TWFpbiBNZW51")+repr(params)) load_channels() if not lehekylg1: plugintools.open_settings_dialog() if uuendused == "true": updates(params) channels = kontroll() if channels == 1: plugintools.log(pnimi+vod_channels("TG9naW4gU3VjY2Vzcw==")) plugintools.add_item( action=vod_channels("ZXhlY3V0ZV9haW5mbw=="), title=vod_channels("TXkgQWNjb3VudA==") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("c2VjdXJpdHlfY2hlY2s="), title=vod_channels("TGl2ZSBUVg==") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("cnVubmVyMg=="), title=vod_channels("VmlkZW8gT24gRGVtYW5k") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=False ) plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title=vod_channels("U2V0dGluZ3M=") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=") ), folder=False ) plugintools.set_view( plugintools.LIST ) else: plugintools.log(pnimi+vod_channels("TG9naW4gZmFpbGVk")) plugintools.message(("Login failed"),("Possible reasons: Wrong host,port,username or pass. Please reconfigure %s plugin with correct details!")%(pnimi)) exit() if plugintools.get_setting("improve")=="true": tseaded = xbmc.translatePath(sync_data("c3BlY2lhbDovL3VzZXJkYXRhL2FkdmFuY2Vkc2V0dGluZ3MueG1s")) tseaded = xbmc.translatePath(sync_data("c3BlY2lhbDovL3VzZXJkYXRhL2FkdmFuY2Vkc2V0dGluZ3MueG1s")) if not os.path.exists(tseaded): file = open( os.path.join(plugintools.get_runtime_path(),"resources",sync_data("YWR2YW5jZWRzZXR0aW5ncy54bWw=")) ) data = file.read() file.close() file = open(tseaded,"w") file.write(data) file.close() plugintools.message(pnimi, "New advanced streaming settings added.")
def playStream(channelID,thumbnail="",prevChannel='',firstTime=True): if prevChannel=='': prevChannel = channelID headers = {} headers['User-Agent']= 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.20 (KHTML, like Gecko) Chrome/11.0.672.2 Safari/534.20' request = urllib2.Request(david+channelID+tikva) resp = urllib2.urlopen(request) result = resp.read() json_obj = json.loads(result,encoding='utf-8') movie = json_obj.get('movies')[0] startFrom = float(0) if movie.get('StreamType') == 'youtube': if plugintools.get_setting('youtube_provider')=='1': link = "https://www.youtube.com/watch?v="+json_obj.get('movies')[0].get('movId') link = YouTubeStreams(link) else: link = 'plugin://plugin.video.youtube/play/?video_id='+json_obj.get('movies')[0].get('movId') title = movie.get('title').encode('utf-8') if firstTime: startFrom = float(movie.get('startFrom')) else: link = movie.get('ratesData').get('mainRate') title = movie.get('title').encode('utf-8') #xbmc.Player().play(link) player = CustomPlayer() player.PlayVideo(link, title, thumbnail,channelID,startFrom,prevChannel)
def bitsnoop2_bum(params): plugintools.log('[%s %s] [BUM+] BitSnoop getlink... %s' % (addonName, addonVersion, repr(params))) url = params.get("url") referer = 'https://bitsnoop.com/' data = gethttp_referer_headers(url,referer) #Todo: Añadir modo de vista (show) plugintools.log("data= "+data) magnet_match = plugintools.find_single_match(data, '<a href="magnet([^"]+)') magnet_match = 'magnet'+magnet_match plugintools.log("Magnet: "+magnet_match) magnet_match = urllib.quote_plus(magnet_match).strip() addon_magnet = plugintools.get_setting("addon_magnet") if addon_magnet == "0": # Stream (por defecto) magnet_url = 'plugin://plugin.video.stream/play/'+magnet_match magnet_url = magnet_url.strip() elif addon_magnet == "1": # Pulsar magnet_url = 'plugin://plugin.video.pulsar/play?uri=' + magnet_match magnet_url = magnet_url.strip() elif addon_magnet == "2": # KMediaTorrent magnet_url = 'plugin://plugin.video.kmediatorrent/play/' + magnet_match magnet_url = magnet_url.strip() plugintools.log("magnet_url= "+magnet_url) launch_bum(magnet_url)
def peamenyy(params): plugintools.log(pnimi+vod_channels("TWFpbiBNZW51")+repr(params)) ## load_channels() if not lehekylg: plugintools.open_settings_dialog() if uuendused == "true": kontrolli_uuendusi() channels = kontroll() if channels == 1: plugintools.log(pnimi+vod_channels("TG9naW4gU3VjY2Vzcw==")) plugintools.add_item( action=vod_channels("ZXhlY3V0ZV9haW5mbw=="), title=vod_channels("TXkgQWNjb3VudA==") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("c2VjdXJpdHlfY2hlY2s="), title=vod_channels("TGl2ZSBUVg==") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("ZGV0ZWN0X21vZGlmaWNhdGlvbg=="), title=vod_channels("VmlkZW8gT24gRGVtYW5k") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title=vod_channels("U2V0dGluZ3M=") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=") ), folder=False ) ##plugintools.set_view( plugintools.LIST ) else: plugintools.log(pnimi+vod_channels("TG9naW4gZmFpbGVk")) plugintools.message(vod_channels("TG9naW4gZmFpbGVk"), vod_channels("UG9zc2libGUgcmVhc29uczogV3JvbmcgaG9zdCxwb3J0LHVzZXJuYW1lIG9yIHBhc3MuICAgICAgICAgIFBsZWFzZSByZWNvbmZpZ3VyZSAlcyBwbHVnaW4gd2l0aCBjb3JyZWN0IGRldGFpbHMh")%(pnimi)) exit() if plugintools.get_setting("improve")=="true": tseaded = xbmc.translatePath(sync_data("c3BlY2lhbDovL3VzZXJkYXRhL2FkdmFuY2Vkc2V0dGluZ3MueG1s")) if not os.path.exists(tseaded): file = open( os.path.join(plugintools.get_runtime_path(),vod_channels("cmVzb3VyY2Vz"),sync_data("YWR2YW5jZWRzZXR0aW5ncy54bWw=")) ) data = file.read() file.close() file = open(tseaded,"w") file.write(data) file.close() plugintools.message(pnimi, get_live("TmV3IGFkdmFuY2VkIHN0cmVhbWluZyBzZXR0aW5ncyBhZGRlZC4="))
def main_list(params): plugintools.log("movie4k.main_list " + repr(params)) plugintools.set_view(plugintools.THUMBNAIL) plugintools.add_item(action="movies", title="Movies", thumbnail=os.path.join(THUMBNAIL_PATH, "movies.png"), fanart=FANART, folder=True) plugintools.add_item(action="tvshows", title="TV Shows", thumbnail=os.path.join(THUMBNAIL_PATH, "tvshows.png"), fanart=FANART, folder=True) if plugintools.get_setting("show_adult") == "true": plugintools.add_item(action="xxxmovies", title="XXX Movies", thumbnail=os.path.join(THUMBNAIL_PATH, "xxx.png"), fanart=FANART, folder=True) plugintools.add_item(action="search", title="Search", thumbnail=os.path.join(THUMBNAIL_PATH, "search.png"), fanart=FANART, folder=True) plugintools.add_item(action="settings", title="Settings", thumbnail=os.path.join(THUMBNAIL_PATH, "settings.png"), fanart=FANART, folder=False)
def login_pordede(): plugintools.log('[%s %s] ---> Iniciando login en Pordede.com... <--- ' % (addonName, addonVersion)) params = plugintools.get_params() url = "http://www.pordede.com/site/login" post = "LoginForm[username]="+plugintools.get_setting("pordede_user")+"&LoginForm[password]="+plugintools.get_setting("pordede_pwd") headers = DEFAULT_HEADERS[:] regex = params.get("extra") try: if os.path.exists(temp+'pordede.com') is True: print "Eliminando carpeta caché..." os.remove(temp+'pordede.com') except: pass data = scrapertools.cache_page(url,headers=headers,post=post);print data if data != "": login_info = plugintools.find_single_match(data, '<div class="friendMini shadow"(.*?)</div>') user_title = plugintools.find_single_match(login_info, 'title="([^"]+)') user_thumb = plugintools.find_single_match(login_info, 'src="([^"]+)') if regex == "": plugintools.log("regex= "+regex) plugintools.add_item(action="menuseries", title='Usuario: [COLOR lightyellow][I]'+user_title+'[/I][/COLOR]', url="", thumbnail=user_thumb, fanart=fanart, folder=True, isPlayable=False) plugintools.add_item(action="menuseries", title="Series", url="", thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False) plugintools.add_item(action="menupeliculas", title="Películas", url="", thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False) plugintools.add_item(action="listas_sigues", title="Listas que sigues", url="http://www.pordede.com/lists/following", thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False) plugintools.add_item(action="tus_listas", title="Tus listas", url="http://www.pordede.com/lists/yours", thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False) plugintools.add_item(action="listas_sigues", title="Top listas", url="http://www.pordede.com/lists", thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False)
def peamenyy(params): plugintools.log(pnimi+vod_channels("TWFpbiBNZW51")+repr(params)) load_channels() if not lehekylg: plugintools.open_settings_dialog() channels = kontroll() if channels == 1 and Overlord.mode != 5 and Overlord.mode != 1: plugintools.set_view( plugintools.LIST ) plugintools.log(pnimi+vod_channels("TG9naW4gU3VjY2Vzcw==")) plugintools.add_item( action=vod_channels("ZXhlY3V0ZV9haW5mbw=="), title="Your Account Information", thumbnail=os.path.join(LOAD_LIVE,vod_channels("bXlhY2MucG5n")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("c2VjdXJpdHlfY2hlY2s="), title="Overlord TV" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("bGl2ZXR2LnBuZw==")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("ZGV0ZWN0X21vZGlmaWNhdGlvbg=="), title=vod_channels("T24gRGVtYW5k") , thumbnail=os.path.join(LOAD_LIVE,vod_channels("dm9kLnBuZw==")), fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title="Your Settings" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("c2V0dGluZ3MuanBn")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=") ), folder=False ) #Overlord.AddDir('Extras','Extras',5,Overlord.Images + 'extras.png') elif channels != 1 and Overlord.mode != 1: plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title="Step 1. Enter Login details here" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("c2V0dGluZ3MuanBn")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=") ), folder=False ) plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjazI="), title="Step 2. Click here" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("c2V0dGluZ3MuanBn")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=") ), folder=False ) if plugintools.get_setting("improve")=="true": tseaded = xbmc.translatePath(sync_data("c3BlY2lhbDovL3VzZXJkYXRhL2FkdmFuY2Vkc2V0dGluZ3MueG1s")) if not os.path.exists(tseaded): file = open( os.path.join(plugintools.get_runtime_path(),vod_channels("cmVzb3VyY2Vz"),sync_data("YWR2YW5jZWRzZXR0aW5ncy54bWw=")) ) data = file.read() file.close() file = open(tseaded,"w") file.write(data) file.close() plugintools.message(pnimi, get_live("TmV3IGFkdmFuY2VkIHN0cmVhbWluZyBzZXR0aW5ncyBhZGRlZC4="))
def peamenyy(params): plugintools.log(pnimi+vod_channels("TWFpbiBNZW51")+repr(params)) load_channels() if not lehekylg: plugintools.open_settings_dialog() channels = kontroll() if channels == 1 and jedi.mode != 5 and jedi.mode != 1: plugintools.log(pnimi+vod_channels("TG9naW4gU3VjY2VzcyAtIFdhcmRvY3RvciBXaW5zIQ==")) plugintools.addItem('[B]Jedi Guide[/B]','guide',8,jedi.Images + 'jedi.png',jedi.Images + 'background.png') plugintools.add_item( action=vod_channels("ZXhlY3V0ZV9haW5mbw=="), title="[B]Account Information[/B]", thumbnail=os.path.join(LOAD_LIVE,vod_channels("bXlhY2MucG5n")), fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("c2VjdXJpdHlfY2hlY2s="), title="[B]Live TV[/B]" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("bGl2ZXR2LnBuZw==")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("ZGV0ZWN0X21vZGlmaWNhdGlvbg=="), title=vod_channels("W0JdVmlkZW8gT24gRGVtYW5kWy9CXQ==") , thumbnail=os.path.join(LOAD_LIVE,vod_channels("dm9kLnBuZw==")), fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title="[B]Settings[/B]" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("c2V0dGluZ3MucG5n")), fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=False ) if not xbmc.getCondVisibility('System.HasAddon(pvr.iptvsimple)'): plugintools.addItem('[B]Setup PVR Client with Jedi Streams[/B]','pvr',10,jedi.Images + 'pvr.png',jedi.Images + 'background.png') else: plugintools.addItem('[B]Launch PVR Jedi Streams[/B]','pvr',11,jedi.Images + 'pvr.png',jedi.Images + 'background.png') plugintools.addItem('[B]Run Speedtest[/B]','speed',9,jedi.Images + 'speed.png',jedi.Images + 'background.png') jedi.AddDir('[B][COLOR=red]Clear Cache[/B][/COLOR]','Clear Cache',7,jedi.Images + 'cache.png') elif channels != 1 and jedi.mode != 1: plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title="[B]Step 1. Enter Your Jedi Streams Login Credentials.[/B]" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("c2V0dGluZ3MucG5n")), folder=False ) plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjazI="), title="[B]Step 2. Click Here to Login.[/B]" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("c2V0dGluZ3MucG5n")), folder=False ) if plugintools.get_setting("improve")=="true": advancedsettings = xbmc.translatePath(sync_data("c3BlY2lhbDovL3VzZXJkYXRhL2FkdmFuY2Vkc2V0dGluZ3MueG1s")) ##System advanced settings## if os.path.exists(advancedsettings): file = open( os.path.join(plugintools.get_runtime_path(),vod_channels("cmVzb3VyY2Vz"),sync_data("YWR2YW5jZWRzZXR0aW5ncy54bWw=")) ) ##app advanced settings## data = file.read() file.close() file = open(advancedsettings,"w") file.write(data) file.close()
def read_body_and_headers(url, post=None, headers=[], follow_redirects=False, timeout=None): plugintools.log("movie4k.read_body_and_headers url="+url) expiration = datetime.datetime.now() + datetime.timedelta(days=365) expiration_gmt = expiration.strftime("%a, %d-%b-%Y %H:%M:%S PST") # The functionality "only movies in english" of the site is broken on the # movie's "Latest updates" page (no titles are displayed). If the option # "only_english" is enabled inthe addon preferences, the titles in other # languages are filtered out in the movies_updates() function. if plugintools.get_setting("only_english")=="true" and not url.endswith('/movies-updates.html'): plugintools.log("movie4k.read_body_and_headers only english") headers.append(["Cookie","onlylanguage=de; expires="+expiration_gmt+"; xxx2=ok; expires="+expiration_gmt+";"]) else: headers.append(["Cookie","xxx2=ok; expires="+expiration_gmt+";"]) body, response_headers = "", "" try: body,response_headers = plugintools.read_body_and_headers(url,post,headers,follow_redirects,timeout) except: xbmc.sleep(3000) try: body,response_headers = plugintools.read_body_and_headers(url,post,headers,follow_redirects,timeout) except: xbmcgui.Dialog().notification(MYNAME, "Connection to " + SITE_DOMAIN + " failed", xbmcgui.NOTIFICATION_ERROR) import traceback plugintools.log("movie4k.read_body_and_headers unexpected error: " + "".join(traceback.format_exception(*sys.exc_info()))) return body,response_headers
def lista_series(params): show = plugintools.get_setting("series_id") if show == "": show = "tvshows" plugintools.modo_vista(show) plugintools.log("show= " + show) url = params.get("url") plugintools.log("url= " + url) referer = 'http://www.seriesflv.net/' data = gethttp_referer_headers(url, referer, show) matches = plugintools.find_single_match( data, '<ul id="list_series_letras"(.*?)</ul>') series = plugintools.find_multiple_matches(matches, '<li class=(.*?)</li>') for entry in series: title_serie = plugintools.find_single_match(entry, 'title="([^"]+)') title_serie = title_serie.replace("Online HD", "") plugintools.log("title_serie= " + title_serie) url_serie = plugintools.find_single_match(entry, 'href="([^"]+)') plugintools.log("url_serie= " + url_serie) plugintools.add_item(action="lista_capis", title=title_serie, url=url_serie, thumbnail=params.get("thumbnail"), fanart=fanart, folder=True, isPlayable=False)
def settings(params): plugintools.log("movie4k.settings " + repr(params)) plugintools.open_settings_dialog() if plugintools.get_setting("force_advancedsettings") == "true": # advancedsettings.xml path import xbmc, xbmcgui, os advancedsettings = xbmc.translatePath( "special://userdata/advancedsettings.xml") if not os.path.exists(advancedsettings): # copy advancedsettings.xml from resources to userdata fichero = open( os.path.join(plugintools.get_runtime_path(), "resources", "advancedsettings.xml")) text = fichero.read() fichero.close() fichero = open(advancedsettings, "w") fichero.write(text) fichero.close() plugintools.message("movie4k", "A new file userdata/advancedsettings.xml", "has been created for optimal streaming")
def gethttp_referer_headers(url,referer,show): plugintools.log("gethttp_referer_headers "+url) show = plugintools.get_setting("series_id") # Obtenemos modo de vista del usuario para series TV if show is None: show = "tvshows" elif show == "1": show = "seasons" elif show == "2": show = "fanart" elif show == "3": show = "list" elif show == "4": show = "thumbnail" elif show == "5": show = "movies" elif show == "6": show = "tvshows" elif show == "7": show = "episodes" plugintools.log("show= "+show) plugintools.modo_vista(show) request_headers=[] request_headers.append(["User-Agent","Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:16.0.1) Gecko/20121011 Firefox/16.0.1"]) request_headers.append(["Referer", referer]) body,response_headers = plugintools.read_body_and_headers(url, headers=request_headers);print response_headers return body
def monova2_bum(params): plugintools.log('[%s %s] [BUM+] Monova getlink... %s' % (addonName, addonVersion, repr(params))) url = params.get("url") referer = 'https://monova.org/' data = gethttp_referer_headers(url, referer) #Todo: Añadir modo de vista (show) plugintools.log("data= " + data) magnet_match = plugintools.find_single_match(data, '<a href="magnet([^"]+)') magnet_match = 'magnet' + magnet_match plugintools.log("Magnet: " + magnet_match) magnet_match = urllib.quote_plus(magnet_match).strip() addon_magnet = plugintools.get_setting("addon_magnet") if addon_magnet == "0": # Stream (por defecto) magnet_url = 'plugin://plugin.video.stream/play/' + magnet_match magnet_url = magnet_url.strip() elif addon_magnet == "1": # Pulsar magnet_url = 'plugin://plugin.video.pulsar/play?uri=' + magnet_match magnet_url = magnet_url.strip() elif addon_magnet == "2": # KMediaTorrent magnet_url = 'plugin://plugin.video.kmediatorrent/play/' + magnet_match magnet_url = magnet_url.strip() plugintools.log("magnet_url= " + magnet_url) launch_bum(magnet_url)
def peamenyy(params): plugintools.log(pnimi+vod_channels("TWFpbiBNZW51")+repr(params)) load_channels() if not lehekylg: plugintools.open_settings_dialog() if uuendused == "true": kontrolli_uuendusi() channels = kontroll() if channels == 1 and orig.mode != 5: plugintools.log(pnimi+vod_channels("TG9naW4gU3VjY2Vzcw==")) plugintools.add_item( action=vod_channels("c2VjdXJpdHlfY2hlY2s="), title="[COLOR gold][B][I]PLAYERS LIVE[/I][/B][/COLOR]" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("bGl2ZXR2LnBuZw==")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) orig.AddDir('[COLOR deepskyblue][B]VOD/RETRO/CATCH UP[/B][/COLOR]','ExtraMenu',5,orig.Images + 'movies.png',orig.Images + 'background.png') orig.AddDir('[COLOR red][B]ADULT XXX[/B][/COLOR]','wizard3',10,orig.Images + 'movies.png',orig.Images + 'background.png') plugintools.addItem('[COLOR orange][B]Launch PVR[/B][/COLOR]','pvr',12,orig.Images + 'extras.png',orig.Images + 'background.png') orig.AddDir('[COLOR teal][B]Clear Cache[/B][/COLOR]','Clear Cache',7,orig.Images + 'clear.png') plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title="[COLOR orangered][B][I]Settings[/I][/B][/COLOR]" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("bG9nby5wbmc=")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")), folder=False ) plugintools.addItem('[COLOR limegreen][B][I]Click to Setup PVR SIMPLE CLIENT[/I][/B][/COLOR]','pvr',11,orig.Images + 'extras.png',orig.Images + 'background.png') elif orig.mode != 5: plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title="[COLOR yellow][B]Click here to enter login[/B][/COLOR]" , thumbnail=os.path.join(LOAD_LIVE,vod_channels("bG9nby5wbmc=")) , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=False ) orig.AddDir('[COLOR yellow][B]Click here to refresh after login details have been entered[/B][/COLOR]','Clear Cache',7,orig.Images + 'logo.png') if plugintools.get_setting("improve")=="true": tseaded = xbmc.translatePath(sync_data("c3BlY2lhbDovL3VzZXJkYXRhL2FkdmFuY2Vkc2V0dGluZ3MueG1s")) if not os.path.exists(tseaded): file = open( os.path.join(plugintools.get_runtime_path(),vod_channels("cmVzb3VyY2Vz"),sync_data("YWR2YW5jZWRzZXR0aW5ncy54bWw=")) ) data = file.read() file.close() file = open(tseaded,"w") file.write(data) file.close() plugintools.message(pnimi, get_live("TmV3IGFkdmFuY2VkIHN0cmVhbWluZyBzZXR0aW5ncyBhZGRlZC4="))
def peamenyy(params): plugintools.log(pnimi+vod_channels("TWFpbiBNZW51")+repr(params)) load_channels() if not lehekylg: plugintools.open_settings_dialog() if uuendused == "true": kontrolli_uuendusi() channels = kontroll() if channels == 1: plugintools.log(pnimi+vod_channels("TG9naW4gU3VjY2Vzcw==")) plugintools.add_item( action=vod_channels("ZXhlY3V0ZV9haW5mbw=="), title=vod_channels("TXkgQWNjb3VudA==") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("c2VjdXJpdHlfY2hlY2s="), title=vod_channels("TGl2ZSBUVg==") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("ZGV0ZWN0X21vZGlmaWNhdGlvbg=="), title=vod_channels("VmlkZW8gT24gRGVtYW5k") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=")) , folder=True ) plugintools.add_item( action=vod_channels("bGljZW5zZV9jaGVjaw=="), title=vod_channels("U2V0dGluZ3M=") , thumbnail="" , fanart=os.path.join(LOAD_LIVE,vod_channels("YmFja2dyb3VuZC5wbmc=") ), folder=False ) plugintools.set_view( plugintools.LIST ) else: plugintools.log(pnimi+vod_channels("TG9naW4gZmFpbGVk")) plugintools.message(vod_channels("TG9naW4gZmFpbGVk"), vod_channels("UG9zc2libGUgcmVhc29uczogV3JvbmcgaG9zdCxwb3J0LHVzZXJuYW1lIG9yIHBhc3MuICAgICAgICAgIFBsZWFzZSByZWNvbmZpZ3VyZSAlcyBwbHVnaW4gd2l0aCBjb3JyZWN0IGRldGFpbHMh")%(pnimi)) exit() if plugintools.get_setting("improve")=="true": tseaded = xbmc.translatePath(sync_data("c3BlY2lhbDovL3VzZXJkYXRhL2FkdmFuY2Vkc2V0dGluZ3MueG1s")) if not os.path.exists(tseaded): file = open( os.path.join(plugintools.get_runtime_path(),vod_channels("cmVzb3VyY2Vz"),sync_data("YWR2YW5jZWRzZXR0aW5ncy54bWw=")) ) data = file.read() file.close() file = open(tseaded,"w") file.write(data) file.close() plugintools.message(pnimi, get_live("TmV3IGFkdmFuY2VkIHN0cmVhbWluZyBzZXR0aW5ncyBhZGRlZC4="))
def BUILDMENU_BETA(): key = base64.b64encode(plugintools.get_setting("beta")) link = Common.OPEN_URL(BetaKeys).replace('\n', '').replace('\r', '') match = re.compile('passkey="(.+?)"').findall(link) for passkey in match: if key == passkey: link = Common.OPEN_URL(BetaWiz).replace('\n', '').replace('\r', '') match = re.compile( 'name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?ersion="(.+?)"' ).findall(link) for name, url, iconimage, fanart, description in match: Common.addDir(name, url, 90, ART + name + '.png', ART + name + '.png', description) else: link = Common.OPEN_URL(BetaVIP).replace('\n', '').replace('\r', '') match = re.compile('passkey="(.+?)"').findall(link) for passkey in match: if key == passkey: link = Common.OPEN_URL(BetaVIPWiz).replace('\n', '').replace( '\r', '') match = re.compile( 'name="(.+?)".+?rl="(.+?)".+?mg="(.+?)".+?anart="(.+?)".+?ersion="(.+?)"' ).findall(link) for name, url, iconimage, fanart, description in match: Common.addDir(name, url, 90, ART + name + '.png', ART + name + '.png', description) else: plugintools.message( AddonTitle, "Invalid Key: Check Details", "[COLOR yellow]https://www.facebook.com/groups/1735809796639007/" )
def wikipeli0(params): plugintools.log('[%s %s] TXT_reader %s' % (addonName, addonVersion, repr(params))) show = plugintools.get_setting("pelis_view") plugintools.modo_vista(show) url=params.get("url") url = url.replace("txt:", "") if url.startswith("http") == True: # Control para textos online plugintools.log("Iniciando descarga desde..."+url) h=urllib2.HTTPHandler(debuglevel=0) # Iniciamos descarga... request = urllib2.Request(url) opener = urllib2.build_opener(h) urllib2.install_opener(opener) filename = url.split("/") max_len = len(filename) max_len = int(max_len) - 1 filename = filename[max_len] fh = open(playlists + filename, "wb") #open the file for writing connected = opener.open(request) meta = connected.info() filesize = meta.getheaders("Content-Length")[0] size_local = fh.tell() print 'filesize',filesize print 'size_local',size_local while int(size_local) < int(filesize): blocksize = 100*1024 bloqueleido = connected.read(blocksize) fh.write(bloqueleido) # read from request while writing to file size_local = fh.tell() print 'size_local',size_local filename = url.split("/") inde = len(filename);print inde filename = filename[inde-1] txt_file = filename txt_path = playlists + txt_file plugintools.log("Abriendo texto de "+txt_path) xbmc.sleep(100) TextBoxes("[B][COLOR lightyellow][I]playlists / [/B][/COLOR][/I] "+txt_file,txt_path) else: txt_path = url plugintools.log("Abriendo texto de "+txt_path) xbmc.sleep(100) TextBoxes("[B][COLOR lightyellow][I]Wikipeli en [/COLOR][COLOR gold]Filmaffinity [/COLOR][/B][/I] ",txt_path) show = plugintools.get_setting("pelis_view") plugintools.modo_vista(show)
def pordede0(params): plugintools.log('[%s %s] ---> Launching Pordede regex... <--- ' % (addonName, addonVersion)) if plugintools.get_setting("pordede_user") == "": plugintools.add_item(action="", title="Habilita tu cuenta de pordede en la configuración", folder=False, isPlayable=False) else: login_pordede()
def kickass1_bum(params): plugintools.log('[%s %s] [BUM+] Kickass results... %s' % (addonName, addonVersion, repr(params))) bumfile = temp + 'bum.dat' controlbum = open(bumfile, "a") show = 'biglist' plugintools.modo_vista(show) #plugintools.add_item(action="", title= '[COLOR green][B]KickAss[/COLOR][COLOR gold][I] Torrents[/I][/COLOR] [/B][COLOR lightyellow][I]By Juarrox[/I][/COLOR]', url = "", thumbnail = thumbnail , fanart = fanart, folder = False, isPlayable = False) #plugintools.add_item(action="", title= '[COLOR red][B]Título [/COLOR][COLOR white] (Tamaño) [/COLOR] [/B][COLOR lightyellow][I](Semillas)[/I][/COLOR]', url = "", thumbnail = thumbnail , fanart = fanart, folder = False, isPlayable = False) url = params.get("url") referer = 'https://kat.cr/' data = gethttp_referer_headers(url,referer) #plugintools.log("data= "+data) thumbnail = plugintools.find_single_match(data, '<img src="([^"]+)') thumbnail = 'http:'+thumbnail #plugintools.log("thumbnail= "+thumbnail) match_num_results = plugintools.find_single_match(data, '<div><h2>(.*?)</a></h2>') num_results = plugintools.find_single_match(match_num_results, '<span>(.*?)</span>') num_results = num_results.replace("from", "de").replace("results", "Resultados:").strip() #plugintools.log("num_results= "+num_results) results = plugintools.find_single_match(data, '<table width="100%" cellspacing="0" cellpadding="0" class="doublecelltable" id="mainSearchTable">(.*?)</table>') #plugintools.log("results_table= "+results) matches = plugintools.find_multiple_matches(results, '<div class="torrentname">(.*?)<a data-download') for entry in matches: #plugintools.log("entry= "+entry) match_title = plugintools.find_single_match(entry, 'class="cellMainLink">(.*?)</a>') match_title = match_title.replace("</strong>", "").replace("<strong>", "").replace('<strong class="red">', "").strip() #plugintools.log("match_title= "+match_title) magnet_match = 'magnet:'+plugintools.find_single_match(entry, 'magnet:([^"]+)') plugintools.log("magnet_match= "+magnet_match) magnet_match = urllib.quote_plus(magnet_match).strip() addon_magnet = plugintools.get_setting("addon_magnet") if addon_magnet == "0": # Stream (por defecto) magnet_url = 'plugin://plugin.video.stream/play/'+magnet_match magnet_url = magnet_url.strip() elif addon_magnet == "1": # Pulsar magnet_url = 'plugin://plugin.video.pulsar/play?uri=' + magnet_match magnet_url = magnet_url.strip() elif addon_magnet == "2": # KMediaTorrent magnet_url = 'plugin://plugin.video.kmediatorrent/play/' + magnet_match magnet_url = magnet_url.strip() plugintools.log("magnet_url= "+magnet_url) size = plugintools.find_single_match(entry, 'class=\"nobr center\">(.*?)</td>') size = size.replace("<span>","").replace("</span>","").strip() #plugintools.log("size= "+size) seeds = plugintools.find_single_match(entry, '<td class="green center">(.*?)</td>').replace(",", "").replace(".", "") leechs = plugintools.find_single_match(entry, '<td class="red lasttd center">(.*?)</td>') #plugintools.log("seeds= "+seeds) #plugintools.log("leechs= "+leechs) title_fixed='[COLOR gold][I]['+seeds+'/'+leechs+'][/I][/COLOR] [COLOR white] '+match_title+' [I]['+size + '] [/COLOR][COLOR orange][Kickass][/I][/COLOR]' #plugintools.add_item(action="play", title=title_fixed, url=magnet_url, thumbnail = thumbnail , fanart = fanart , show = show , extra = show , folder=False, isPlayable=True) controlbum.write('Title: '+title_fixed+'\nURL: '+magnet_url+'\nThumbnail: '+thumbnail+'\nSeeds: '+seeds+'\nSize: '+size+'\n\n') controlbum.close()
def run_cronjob(params): extend=plugintools.get_setting(vod_channels("ZXh0ZW5k")) plugintools.log(pnimi+sync_data("UExBWV9MSVZF")+repr(params)) if vanemalukk == "true": pealkiri = params.get(sync_data("dGl0bGU=")) vanema_lukk(pealkiri) lopplink = params.get(vod_channels("dXJs")) lopplink = lopplink.replace('.ts','.%s'%extend) plugintools.play_resolved_url( lopplink )
def stream_video(params): plugintools.log(pnimi+sync_data("TGl2ZSBDaGFubmVscyBNZW51IA==")+repr(params)) kasutajanimi=plugintools.get_setting("Username") salasona=plugintools.get_setting("Password") CatID = params.get(get_live("dXJs")) #description url = get_live("aHR0cDovL29uZXN0cmVhbS5kZG5zLm5ldDo1NDU0L2VuaWdtYTIucGhwP3VzZXJuYW1lPSVzJnBhc3N3b3JkPSVzJnR5cGU9Z2V0X2xpdmVfc3RyZWFtcyZjYXRfaWQ9JXM=")%(kasutajanimi,salasona,CatID) request = urllib2.Request(url, headers={"Accept" : "application/xml"}) u = urllib2.urlopen(request) tree = ElementTree.parse(u) rootElem = tree.getroot() for channel in tree.findall(sync_data("Y2hhbm5lbA==")): #channel kanalinimi = channel.find(get_live("dGl0bGU=")).text #title kanalinimi = base64.b64decode(kanalinimi) kanalinimi = kanalinimi.partition("[") striimilink = channel.find(get_live("c3RyZWFtX3VybA==")).text #stream_url poo = striimilink if "http://onestream.ddns.net:5454/" in striimilink: poo = striimilink.split(kasutajanimi,1)[1] poo = poo.split(salasona,1)[1] poo = poo.split("/",1)[1] pilt = channel.find(vod_channels("ZGVzY19pbWFnZQ==")).text #desc_image kava = kanalinimi[1]+kanalinimi[2] kava = kava.partition("]") kava = kava[2] kava = kava.partition(" ") kava = kava[2] shou = get_live("W0NPTE9SIHdoaXRlXSVzIFsvQ09MT1Jd")%(kanalinimi[0])+kava #[COLOR white]%s [/COLOR] kirjeldus = channel.find(sync_data("ZGVzY3JpcHRpb24=")).text #description if kirjeldus: kirjeldus = base64.b64decode(kirjeldus) nyyd = kirjeldus.partition("(") nyyd = sync_data("Tm93OiA=") +nyyd[0] jargmine = kirjeldus.partition(")\n") jargmine = jargmine[2].partition("(") jargmine = sync_data("TmV4dDog") +jargmine[0] #shou kokku = nyyd+jargmine else: kokku = "" if pilt: plugintools.add_item( action=sync_data("cnVuX2Nyb25qb2I="), title=shou , url=poo, thumbnail=pilt, plot=kokku, fanart=os.path.join(LOAD_LIVE,vod_channels("aG9tZXRoZWF0ZXIuanBn")), extra="", isPlayable=True, folder=False ) else: plugintools.add_item( action=sync_data("cnVuX2Nyb25qb2I="), title=shou , url=poo, thumbnail=os.path.join(LOAD_LIVE,vod_channels("bGl2ZXR2LnBuZw==")) , plot=kokku, fanart=os.path.join(LOAD_LIVE,sync_data("aG9tZXRoZWF0ZXIuanBn")) , extra="", isPlayable=True, folder=False ) plugintools.set_view( plugintools.EPISODES ) xbmc.executebuiltin(vod_channels("Q29udGFpbmVyLlNldFZpZXdNb2RlKDUwMyk="))
def listado_seriesflv(params): show = plugintools.get_setting("series_id") if show == "": show = "tvshows" plugintools.modo_vista(show) letra = "a" url = 'http://www.seriesflv.net/ajax/lista.php?grupo_no=0&type=series&order=b' referer = 'hhttp://www.seriesflv.net/series/' body = gethttp_referer_headers(url,referer,show)
def main_list(params): plugintools.log("ruyaiptv.main_list "+repr(params)) if plugintools.get_setting("username")=="": settings(params) token = api.login( plugintools.get_setting("server") , plugintools.get_setting("username") , plugintools.get_setting("password") ) if token!="": plugintools.set_setting("token",token) import os plugintools.add_item( action="movies", title="Movies" , thumbnail = os.path.join(THUMBNAIL_PATH,"thumb0.png") , fanart=os.path.join(THUMBNAIL_PATH,"fanart0.jpg") , folder=True ) plugintools.add_item( action="tvshows", title="TV Shows" , thumbnail = os.path.join(THUMBNAIL_PATH,"thumb1.png") , fanart=os.path.join(THUMBNAIL_PATH,"fanart1.jpg") , folder=True ) plugintools.add_item( action="livetv", title="Live TV" , thumbnail = os.path.join(THUMBNAIL_PATH,"thumb2.png") , fanart=os.path.join(THUMBNAIL_PATH,"fanart2.jpg") , folder=True ) plugintools.add_item( action="livetv_catchup", title="Catch-up TV" , thumbnail = os.path.join(THUMBNAIL_PATH,"thumb2.png") , fanart=os.path.join(THUMBNAIL_PATH,"fanart2.jpg") , folder=True ) else: plugintools.message("RuYa IPTV","Invalid login, check your account in add-on settings") import os plugintools.add_item( action="settings", title="Settings..." , thumbnail = os.path.join(THUMBNAIL_PATH,"thumb3.png") , fanart=os.path.join(THUMBNAIL_PATH,"fanart3.jpg") , folder=False ) if plugintools.get_setting("force_advancedsettings")=="true": # Ruta del advancedsettings import xbmc,xbmcgui,os advancedsettings = xbmc.translatePath("special://userdata/advancedsettings.xml") if not os.path.exists(advancedsettings): # Copia el advancedsettings.xml desde el directorio resources al userdata fichero = open( os.path.join(plugintools.get_runtime_path(),"resources","advancedsettings.xml") ) texto = fichero.read() fichero.close() fichero = open(advancedsettings,"w") fichero.write(texto) fichero.close() plugintools.message("plugin", "A new file userdata/advancedsettings.xml","has been created for optimal streaming") if token!="" and plugintools.get_setting("check_for_updates")=="true": import updater updater.check_for_updates() plugintools.set_view( plugintools.LIST )
def play_movie(params): plugintools.log("ruyaiptv.play_movie "+repr(params)) mediaurl = params.get("url") if "|" in params.get("url"): if plugintools.get_setting("quality_selector")=="0": selected = plugintools.selector(["Watch in SD","Watch in HD"],"Select quality") if selected==-1: return elif plugintools.get_setting("quality_selector")=="1": selected = 0 elif plugintools.get_setting("quality_selector")=="2": selected = 1 mediaurl = params.get("url").split("|")[selected] plugintools.play_resolved_url( mediaurl )