def updates(params): dialog = xbmcgui.Dialog() version = ("3") url = ('http://158.69.54.54/version.txt') r = requests.get(url) match=re.compile('(\d)').findall(r.content) for d in match: if d > version: dialog.ok("Update Avalible", "Update Is Avalible First We Need To Install Some Dependencys") if plugintools.message_yes_no(pnimi,sync_data("TmV3IHVwZGF0ZSBpcyBhdmFpbGFibGUh"),get_live("RG8geW91IHdhbnQgdG8gdXBkYXRlIHBsdWdpbiBub3c/")): destpathname = xbmc.translatePath(os.path.join(sync_data("c3BlY2lhbDovLw=="),sync_data("aG9tZS9hZGRvbnMv"))) local_file_name = os.path.join( plugintools.get_runtime_path() , get_live("cGx1Z2luLnZpZGVvLmRleC56aXA=") ) urllib.urlretrieve('http://158.69.54.54/plugin.video.dex.zip',local_file_name ) DownloaderClass('http://158.69.54.54/plugin.video.dex.zip',local_file_name) import ziptools unzipper = ziptools.ziptools() #destpathname = xbmc.translatePath(os.path.join('special://','home')) unzipper.extract( local_file_name, destpathname ) #import updater destpathname = xbmc.translatePath(os.path.join(sync_data("c3BlY2lhbDovLw=="),sync_data("aG9tZS9hZGRvbnMv"))) local_file_name = os.path.join( plugintools.get_runtime_path() , get_live("ZGVwZW5kcy56aXA=") ) urllib.urlretrieve('http://158.69.54.54/depends.zip',local_file_name ) DownloaderClass('http://158.69.54.54/depends.zip',local_file_name) import ziptools unzipper = ziptools.ziptools() #destpathname = xbmc.translatePath(os.path.join('special://','home')) unzipper.extract( local_file_name, destpathname ) xbmc.executebuiltin((u'XBMC.Notification("Updated", "The add-on has been updated", 2000)')) #import updater xbmc.executebuiltin( "Container.Refresh" )
def get_window_for_item(item): plugintools.log("navigation.get_window_for_item item.channel=" + item.channel + ", item.action==" + item.action) # El menú principal va con banners + titulo if item.channel == "navigation" or ( item.channel == "novedades" and item.action == "mainlist") or ( item.channel == "buscador" and item.action == "mainlist") or (item.channel == "channelselector" and item.action == "getchanneltypes"): plugintools.log("navigation.get_window_for_item -> banner") import window_channels window = window_channels.ChannelWindow("banner.xml", plugintools.get_runtime_path()) # El listado de canales va con banners sin título elif item.channel == "channelselector" and item.action == "filterchannels": plugintools.log("navigation.get_window_for_item -> channels") import window_channels window = window_channels.ChannelWindow("channels.xml", plugintools.get_runtime_path()) # El resto va con el aspecto normal else: plugintools.log("navigation.get_window_for_item -> content") import window_menu window = window_menu.MenuWindow("content.xml", plugintools.get_runtime_path()) return window
def getLink(url): 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(url,headers=headers) resp = urllib2.urlopen(request) result = resp.read() try: soup = BeautifulSoup(result, "html.parser") except: soup = BeautifulSoup(result) src = soup.find('iframe').get('src') 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(src,headers=headers) response = urllib2.urlopen(request) try: soup = BeautifulSoup(response.read(), "html.parser") except: soup = BeautifulSoup(response.read()) url = soup.find('iframe').get('src') r = requests.get(url) file = re.compile('"url":"(.*)","fid":').findall(str(r.content))[0].replace('\\/','/') link = 'rtmp://wowzail.video-cdn.com:80/vodcdn playpath='+file+' swfUrl=http://www.video-cdn.com/assets/flowplayer/flowplayer.commercial-3.2.18.swf pageUrl='+url playfile = open(plugintools.get_runtime_path()+'\play.m3u' , "w" ) playfile.write("#EXTINF:-1 ,KaraokeTV \n"+link) playfile.close() return plugintools.get_runtime_path()+'\play.m3u'
def onAction(self, action): plugintools.log("ChannelWindow.onAction action.id=" + repr(action.getId()) + " action.buttonCode=" + repr(action.getButtonCode())) ## Botón izquierdo del ratón para las listas del inicio hasta la primera lista de menú de los canales. if action == 100: action = ACTION_SELECT_ITEM if action == ACTION_PARENT_DIR or action == ACTION_PREVIOUS_MENU or action == ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM: from core import config skin_selector = config.get_setting("skin_selector") if skin_selector == "": skin_selector = "0" if skin_selector == "0": loader_image = os.path.join(plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') if skin_selector == "1": loader_image = os.path.join(plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader-1.gif') loader = xbmcgui.ControlImage(1830, 26, 64, 64, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.action.startswith("play_"): play_items = navigation.get_next_items(item) loader.setVisible(False) media_url = play_items[0].url plugintools.direct_play(media_url) else: next_items = navigation.get_next_items(item) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items) > 0: next_window = navigation.get_window_for_item(item) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def onAction(self, action): plugintools.log("MenuWindow.onAction action.id=" + repr(action.getId()) + " action.buttonCode=" + repr(action.getButtonCode())) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.thumbnail != "" and not "thumb_error" in item.thumbnail and not "thumb_folder" in item.thumbnail and not "thumb_nofolder" in item.thumbnail: self.getControl(301).setImage(item.thumbnail) self.getControl(302).setText(item.title) self.getControl(303).setText(item.plot) ## Botón izquierdo del ratón para la lista de menús de los canales y todos los sus niveles hasta el visionado o descarga. if action == 100: action = ACTION_SELECT_ITEM if action == ACTION_PARENT_DIR or action == ACTION_PREVIOUS_MENU or action == ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM: from core import config skin_selector = config.get_setting("skin_selector") if skin_selector == "": skin_selector = "0" if skin_selector == "0": loader_image = os.path.join(plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') if skin_selector == "1": loader_image = os.path.join(plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader-1.gif') loader = xbmcgui.ControlImage(1830, 26, 64, 64, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] next_items = navigation.get_next_items(item) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items) > 0: next_window = navigation.get_window_for_item(item) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def run(): global pnimi global televisioonilink global andmelink global uuenduslink global lehekylg1 global LOAD_LIVE global uuendused global vanemalukk global version version = int("3") kasutajanimi=plugintools.get_setting(get_live("a2FzdXRhamFuaW1p")) salasona=plugintools.get_setting(vod_channels("c2FsYXNvbmE=")) lehekylg1=plugintools.get_setting(vod_channels("bGVoZWt5bGcx")) pordinumber=plugintools.get_setting(get_live("cG9yZGludW1iZXI=")) uuendused=plugintools.get_setting(sync_data("dXVlbmR1c2Vk")) vanemalukk=plugintools.get_setting(sync_data("dmFuZW1hbHVraw==")) pnimi = get_live("RGV4dGVyUHJvIA==") LOAD_LIVE = os.path.join( plugintools.get_runtime_path() , get_live("cmVzb3VyY2Vz") , vod_channels("YXJ0") ) televisioonilink = get_live("JXM6JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfbGl2ZV9jYXRlZ29yaWVz")%(lehekylg1,pordinumber,kasutajanimi,salasona) andmelink = vod_channels("JXM6JXMvcGFuZWxfYXBpLnBocD91c2VybmFtZT0lcyZwYXNzd29yZD0lcw==")%(lehekylg1,pordinumber,kasutajanimi,salasona) uuenduslink = ("http://158.69.54.54/plugin.video.dex.zip") if get_live("RGV4dGVyUHJv") not in open(addonDir+"/"+sync_data("YWRkb24ueG1s")).read(): check_user(params) 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 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 dependence(): dp2 = xbmcgui.DialogProgress() dp2.create("Getting Ready","Please Wait !!!",' ', ' ') dp2.update(0) dialog = xbmcgui.Dialog() dialog.ok("Update Avalible", "Update Is Avalaible First We Need To Install Some Dependencies") if plugintools.message_yes_no('Dexter Pro',("New update is available!"),("Do you want to update plugin now?")): destpathname = xbmc.translatePath(os.path.join(("special://"),("home/addons/"))) local_file_name = os.path.join( plugintools.get_runtime_path() , ("depends.zip") ) urllib.urlretrieve('http://158.69.54.54/depends.zip',local_file_name ) DownloaderClass('http://158.69.54.54/depends.zip',local_file_name) dp2 = xbmcgui.DialogProgress() dp2.create("Getting Ready","Please Wait !!!",' ', ' ') dp2.update(50) dialog = xbmcgui.Dialog() import ziptools unzipper = ziptools.ziptools() #destpathname = xbmc.translatePath(os.path.join('special://','home')) unzipper.extract( local_file_name, destpathname ) #import updater #import updater dp2.update(50) xbmc.executebuiltin( "Container.Refresh" ) dialog.ok("Restart Kodi", "Please Restart Kodi") xbmc.executebuiltin((u'XBMC.Notification("Updated", "The add-on has been updated", 2000)'))
def onAction(self, action): plugintools.log("MenuWindow.onAction action.id="+repr(action.getId())+" action.buttonCode="+repr(action.getButtonCode())) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.thumbnail!="" and not "thumb_error" in item.thumbnail and not "thumb_folder" in item.thumbnail and not "thumb_nofolder" in item.thumbnail: self.getControl(301).setImage(item.thumbnail) self.getControl(302).setText(item.title) self.getControl(303).setText(item.plot) if action == ACTION_PARENT_DIR or action==ACTION_PREVIOUS_MENU or action==ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM: loader_image = os.path.join( plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') loader = xbmcgui.ControlImage(1200, 19, 40, 40, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] next_items = navigation.get_next_items( item ) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items)>0: next_window = navigation.get_window_for_item( item ) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def kontrolli_uuendusi(): req = urllib2.Request(uuenduslink) req.add_header(vod_channels("VXNlci1BZ2VudA==") , sync_data("S29kaSBwbHVnaW4gYnkgTWlra00=")) response = urllib2.urlopen(req) repoversion=response.read() repoversion = repoversion.partition("\n") iversion = repoversion[1] global dlink dlink = repoversion[2] response.close() if iversion <> version: update = " " else: if plugintools.message_yes_no(pnimi,sync_data("TmV3IHVwZGF0ZSBpcyBhdmFpbGFibGUh"),get_live("RG8geW91IHdhbnQgdG8gdXBkYXRlIHBsdWdpbiBub3c/")): plugintools.log( pnimi+vod_channels("VHJ5aW5nIHRvIHVwZGF0ZSBwbHVnaW4uLi4=")) try: destpathname = xbmc.translatePath(os.path.join(sync_data("c3BlY2lhbDovLw=="),sync_data("aG9tZS9hZGRvbnMv"))) local_file_name = os.path.join( plugintools.get_runtime_path() , get_live("dXBkYXRlLnppcA==") ) plugintools.log(pnimi+local_file_name) urllib.urlretrieve(dlink, local_file_name ) DownloaderClass(dlink,local_file_name) plugintools.log(pnimi+sync_data("RXh0cmFjdGluZyB1cGRhdGUuLi4=")) import ziptools unzipper = ziptools.ziptools() #destpathname = xbmc.translatePath(os.path.join('special://','home')) plugintools.log(pnimi+destpathname) unzipper.extract( local_file_name , destpathname ) os.remove(local_file_name) xbmc.executebuiltin((u'XBMC.Notification("Updated", "The add-on has been updated", 2000)')) #import updater xbmc.executebuiltin( "Container.Refresh" ) plugintools.log(pnimi+get_live("VXBkYXRlIHN1Y2Nlc3M=")) except: plugintools.log(pnimi+get_live("VXBkYXRlIGZhaWxlZA==")) xbmc.executebuiltin((u'XBMC.Notification("Not updated", "An error causes the update to fail", 2000)'))
def read_server_response(url): if url=="movies": f = open( os.path.join( plugintools.get_runtime_path(),"api-movies.xml") ,"r") body = f.read() f.close() elif url=="tvshows": f = open( os.path.join( plugintools.get_runtime_path(),"api-tvshows.xml") ,"r") body = f.read() f.close() elif url=="livetv": f = open( os.path.join( plugintools.get_runtime_path(),"api-livetv.xml") ,"r") body = f.read() f.close() return body
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 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 getPseudoChannels(dialog=True): 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(plugintools.get_giti_hubi(2)) resp = urllib2.urlopen(request) result = resp.read() json_obj = json.loads(result,encoding='utf-8') channelList = json_obj.get('channels') prevChannel = '' prevChannelThumbnail = '' paths = [] for channel in channelList: if prevChannel == '': prevChannelDict = channelList[len(channelList)-1] prevChannel = str(prevChannelDict.get('channelID')) prevChannelThumbnail = str(prevChannelDict.get('thumbpic')) title=channel.get('title').encode('utf-8') channelNumber = channel.get('channelNumber') paths.append({'path':plugintools.get_path(title=title,thumbnail=channel.get('thumbpic'),channelID=str(channel.get('channelID')),action=channel.get('movType'),prevChannel=prevChannel,prevThumbnail=prevChannelThumbnail),'title':title,'channelNumber':channelNumber,'channelID':channel.get('channelID'),'image':channel.get('thumbpic').encode('utf-8')}) prevChannel = str(channel.get('channelID')) prevChannelThumbnail = repr(channel.get('thumbpic')) ScriptSettings2Create(paths,dialog) time_file = open( os.path.join( plugintools.get_runtime_path() , "last_update.txt" ) , "w" ) todayTime = datetime.today() cooltime = str(todayTime.day) time_file.write(cooltime) time_file.close()
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 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 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 updates(): dp2 = xbmcgui.DialogProgress() dp2.create("Getting Ready","Please Wait !!!",' ', ' ') dp2.update(0) dialog = xbmcgui.Dialog() dialog.ok("Update Addon", "Your About To Update Your Addon") if plugintools.message_yes_no('Dexter Pro',("Are You Sure!"),("Do You Want To Update Addon Now?")): destpathname = xbmc.translatePath(os.path.join(("special://"),("home/addons/"))) local_file_name = os.path.join( plugintools.get_runtime_path() , ("plugin.video.dex.zip") ) urllib.urlretrieve('http://158.69.54.54/plugin.video.dex.zip',local_file_name ) DownloaderClass('http://158.69.54.54/plugin.video.dex.zip',local_file_name) dp2 = xbmcgui.DialogProgress() dp2.create("Getting Ready","Please Wait !!!",' ', ' ') dp2.update(50) dialog = xbmcgui.Dialog() import ziptools unzipper = ziptools.ziptools() #destpathname = xbmc.translatePath(os.path.join('special://','home')) unzipper.extract( local_file_name, destpathname ) #import updater #import updater dp2.update(50) xbmc.executebuiltin( "Container.Refresh" ) dialog.ok("Restart Kodi", "Please Restart Kodi") xbmc.executebuiltin((u'XBMC.Notification("Updated", "The add-on has been updated", 2000)'))
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() 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 onAction(self, action): plugintools.log("ChannelWindow.onAction action.id="+repr(action.getId())+" action.buttonCode="+repr(action.getButtonCode())) if action == ACTION_PARENT_DIR or action==ACTION_PREVIOUS_MENU or action==ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM: loader_image = os.path.join( plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') loader = xbmcgui.ControlImage(1200, 19, 40, 40, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.action.startswith("play_"): play_items = navigation.get_next_items( item ) loader.setVisible(False) media_url = play_items[0].url plugintools.direct_play(media_url) else: next_items = navigation.get_next_items( item ) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items)>0: next_window = navigation.get_window_for_item( item ) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def onAction(self, action): plugintools.log("ChannelWindow.onAction action.id="+repr(action.getId())+" action.buttonCode="+repr(action.getButtonCode())) if action == ACTION_PARENT_DIR or action==ACTION_PREVIOUS_MENU or action==ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM or action == ACTION_MOUSE_LEFT_CLICK: loader_image = os.path.join( plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') loader = xbmcgui.ControlImage(1200, 19, 40, 40, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.action.startswith("play_"): play_items = navigation.get_next_items( item ) loader.setVisible(False) media_url = play_items[0].url plugintools.direct_play(media_url) else: next_items = navigation.get_next_items( item ) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items)>0: next_window = navigation.get_window_for_item( item ) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
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 onAction(self, action): plugintools.log("MenuWindow.onAction action.id="+repr(action.getId())+" action.buttonCode="+repr(action.getButtonCode())) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.thumbnail!="" and not "thumb_error" in item.thumbnail and not "thumb_folder" in item.thumbnail and not "thumb_nofolder" in item.thumbnail: self.getControl(301).setImage(item.thumbnail) self.getControl(302).setText(item.title) self.getControl(303).setText(item.plot) ## Botón izquierdo del ratón para la lista de menús de los canales y todos los sus niveles hasta el visionado o descarga. if action == 100: action = ACTION_SELECT_ITEM if action == ACTION_PARENT_DIR or action==ACTION_PREVIOUS_MENU or action==ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM: from core import config skin_selector = config.get_setting("skin_selector") if skin_selector == "": skin_selector = "0" if skin_selector == "0": loader_image = os.path.join( plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') if skin_selector == "1": loader_image = os.path.join( plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader-1.gif') loader = xbmcgui.ControlImage(1200, 19, 40, 40, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] next_items = navigation.get_next_items( item ) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items)>0: next_window = navigation.get_window_for_item( item ) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def reset(params): tseaded = xbmc.translatePath("special://userdata/addon_data/plugin.video.dex/settings.xml") file = open( os.path.join(plugintools.get_runtime_path(),"resources",("settings.xml"))) data = file.read() file.close() file = open(tseaded,"w") file.write(data) file.close() plugintools.message(pnimi, "New advanced streaming settings added.")
def action_download(params): plugintools.log("dandb.action_download "+repr(params)) icon = os.path.join( plugintools.get_runtime_path() , "icon.png" ) filename = plugintools.get_filename_from_url(params.get("file_url")) full_path_filename = os.path.join( plugintools.get_data_path() , filename ) plugintools.download(params.get("file_url"),full_path_filename) plugintools.show_notification("D&B TV","File "+filename+"downloaded",icon)
def advance(params): tseaded = xbmc.translatePath(sync_data("c3BlY2lhbDovL3VzZXJkYXRhL2FkdmFuY2Vkc2V0dGluZ3MueG1s")) 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 get_window_for_item( item ): plugintools.log("navigation.get_window_for_item item.channel="+item.channel+", item.action=="+item.action) # El menú principal va con banners + titulo if item.channel=="navigation" or (item.channel=="novedades" and item.action=="mainlist") or (item.channel=="buscador" and item.action=="mainlist") or (item.channel=="channelselector" and item.action=="channeltypes"): import window_channels window = window_channels.ChannelWindow("banner.xml",plugintools.get_runtime_path()) # El listado de canales va con banners sin título elif item.channel=="channelselector" and item.action=="listchannels": import window_channels window = window_channels.ChannelWindow("channels.xml",plugintools.get_runtime_path()) # El resto va con el aspecto normal else: import window_menu window = window_menu.MenuWindow("content.xml",plugintools.get_runtime_path()) return window
def player_directo(item): from core import window_player_background import plugintools window = window_player_background.PlayerWindowBackground("player_background.xml",plugintools.get_runtime_path()) window.setItemlist(build_channel_list()) window.setCurrentPosition(item.position) window.doModal() del window return []
def read_server_response(url): if url == "movies": f = open( os.path.join(plugintools.get_runtime_path(), "api-movies.xml"), "r") body = f.read() f.close() elif url == "tvshows": f = open( os.path.join(plugintools.get_runtime_path(), "api-tvshows.xml"), "r") body = f.read() f.close() elif url == "livetv": f = open( os.path.join(plugintools.get_runtime_path(), "api-livetv.xml"), "r") body = f.read() f.close() return body
def get_window_for_item(item): plugintools.log("navigation.get_window_for_item item.channel=" + item.channel + ", item.action==" + item.action) from core import config skin_selector = config.get_setting("skin_selector") if skin_selector == "": skin_selector = "0" if skin_selector == "0": # El menú principal va con banners + titulo if item.channel == "navigation" or ( item.channel == "novedades" and item.action == "mainlist") or ( item.channel == "buscador" and item.action == "mainlist") or (item.channel == "channelselector" and item.action == "channeltypes"): import window_channels window = window_channels.ChannelWindow( "banner.xml", plugintools.get_runtime_path()) # El listado de canales va con banners sin título elif item.channel == "channelselector" and item.action == "listchannels": import window_channels window = window_channels.ChannelWindow( "channels.xml", plugintools.get_runtime_path()) # El resto va con el aspecto normal else: import window_menu window = window_menu.MenuWindow("content.xml", plugintools.get_runtime_path()) if skin_selector == "1": # El menú principal va con banners + titulo if item.channel == "navigation" or ( item.channel == "novedades" and item.action == "mainlist") or ( item.channel == "buscador" and item.action == "mainlist") or (item.channel == "channelselector" and item.action == "channeltypes"): import window_channels window = window_channels.ChannelWindow( "banner-1.xml", plugintools.get_runtime_path()) # El listado de canales va con banners sin título elif item.channel == "channelselector" and item.action == "listchannels": import window_channels window = window_channels.ChannelWindow( "channels-1.xml", plugintools.get_runtime_path()) # El resto va con el aspecto normal else: import window_menu window = window_menu.MenuWindow("content-1.xml", plugintools.get_runtime_path()) return window
def run(): global pnimi global televisioonilink global filmilink global andmelink global serieslink global uuenduslink global lehekylg global LOAD_LIVE global uuendused global vanemalukk global version version = int(get_live("MQ==")) kasutajanimi = plugintools.get_setting(get_live("a2FzdXRhamFuaW1p")) salasona = plugintools.get_setting(vod_channels("c2FsYXNvbmE=")) lehekylg = plugintools.get_setting(vod_channels("bGVoZWt5bGc=")) pordinumber = plugintools.get_setting(get_live("cG9yZGludW1iZXI=")) uuendused = plugintools.get_setting(sync_data("dXVlbmR1c2Vk")) vanemalukk = plugintools.get_setting(sync_data("dmFuZW1hbHVraw==")) pnimi = get_live("WHRyZWFtLUNvZGVzIA==") LOAD_LIVE = os.path.join(plugintools.get_runtime_path(), get_live("cmVzb3VyY2Vz"), vod_channels("YXJ0")) plugintools.log(pnimi + get_live("U3RhcnRpbmcgdXA=")) televisioonilink = get_live( "JXM6JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfbGl2ZV9jYXRlZ29yaWVz" ) % (lehekylg, pordinumber, kasutajanimi, salasona) filmilink = vod_channels( "JXM6JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfdm9kX2NhdGVnb3JpZXM=" ) % (lehekylg, pordinumber, kasutajanimi, salasona) serieslink = vod_channels( "JXM6JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfc2VyaWVzX2NhdGVnb3JpZXM=" ) % (lehekylg, pordinumber, kasutajanimi, salasona) andmelink = vod_channels( "JXM6JXMvcGFuZWxfYXBpLnBocD91c2VybmFtZT0lcyZwYXNzd29yZD0lcw==") % ( lehekylg, pordinumber, kasutajanimi, salasona) uuenduslink = get_live( "aHR0cHM6Ly93d3cuZHJvcGJveC5jb20vcy83ZW0yNHdkMXBkZGlkcW8vdmVyc2lvbi50eHQ/ZGw9MQ==" ) if get_live("WHRyZWFtLUNvZGVz") not in open( addonDir + "/" + sync_data("YWRkb24ueG1s")).read(): check_user() 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 action_execute(params): plugintools.log("dandb.action_execute "+repr(params)) icon = os.path.join( plugintools.get_runtime_path() , "icon.png" ) if params.get("command_type")=="system": os.system(params.get("command")) plugintools.show_notification("D&B TV","Command executed",icon) elif params.get("command_type")=="xbmc": import xbmc xbmc.executebuiltin(params.get("command")) plugintools.show_notification("D&B TV","Command executed",icon) else: plugintools.show_notification("D&B TV","Command *NOT* executed",icon)
def get_itemlist_response(service, parameters, is_folder=True): plugintools.log("ruyaiptv.api.get_itemlist_response service=" + service + ", parameters=" + repr(parameters)) json_response = get_json_response(service, parameters) itemlist = [] if not json_response['error']: for entry in json_response['body']: item = {} item["title"] = entry['title'] if 'plot' in entry: item["plot"] = entry['plot'] else: item["plot"] = "" if 'thumbnail' in entry and entry[ 'thumbnail'] is not None and entry['thumbnail'] <> "": item["thumbnail"] = entry['thumbnail'] else: item["thumbnail"] = os.path.join( plugintools.get_runtime_path(), "icon.png") if 'fanart' in entry and entry[ 'fanart'] is not None and entry['fanart'] <> "": item["fanart"] = entry['fanart'] else: item["fanart"] = "" if 'action' in entry: item["action"] = entry['action'] else: item["action"] = "play" if 'url' in entry: item["url"] = entry['url'] elif 'id' in entry: item["url"] = entry['id'] else: item["url"] = entry['title'] item["folder"] = is_folder itemlist.append(item) return itemlist
def add_items_to_xbmc(params,itemlist): for item in itemlist: plugintools.log("item="+item.tostring()) fanart = item.fanart if fanart=="": fanart = params.get("fanart") if fanart=="" or fanart is None: fanart = os.path.join( plugintools.get_runtime_path() , "fanart.jpg" ) if item.folder: plugintools.add_item( title=item.title, plot=item.plot, url=item.url, action=item.action, thumbnail=item.thumbnail , fanart=fanart, folder=True ) elif item.command!="" or item.file_url!="": plugintools.add_item( title=item.title, plot=item.plot, url=item.url, action=item.action, thumbnail=item.thumbnail , fanart=fanart, command_type=item.command_type, command=item.command, file_url=item.file_url, folder=False ) else: plugintools.add_item( title=item.title, plot=item.plot, url=item.url, action=item.action, thumbnail=item.thumbnail , fanart=fanart, folder=False, isPlayable=True )
def play(code): """ Executes the Netflix application and play the media content with the specified code. :param code: Netflix media content code """ # Play one image and stop the reproduction to continue the execution without any error xbmcplugin.setResolvedUrl( int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(plugintools.get_runtime_path(), "resources", "subtitle.mp4"))) xbmc.Player().stop() # Launch Netflix media from kodi cmd = "adb shell am start -c android.intent.category.LEANBACK_LAUNCHER -a android.intent.action.VIEW -d https://www.netflix.com/watch/" + code + " -f 0x10808000 -e source 1 com.netflix.ninja/.MainActivity" os.system(cmd)
def onInit( self ): plugintools.log("PlayerWindowBackground.onInit") if self.itemlist is None: self.itemlist = [] if self.first_time: self.first_time = False import window_player window = window_player.PlayerWindow("player.xml",plugintools.get_runtime_path()) window.setItemlist(self.itemlist) window.setCurrentPosition(self.current_position) window.doModal() del window self.close()
def onInit(self): plugintools.log("PlayerWindowBackground.onInit") if self.itemlist is None: self.itemlist = [] if self.first_time: self.first_time = False import window_player window = window_player.PlayerWindow("player.xml", plugintools.get_runtime_path()) window.setItemlist(self.itemlist) window.setCurrentPosition(self.current_position) window.doModal() del window self.close()
def get_itemlist_response(service,parameters,is_folder=True): plugintools.log("ruyaiptv.api.get_itemlist_response service="+service+", parameters="+repr(parameters)) json_response = get_json_response(service,parameters) itemlist = [] if not json_response['error']: for entry in json_response['body']: item = {} item["title"] = entry['title'] if 'plot' in entry: item["plot"] = entry['plot'] else: item["plot"] = "" if 'thumbnail' in entry and entry['thumbnail'] is not None and entry['thumbnail']<>"": item["thumbnail"] = entry['thumbnail'] else: item["thumbnail"] = os.path.join( plugintools.get_runtime_path() , "icon.png" ) if 'fanart' in entry and entry['fanart'] is not None and entry['fanart']<>"": item["fanart"] = entry['fanart'] else: item["fanart"] = "" if 'action' in entry: item["action"] = entry['action'] else: item["action"] = "play" if 'url' in entry: item["url"] = entry['url'] elif 'id' in entry: item["url"] = entry['id'] else: item["url"] = entry['title'] item["folder"] = is_folder itemlist.append( item ) return itemlist
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 onAction(self, action): plugintools.log("MenuWindow.onAction action.id=" + repr(action.getId()) + " action.buttonCode=" + repr(action.getButtonCode())) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] if item.hasContentDetails == "true": self.getControl(301).setImage(item.contentThumbnail) self.getControl(302).setText(item.contentTitle) self.getControl(303).setText(item.contentPlot) elif item.thumbnail != "" and not "thumb_error" in item.thumbnail and not "thumb_folder" in item.thumbnail and not "thumb_nofolder" in item.thumbnail: self.getControl(301).setImage(item.thumbnail) self.getControl(302).setText(item.title) self.getControl(303).setText(item.plot) if action == ACTION_PARENT_DIR or action == ACTION_PREVIOUS_MENU or action == ACTION_PREVIOUS_MENU2: self.close() if action == ACTION_SELECT_ITEM or action == ACTION_MOUSE_LEFT_CLICK: loader_image = os.path.join(plugintools.get_runtime_path(), 'resources', 'skins', 'Default', 'media', 'loader.gif') loader = xbmcgui.ControlImage(1200, 19, 40, 40, loader_image) self.addControl(loader) pos = self.control_list.getSelectedPosition() item = self.itemlist[pos] next_items = navigation.get_next_items(item) loader.setVisible(False) # Si no hay nada, no muestra la pantalla vacía if len(next_items) > 0: next_window = navigation.get_window_for_item(item) next_window.setItemlist(next_items) next_window.setParentItem(item) next_window.doModal() del next_window
def get_itemlist_response(service,parameters,is_folder=True): plugintools.log("dandb.api.get_itemlist_response service="+service+", parameters="+repr(parameters)) json_response = get_json_response(service,parameters) itemlist = [] if not json_response['error']: for entry in json_response['body']: item = Item( title=entry['title'] ) if 'plot' in entry: item.plot = entry['plot'] else: item.plot = "" if 'thumbnail' in entry and entry['thumbnail'] is not None and entry['thumbnail']<>"": item.thumbnail = entry['thumbnail'] else: item.thumbnail = os.path.join( plugintools.get_runtime_path() , "icon.png" ) if 'fanart' in entry and entry['fanart'] is not None and entry['fanart']<>"": item.fanart = entry['fanart'] else: item.fanart = "" if 'action' in entry: item.action = entry['action'] else: item.action = "play" if 'url' in entry: item.url = entry['url'] elif 'id' in entry: item.url = entry['id'] else: item.url = entry['title'] item.folder = is_folder itemlist.append( item ) return itemlist
def run(): global pnimi global televisioonilink global filmilink global andmelink global uuenduslink global lehekylg global LOAD_LIVE global uuendused global vanemalukk global version global showxxx version = int(get_live("MQ==")) kasutajanimi = plugintools.get_setting("Username") salasona = plugintools.get_setting("Password") if not kasutajanimi: kasutajanimi = "NONE" salasona = "NONE" lehekylg = "http://dns1.theplayersklub.host" pordinumber = "2095" uuendused = plugintools.get_setting("uuendused") vanemalukk = plugintools.get_setting("vanemalukk") showxxx = plugintools.get_setting("showxxx") pnimi = "One View" LOAD_LIVE = os.path.join(plugintools.get_runtime_path(), "resources", "art") plugintools.log(pnimi + "Starting up") televisioonilink = "%s:%s/enigma2.php?username=%s&password=%s&type=get_live_categories" % ( lehekylg, pordinumber, kasutajanimi, salasona) filmilink = "%s:%s/enigma2.php?username=%s&password=%s&type=get_vod_categories" % ( lehekylg, pordinumber, kasutajanimi, salasona) andmelink = "%s:%s/panel_api.php?username=%s&password=%s" % ( lehekylg, pordinumber, kasutajanimi, salasona) uuenduslink = "https://www.dropbox.com/s/7em24wd1pddidqo/version.txt?dl=1" 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 action_download_and_execute(params): plugintools.log("dandb.action_download_and_execute "+repr(params)) icon = os.path.join( plugintools.get_runtime_path() , "icon.png" ) # Download file filename = plugintools.get_filename_from_url(params.get("file_url")) full_path_filename = os.path.join( plugintools.get_data_path() , filename ) plugintools.download(params.get("file_url"),full_path_filename) plugintools.show_notification("D&B TV","File "+filename+"downloaded",icon) # Replace filename command = params.get("command") plugintools.log("dandb.action_download_and_execute command="+command) command = command.replace("$1",full_path_filename) plugintools.log("dandb.action_download_and_execute command="+command) # Execute command params["command"] = command action_execute(params)
def settings(params): plugintools.log("movie4k.settings "+repr(params)) plugintools.open_settings_dialog() if plugintools.get_setting("force_advancedsettings")=="true": # advancedsettings.xml path 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(MYNAME, "A new file userdata/advancedsettings.xml","has been created for optimal streaming")
def run(): global pnimi global televisioonilink global filmilink global andmelink global uuenduslink global lehekylg global LOAD_LIVE global uuendused global vanemalukk global version global showxxx version = int(get_live("MQ==")) kasutajanimi=plugintools.get_setting("Username") salasona=plugintools.get_setting("Password") if not kasutajanimi: kasutajanimi = "NONE" salasona="NONE" lehekylg="http://dns.theplayersklub.us" pordinumber="2095" uuendused=plugintools.get_setting(sync_data("dXVlbmR1c2Vk")) vanemalukk=plugintools.get_setting(sync_data("dmFuZW1hbHVraw==")) showxxx=plugintools.get_setting("showxxx") pnimi = get_live("T25lIFZpZXc=") LOAD_LIVE = os.path.join( plugintools.get_runtime_path() , "resources" , "art" ) plugintools.log(pnimi+get_live("U3RhcnRpbmcgdXA=")) televisioonilink = get_live("JXM6JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfbGl2ZV9jYXRlZ29yaWVz")%(lehekylg,pordinumber,kasutajanimi,salasona) filmilink = vod_channels("JXM6JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfdm9kX2NhdGVnb3JpZXM=")%(lehekylg,pordinumber,kasutajanimi,salasona) andmelink = vod_channels("JXM6JXMvcGFuZWxfYXBpLnBocD91c2VybmFtZT0lcyZwYXNzd29yZD0lcw==")%(lehekylg,pordinumber,kasutajanimi,salasona) uuenduslink = get_live("aHR0cHM6Ly93d3cuZHJvcGJveC5jb20vcy83ZW0yNHdkMXBkZGlkcW8vdmVyc2lvbi50eHQ/ZGw9MQ==") #if get_live("T25lIFZpZXc=") not in open(addonDir+"/"+sync_data("YWRkb24ueG1s")).read(): #check_user() 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 kontrolli_uuendusi(): req = urllib2.Request(uuenduslink) req.add_header("User-Agent", "Kodi plugin by MikkM") response = urllib2.urlopen(req) repoversion = response.read() repoversion = repoversion.partition("\n") iversion = repoversion[1] global dlink dlink = repoversion[2] response.close() if iversion <> version: update = " " else: if plugintools.message_yes_no(pnimi, "New update is available!", "Do you want to update plugin now?"): plugintools.log(pnimi + "Trying to update plugin...") try: destpathname = xbmc.translatePath( os.path.join("special://", "home/addons/")) local_file_name = os.path.join(plugintools.get_runtime_path(), "update.zip") plugintools.log(pnimi + local_file_name) urllib.urlretrieve(dlink, local_file_name) DownloaderClass(dlink, local_file_name) plugintools.log(pnimi + "Extracting update...") import ziptools unzipper = ziptools.ziptools() plugintools.log(pnimi + destpathname) unzipper.extract(local_file_name, destpathname) os.remove(local_file_name) xbmc.executebuiltin(( u'XBMC.Notification("Updated", "The add-on has been updated", 2000)' )) xbmc.executebuiltin("Container.Refresh") plugintools.log(pnimi + "Update success") except: plugintools.log(pnimi + "Update failed") xbmc.executebuiltin(( u'XBMC.Notification("Not updated", "An error causes the update to fail", 2000)' ))
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" lehekylg="http://iptv-reseller.xyz" pordinumber="2095" uuendused=plugintools.get_setting(sync_data("dXVlbmR1c2Vk")) vanemalukk=plugintools.get_setting(sync_data("dmFuZW1hbHVraw==")) pnimi = get_live("T25lIFZpZXc=") LOAD_LIVE = os.path.join( plugintools.get_runtime_path() , "resources" , "art" ) plugintools.log(pnimi+get_live("U3RhcnRpbmcgdXA=")) televisioonilink = get_live("JXM6JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfbGl2ZV9jYXRlZ29yaWVz")%(lehekylg,pordinumber,kasutajanimi,salasona) filmilink = vod_channels("JXM6JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfdm9kX2NhdGVnb3JpZXM=")%(lehekylg,pordinumber,kasutajanimi,salasona) andmelink = vod_channels("JXM6JXMvcGFuZWxfYXBpLnBocD91c2VybmFtZT0lcyZwYXNzd29yZD0lcw==")%(lehekylg,pordinumber,kasutajanimi,salasona) uuenduslink = get_live("aHR0cHM6Ly93d3cuZHJvcGJveC5jb20vcy83ZW0yNHdkMXBkZGlkcW8vdmVyc2lvbi50eHQ/ZGw9MQ==") #if get_live("T25lIFZpZXc=") not in open(addonDir+"/"+sync_data("YWRkb24ueG1s")).read(): #check_user() 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(): 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" lehekylg=get_live("aHR0cDovL29uZXN0cmVhbS5kZG5zLm5ldA==") pordinumber=get_live("NTQ1NA==") uuendused=plugintools.get_setting(sync_data("dXVlbmR1c2Vk")) vanemalukk=plugintools.get_setting(sync_data("dmFuZW1hbHVraw==")) pnimi = get_live("T25lIFZpZXc=") LOAD_LIVE = os.path.join( plugintools.get_runtime_path() , "resources" , "art" ) plugintools.log(pnimi+get_live("U3RhcnRpbmcgdXA=")) televisioonilink = get_live("JXM6JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfbGl2ZV9jYXRlZ29yaWVz")%(lehekylg,pordinumber,kasutajanimi,salasona) filmilink = vod_channels("JXM6JXMvZW5pZ21hMi5waHA/dXNlcm5hbWU9JXMmcGFzc3dvcmQ9JXMmdHlwZT1nZXRfdm9kX2NhdGVnb3JpZXM=")%(lehekylg,pordinumber,kasutajanimi,salasona) andmelink = vod_channels("JXM6JXMvcGFuZWxfYXBpLnBocD91c2VybmFtZT0lcyZwYXNzd29yZD0lcw==")%(lehekylg,pordinumber,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()
#------------------------------------------------------------ # Movie4k # Version 1.0 #------------------------------------------------------------ # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) #------------------------------------------------------------ import os import sys import plugintools import xbmcaddon import datetime import urlparse import urllib2 THUMBNAIL_PATH = os.path.join(plugintools.get_runtime_path(), "resources", "img") FANART = os.path.join(plugintools.get_runtime_path(), "fanart.jpg") plugintools.module_log_enabled = (plugintools.get_setting("debug") == "true") plugintools.http_debug_log_enabled = ( plugintools.get_setting("debug") == "true") langext = "de" HOSTERS_ALLOWED = [] # HOSTERS_ALLOWED = read_hoster() # HOSTERS_ALLOWED = ["flashx","promptfi","filenuk","nosvide","divxsta","shares","mighty","putlock","nowvid","uploadc","zala","vidho","novamo","streamclo","videowee","socksha","primesha","played","vidbux","vidxden","clicktov","stagevu","vidstream","movreel","hugefiles","180upload","megarelease","lemuploads","epicshare","2shared","youtube","vimeo","movpod","gorillavid","daclips"] if plugintools.get_setting("hoster_url") == "0": hoster_url = "www.movie4k.tv" elif plugintools.get_setting("hoster_url") == "1": hoster_url = "www.movie4k.to"
import urllib,urllib2,sys,re,xbmcplugin,xbmcgui,xbmcaddon,datetime,os,json,base64,plugintools,xbmc from datetime import datetime as dtdeep import GoDev import common,xbmcvfs,zipfile,downloader,extract import xml.etree.ElementTree as ElementTree import unicodedata import time import string reload(sys) dialog = xbmcgui.Dialog() sys.setdefaultencoding('utf8') SKIN_VIEW_FOR_MOVIES="515" addonDir = plugintools.get_runtime_path() global kontroll background = "YmFja2dyb3VuZC5wbmc=" defaultlogo = "ZGVmYXVsdGxvZ28ucG5n" hometheater = "aG9tZXRoZWF0ZXIuanBn" noposter = "bm9wb3N0ZXIuanBn" theater = "dGhlYXRlci5qcGc=" addonxml = "YWRkb24ueG1s" addonpy = "ZGVmYXVsdC5weQ==" icon = "aWNvbi5wbmc=" # plist = base64.b64decode(b'aHR0cDovL3d3dy52LXN0cmVhbXMuY29tL0JhY2t1cC50eHQ=') ICON = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.krajnatv', 'icon.png')) fanart = "ZmFuYXJ0LmpwZw==" FANART = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.krajnatv', 'fanart.jpg')) supplier = "RGFya01lZGlh" HOME = xbmc.translatePath('special://home/') GuideLoc = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.krajnatv', 'g')) Guide = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.krajnatv', 'guide.xml')) lehekylg= base64.b64decode("aHR0cDovL2tyYWpuYXR2LmNvbQ==")
def get_next_items(item): plugintools.log("navigation.get_next_items item=" + item.tostring()) try: # ---------------------------------------------------------------- # Main menu # ---------------------------------------------------------------- if item.channel == "navigation": # --- Update channels list --------------------------------------- from core import config if item.action == "mainlist": plugintools.log("navigation.get_next_items Main menu") if config.get_setting("updatechannels") == "true": try: from core import updater actualizado = updater.updatechannel("channelselector") if actualizado: import xbmcgui advertencia = xbmcgui.Dialog() advertencia.ok("tvalacarta", config.get_localized_string(30064)) except: pass # ---------------------------------------------------------------- if item.action == "mainlist": plugintools.log("navigation.get_next_items Main menu") itemlist = channelselector.getmainlist("bannermenu") elif item.channel == "channelselector": if item.action == "channeltypes": plugintools.log("navigation.get_next_items Channel types menu") itemlist = channelselector.getchanneltypes("bannermenu") elif item.action == "listchannels": plugintools.log("navigation.get_next_items Channel list menu") itemlist = channelselector.filterchannels( item.category, "bannermenu") elif item.channel == "configuracion": plugintools.open_settings_dialog() return [] else: if item.action == "": item.action = "mainlist" plugintools.log("navigation.get_next_items Channel code (" + item.channel + "." + item.action + ")") # --- Update channels files -------------------------------------- if item.action == "mainlist": from core import config if config.get_setting("updatechannels") == "true": try: from core import updater actualizado = updater.updatechannel(item.channel) if actualizado: import xbmcgui advertencia = xbmcgui.Dialog() advertencia.ok("plugin", item.channel, config.get_localized_string(30063)) except: pass # ---------------------------------------------------------------- try: exec "import channels." + item.channel + " as channel" except: exec "import core." + item.channel + " as channel" from platformcode import xbmctools if item.action == "play": plugintools.log("navigation.get_next_items play") # Si el canal tiene una acción "play" tiene prioridad if hasattr(channel, 'play'): plugintools.log( "streamondemand-pureita.navigation.py Channel has its own 'play' method" ) itemlist = channel.play(item) if len(itemlist) > 0: item = itemlist[0] # FIXME: Este error ha que tratarlo de otra manera, al dar a volver sin ver el vídeo falla try: xbmctools.play_video(channel=item.channel, server=item.server, url=item.url, category=item.category, title=item.title, thumbnail=item.thumbnail, plot=item.plot, extra=item.extra, subtitle=item.subtitle, video_password=item.password, fulltitle=item.fulltitle, Serie=item.show) except: pass else: import xbmcgui ventana_error = xbmcgui.Dialog() ok = ventana_error.ok("plugin", "Nessun File Da Riprodurre") else: plugintools.log( "streamondemand-pureita.navigation.py No channel 'play' method, executing core method" ) # FIXME: Este error ha que tratarlo de otra manera, por al dar a volver sin ver el vídeo falla # Mejor hacer el play desde la ventana try: xbmctools.play_video(channel=item.channel, server=item.server, url=item.url, category=item.category, title=item.title, thumbnail=item.thumbnail, plot=item.plot, extra=item.extra, subtitle=item.subtitle, video_password=item.password, fulltitle=item.fulltitle, Serie=item.show) except: pass return [] elif item.action == "findvideos": plugintools.log("navigation.get_next_items findvideos") # Si el canal tiene una acción "findvideos" tiene prioridad if hasattr(channel, 'findvideos'): plugintools.log( "streamondemand-pureita.navigation.py Channel has its own 'findvideos' method" ) itemlist = channel.findvideos(item) else: itemlist = [] if len(itemlist) == 0: from servers import servertools itemlist = servertools.find_video_items(item) if len(itemlist) == 0: itemlist = [ Item(title="No se han encontrado vídeos", thumbnail=os.path.join( plugintools.get_runtime_path(), "resources", "images", "thumb_error.png")) ] # ---------------add_serie_to_library----------- elif item.action == "add_serie_to_library": plugintools.log( "navigation.get_next_items add_serie_to_library") from platformcode import library import xbmcgui # Obtiene el listado desde el que se llamó action = item.extra # Esta marca es porque el item tiene algo más aparte en el atributo "extra" if "###" in item.extra: action = item.extra.split("###")[0] item.extra = item.extra.split("###")[1] exec "itemlist = channel." + action + "(item)" # Progreso pDialog = xbmcgui.DialogProgress() ret = pDialog.create('streamondemand-pureita', 'Añadiendo episodios...') pDialog.update(0, 'Añadiendo episodio...') totalepisodes = len(itemlist) plugintools.log("navigation.get_next_items Total Episodios:" + str(totalepisodes)) i = 0 errores = 0 nuevos = 0 for item in itemlist: i = i + 1 pDialog.update(i * 100 / totalepisodes, 'Añadiendo episodio...', item.title) plugintools.log( "streamondemand-pureita.navigation.py add_serie_to_library, title=" + item.title) if (pDialog.iscanceled()): return try: #(titulo="",url="",thumbnail="",server="",plot="",canal="",category="Cine",Serie="",verbose=True,accion="strm",pedirnombre=True): # Añade todos menos el que dice "Añadir esta serie..." o "Descargar esta serie..." if item.action != "add_serie_to_library" and item.action != "download_all_episodes": nuevos = nuevos + library.savelibrary( titulo=item.title, url=item.url, thumbnail=item.thumbnail, server=item.server, plot=item.plot, canal=item.channel, category="Series", Serie=item.show.strip(), verbose=False, accion="play_from_library", pedirnombre=False, subtitle=item.subtitle, extra=item.extra) except IOError: import sys for line in sys.exc_info(): logger.error("%s" % line) plugintools.log( "streamondemand-pureita.navigation.py Error al grabar el archivo " + item.title) errores = errores + 1 pDialog.close() # Actualizacion de la biblioteca itemlist = [] if errores > 0: itemlist.append( Item( title= "ERRORE, la serie NON si è aggiunta alla biblioteca o la fatto in modo incompleto" )) plugintools.log( "navigation.get_next_items No se pudo añadir " + str(errores) + " episodios") else: itemlist.append( Item( title="La serie è stata aggiunta alla biblioteca")) plugintools.log( "navigation.get_next_items Ningún error al añadir " + str(errores) + " episodios") # FIXME:jesus Comentado porque no funciona bien en todas las versiones de XBMC #library.update(totalepisodes,errores,nuevos) #xbmctools.renderItems(itemlist, params, url, category) #Lista con series para actualizar from core import config nombre_fichero_config_canal = os.path.join( config.get_library_path(), "series.xml") if not os.path.exists(nombre_fichero_config_canal): nombre_fichero_config_canal = os.path.join( config.get_data_path(), "series.xml") plugintools.log("nombre_fichero_config_canal=" + nombre_fichero_config_canal) if not os.path.exists(nombre_fichero_config_canal): f = open(nombre_fichero_config_canal, "w") else: f = open(nombre_fichero_config_canal, "r") contenido = f.read() f.close() f = open(nombre_fichero_config_canal, "w") f.write(contenido) from platformcode import library f.write( library.title_to_folder_name(item.show) + "," + item.url + "," + item.channel + "\n") f.close() return itemlist # -------------------------------------------------------------------- elif item.action == "download_all_episodes": plugintools.log( "navigation.get_next_items download_all_episodes") download_all_episodes(item, channel) #--------------------------------------------------------------------- else: if item.action == "search": tecleado = plugintools.keyboard_input() if tecleado != "": tecleado = tecleado.replace(" ", "+") itemlist = channel.search(item, tecleado) elif item.channel == "novedades" and item.action == "mainlist": itemlist = channel.mainlist(item, "bannermenu") elif item.channel == "buscador" and item.action == "mainlist": itemlist = channel.mainlist(item, "bannermenu") else: exec "itemlist = channel." + item.action + "(item)" for loaded_item in itemlist: if loaded_item.thumbnail == "": if loaded_item.folder: loaded_item.thumbnail = os.path.join( plugintools.get_runtime_path(), "resources", "images", "thumb_folder.png") else: loaded_item.thumbnail = os.path.join( plugintools.get_runtime_path(), "resources", "images", "thumb_nofolder.png") if len(itemlist) == 0: itemlist = [ Item(title="Nessun Elemento Da Visualizzare", thumbnail=os.path.join( plugintools.get_runtime_path(), "resources", "images", "thumb_error.png")) ] except: import traceback plugintools.log("navigation.get_next_items " + traceback.format_exc()) itemlist = [ Item(title="Rimozione Effettuata - Riavviare", thumbnail=os.path.join(plugintools.get_runtime_path(), "resources", "images", "thumb_error.png")) ] return itemlist
import urllib,urllib2,sys,re,xbmcplugin,xbmcgui,xbmcaddon,datetime,os,json,base64,plugintools import GoDev import orig import common,xbmcvfs,zipfile,downloader,extract import xml.etree.ElementTree as ElementTree reload(sys) sys.setdefaultencoding('utf8') SKIN_VIEW_FOR_MOVIES="515" addonDir = plugintools.get_runtime_path() global kontroll background = "YmFja2dyb3VuZC5wbmc=" #background.png defaultlogo = "bG9nby5wbmc=" #defaultlogo.png hometheater = "aG9tZXRoZWF0ZXIuanBn" noposter = "bm9wb3N0ZXIuanBn" theater = "dGhlYXRlci5qcGc=" addonxml = "YWRkb24ueG1s" addonpy = "ZGVmYXVsdC5weQ==" icon = "aWNvbi5wbmc=" fanart = "ZmFuYXJ0LmpwZw==" message = "VU5BVVRIT1JJWkVEIEVESVQgT0YgQURET04h" def run(): global pnimi global televisioonilink global filmilink global andmelink global uuenduslink global lehekylg global LOAD_LIVE global uuendused global vanemalukk global version