def mode_subcheck(mode='',site='',section='',url=''): #if (mode=='SectionMenu'): SectionMenu() #(site) deb('mode',mode); if (mode=='SectionMenu'): SectionMenu() elif (mode=='') or (mode=='main') or (mode=='MainMenu'): SectionMenu() elif (mode=='SubMenu'): SubMenu() elif (mode=='VidPlay'): VidPlay(addpr('title',''),url,thumbnail) elif (mode=='Hosts'): Browse_Hosts(url,addpr('title',''),thumbnail) # elif (mode=='BrowseLatestEpisodes'): Browse_LatestEpisodes(addpr('title','')) elif (mode=='BrowseOngoing'): Browse_Ongoing() elif (mode=='Listings'): Browse_List(url) # elif (mode=='Page'): Browse_Page(url=url,page=page,metamethod=addpr('metamethod','')) #(site,section) elif (mode=='Episodes'): Browse_Episodes(url,page) elif (mode=='AZ'): Browse_AZ() elif (mode=='Genres'): Browse_Genres() elif (mode=='PlayFromHost'): PlayFromHost(url) elif (mode=='Search'): Search_Site(title=addpr('title',''),url=url,page=page,metamethod=addpr('metamethod','')) #(site,section) ### \/ Testing \/ #elif (mode=='SearchLast'): # Search_Site(title=addst('LastSearchTitle'+SiteTag),url=url,page=page,metamethod=addpr('metamethod',''),endit=tfalse(addpr('endit','true'))) #(site,section) # Search_Site(title=addst('LastSearchTitle'+SiteTag),url=url,page=page,metamethod=addpr('metamethod',''),endit=True) #(site,section) elif (mode=='SearchLast'): Search_Site(title=addst('LastSearchTitle'+SiteTag),url=url,page=page,metamethod=addpr('metamethod',''),endit=tfalse(addpr('endit','true'))) #(site,section) elif (mode=='About'): About() elif (mode=='FavoritesList'): Fav_List(site=site,section=section,subfav=addpr('subfav','')) #else: myNote(header='Site: "'+site+'"',msg=mode+' (mode) not found.'); import mMain ## elif (mode=='PlayURL'): PlayURL(url) elif (mode=='PlayURLs'): PlayURLs(url) elif (mode=='PlayURLstrm'): PlayURLstrm(url) elif (mode=='PlayFromHost'): PlayFromHost(url) elif (mode=='PlayVideo'): PlayVideo(url) elif (mode=='PlayItCustom'): PlayItCustom(url,addpr('streamurl',''),addpr('img',''),addpr('title','')) elif (mode=='PlayItCustomL2A'): PlayItCustomL2A(url,addpr('streamurl',''),addpr('img',''),addpr('title','')) elif (mode=='Settings'): _addon.addon.openSettings() # Another method: _plugin.openSettings() ## Settings for this addon. elif (mode=='ResolverSettings'): import urlresolver; urlresolver.display_settings() ## Settings for UrlResolver script.module. elif (mode=='ResolverUpdateHostFiles'): import urlresolver; urlresolver.display_settings() ## Settings for UrlResolver script.module. elif (mode=='TextBoxFile'): TextBox2().load_file(url,addpr('title','')); #eod() elif (mode=='TextBoxUrl'): TextBox2().load_url(url,addpr('title','')); #eod() elif (mode=='Download'): try: _addon.resolve_url(url) except: pass debob([url,addpr('destfile',''),addpr('destpath',''),str(tfalse(addpr('useResolver','true')))]) DownloadThis(url,addpr('destfile',''),addpr('destpath',''),tfalse(addpr('useResolver','true'))) elif (mode=='toJDownloader'): SendTo_JDownloader(url,tfalse(addpr('useResolver','true'))) elif (mode=='cFavoritesEmpty'): fav__COMMON__empty( site=site,section=section,subfav=addpr('subfav','') ); xbmc.executebuiltin("XBMC.Container.Refresh"); elif (mode=='cFavoritesRemove'): fav__COMMON__remove( site=site,section=section,subfav=addpr('subfav',''),name=addpr('title',''),year=addpr('year','') ) elif (mode=='cFavoritesAdd'): fav__COMMON__add( site=site,section=section,subfav=addpr('subfav',''),name=addpr('title',''),year=addpr('year',''),img=addpr('img',''),fanart=addpr('fanart',''),plot=addpr('plot',''),commonID=addpr('commonID',''),commonID2=addpr('commonID2',''),ToDoParams=addpr('todoparams',''),Country=addpr('country',''),Genres=addpr('genres',''),Url=url ) #,=addpr('',''),=addpr('','') elif (mode=='AddVisit'): try: visited_add(addpr('title')); RefreshList(); except: pass elif (mode=='RemoveVisit'): try: visited_remove(addpr('title')); RefreshList(); except: pass elif (mode=='EmptyVisit'): try: visited_empty(); RefreshList(); except: pass elif (mode=='refresh_meta'): refresh_meta(addpr('video_type',''),TagAnimeName(addpr('title','')),addpr('imdb_id',''),addpr('alt_id',''),addpr('year','')) else: myNote(header='Site: "'+site+'"',msg=mode+' (mode) not found.'); import mMain
def mode_subcheck(mode='',site='',section='',url=''): try: debob({'mode':mode,'url':url,'title':addpr('title','')}) except: pass if (mode=='SectionMenu'): MenuSection() elif (mode=='') or (mode=='main') or (mode=='MainMenu'): MenuSection() elif (mode=='SubMenu'): MenuSub() elif (mode=='MenuSpecial'): MenuSpecial(url) elif (mode=='MenuDevFeatured'): MenuDevFeatured() elif (mode=='MenuBrowse'): MenuBrowse() elif (mode=='MenuTopBar'): MenuTopBar() ## #MenuListChannels(Url,Page='',TyPE='js',idList='[]', csrfToken='') elif (mode=='ListShows'): MenuListChannels(url,addpr('page',''),addpr('type',''),addpr('idlist',''),addpr('csrfToken','')) elif (mode=='BrowseCat'): MenuListChannels(mainSite+"/app/topbar.php?s=vl%s" % addpr('cat',''),addpr('page',''),addpr('type',''),addpr('idlist','')) elif (mode=='BrowseCat2'): MenuListChannels(mainSite+"/app/topbar.php?s=%s" % addpr('cat',''),addpr('page',''),addpr('type',''),addpr('idlist','')) elif (mode=='BrowseCat3'): MenuListChannels(mainSite+"/browse/%s?a=mvn" % addpr('cat',''),addpr('page',''),addpr('type',''),addpr('idlist','')) elif (mode=='BrowseCat4'): MenuListChannels(mainSite+"/browse/%s" % addpr('cat',''),addpr('page',''),addpr('type',''),addpr('idlist','')) elif (mode=='Search'): DoSearch(addpr('title',''),url) elif (mode=='History101'): MenuHistory101() elif (mode=='PlayLiveStream'): PlayLiveStream(url,addpr('title',''),addpr('img',''),addpr('channel',''),addpr('roomid',''),addpr('roomslug',''),addpr('plot',''),addpr('live',''),addpr('streamurl',''),addpr('streamkey',''),addpr('youtubeid',''),addpr('sourcetype','show')) # elif (mode=='BrowseUrl'): XBMC_System_Exec('"%s"' % url) elif (mode=='FavoritesList'): Fav_List(site=site,section=section,subfav=addpr('subfav','')) elif (mode=='About'): eod(); DoA('Back'); About(); elif (mode=='PlayPICTURES'): PlayPictures(url) elif (mode=='PlayURL'): PlayURL(url) elif (mode=='PlayURLs'): PlayURLs(url) elif (mode=='PlayURLstrm'): PlayURLstrm(url) elif (mode=='PlayFromHost'): PlayFromHost(url) elif (mode=='PlayVideo'): PlayVideo(url) elif (mode=='PlayItCustom'): PlayItCustom(url,addpr('streamurl',''),addpr('img',''),addpr('title','')) elif (mode=='PlayItCustomL2A'): PlayItCustomL2A(url,addpr('streamurl',''),addpr('img',''),addpr('title','')) elif (mode=='Settings'): _addon.addon.openSettings() # Another method: _plugin.openSettings() ## Settings for this addon. elif (mode=='ResolverSettings'): import urlresolver; urlresolver.display_settings() ## Settings for UrlResolver script.module. elif (mode=='ResolverUpdateHostFiles'): import urlresolver; urlresolver.display_settings() ## Settings for UrlResolver script.module. elif (mode=='TextBoxFile'): TextBox2().load_file(url,addpr('title','')); #eod() elif (mode=='TextBoxUrl'): TextBox2().load_url(url,addpr('title','')); #eod() elif (mode=='Download'): try: _addon.resolve_url(url) except: pass debob([url,addpr('destfile',''),addpr('destpath',''),str(tfalse(addpr('useResolver','true')))]) DownloadThis(url,addpr('destfile',''),addpr('destpath',''),tfalse(addpr('useResolver','true'))) elif (mode=='toJDownloader'): SendTo_JDownloader(url,tfalse(addpr('useResolver','true'))) elif (mode=='cFavoritesEmpty'): fav__COMMON__empty( site=site,section=section,subfav=addpr('subfav','') ); xbmc.executebuiltin("XBMC.Container.Refresh"); elif (mode=='cFavoritesRemove'): fav__COMMON__remove( site=site,section=section,subfav=addpr('subfav',''),name=addpr('title',''),year=addpr('year','') ) elif (mode=='cFavoritesAdd'): fav__COMMON__add( site=site,section=section,subfav=addpr('subfav',''),name=addpr('title',''),year=addpr('year',''),img=addpr('img',''),fanart=addpr('fanart',''),plot=addpr('plot',''),commonID=addpr('commonID',''),commonID2=addpr('commonID2',''),ToDoParams=addpr('todoparams',''),Country=addpr('country',''),Genres=addpr('genres',''),Url=url ) #,=addpr('',''),=addpr('','') elif (mode=='AddVisit'): try: visited_add(addpr('title')); RefreshList(); except: pass elif (mode=='RemoveVisit'): try: visited_remove(addpr('title')); RefreshList(); except: pass elif (mode=='EmptyVisit'): try: visited_empty(); RefreshList(); except: pass elif (mode=='refresh_meta'): refresh_meta(addpr('video_type',''),addpr('title',''),addpr('imdb_id',''),addpr('alt_id',''),addpr('year','')) else: myNote(header='Site: "'+site+'"',msg=mode+' (mode) not found.'); #MenuSection()
def check_mode(mode=''): deb('Mode',mode) if (mode=='') or (mode=='main') or (mode=='MainMenu'): Menu_MainMenu() ## Default Menu elif (mode=='PlayURL'): PlayURL(_param['url']) ## Play Video elif (mode=='ASubMenu'): Just_A_Sub_Menu(_param['title']) ## Play Video elif (mode=='Settings'): _addon.addon.openSettings() # Another method: _plugin.openSettings() ## Settings for this addon. elif (mode=='ResolverSettings'): urlresolver.display_settings() ## Settings for UrlResolver script.module. # # #elif (mode=='YourMode'): YourFunction(_param['url']) # # # else: myNote(header='Mode: "'+mode+'"',msg='[ mode ] not found.'); Menu_MainMenu() ## So that if a mode isn't found, it'll goto the Main Menu and give you a message about it.
def mode_subcheck(mode='',site='',section='',url=''): if (mode=='SectionMenu'): SectionMenu() elif (mode=='') or (mode=='main') or (mode=='MainMenu'): SectionMenu() elif (mode=='SubMenu'): SubMenu() elif (mode=='SpecialMenu'): SpecialMenu(url) elif (mode=='DevFeaturedMenu'): DevFeaturedMenu() elif (mode=='BrowseMenu'): BrowseMenu() elif (mode=='ListShows'): ListShows(url,addpr('page',''),addpr('type',''),addpr('idlist',''),addpr('csrfToken','')) elif (mode=='BrowseCat'): ListShows("https://streamup.com/rooms/%s.js" % addpr('cat',''),addpr('page',''),addpr('type',''),addpr('idlist','')) elif (mode=='BrowseCat2'): ListShows("https://streamup.com/%s.js" % addpr('cat',''),addpr('page',''),addpr('type',''),addpr('idlist','')) elif (mode=='Search'): DoSearch(addpr('title',''),url) elif (mode=='PlayStreamUP'): PlayStreamUP(url,addpr('subfav','title'),addpr('subfav','img'),addpr('roomid',''),addpr('roomslug',''),addpr('plot',''),addpr('live',''),addpr('streamurl',''),addpr('streamkey','')) # elif (mode=='FavoritesList'): Fav_List(site=site,section=section,subfav=addpr('subfav','')) elif (mode=='About'): eod(); About() elif (mode=='PlayURL'): PlayURL(url) elif (mode=='PlayURLs'): PlayURLs(url) elif (mode=='PlayURLstrm'): PlayURLstrm(url) elif (mode=='PlayFromHost'): PlayFromHost(url) elif (mode=='PlayVideo'): PlayVideo(url) elif (mode=='PlayItCustom'): PlayItCustom(url,addpr('streamurl',''),addpr('img',''),addpr('title','')) elif (mode=='PlayItCustomL2A'): PlayItCustomL2A(url,addpr('streamurl',''),addpr('img',''),addpr('title','')) elif (mode=='Settings'): _addon.addon.openSettings() # Another method: _plugin.openSettings() ## Settings for this addon. elif (mode=='ResolverSettings'): import urlresolver; urlresolver.display_settings() ## Settings for UrlResolver script.module. elif (mode=='ResolverUpdateHostFiles'): import urlresolver; urlresolver.display_settings() ## Settings for UrlResolver script.module. elif (mode=='TextBoxFile'): TextBox2().load_file(url,addpr('title','')); #eod() elif (mode=='TextBoxUrl'): TextBox2().load_url(url,addpr('title','')); #eod() elif (mode=='Download'): try: _addon.resolve_url(url) except: pass debob([url,addpr('destfile',''),addpr('destpath',''),str(tfalse(addpr('useResolver','true')))]) DownloadThis(url,addpr('destfile',''),addpr('destpath',''),tfalse(addpr('useResolver','true'))) elif (mode=='toJDownloader'): SendTo_JDownloader(url,tfalse(addpr('useResolver','true'))) elif (mode=='cFavoritesEmpty'): fav__COMMON__empty( site=site,section=section,subfav=addpr('subfav','') ); xbmc.executebuiltin("XBMC.Container.Refresh"); elif (mode=='cFavoritesRemove'): fav__COMMON__remove( site=site,section=section,subfav=addpr('subfav',''),name=addpr('title',''),year=addpr('year','') ) elif (mode=='cFavoritesAdd'): fav__COMMON__add( site=site,section=section,subfav=addpr('subfav',''),name=addpr('title',''),year=addpr('year',''),img=addpr('img',''),fanart=addpr('fanart',''),plot=addpr('plot',''),commonID=addpr('commonID',''),commonID2=addpr('commonID2',''),ToDoParams=addpr('todoparams',''),Country=addpr('country',''),Genres=addpr('genres',''),Url=url ) #,=addpr('',''),=addpr('','') elif (mode=='AddVisit'): try: visited_add(addpr('title')); RefreshList(); except: pass elif (mode=='RemoveVisit'): try: visited_remove(addpr('title')); RefreshList(); except: pass elif (mode=='EmptyVisit'): try: visited_empty(); RefreshList(); except: pass elif (mode=='refresh_meta'): refresh_meta(addpr('video_type',''),addpr('title',''),addpr('imdb_id',''),addpr('alt_id',''),addpr('year','')) else: myNote(header='Site: "'+site+'"',msg=mode+' (mode) not found.'); import mMain
def mode_subcheck(mode='',site='',section='',url=''): deb('mode',mode); if (mode=='SectionMenu'): SectionMenu() elif (mode=='') or (mode=='main') or (mode=='MainMenu'): SectionMenu() elif (mode=='SectionMenuEnglish'): SectionMenuEnglish(addpr('tag','')) elif (mode=='AddUrlToList'): AddUrlToList(url=url) elif (mode=='RemoveUrlToList'): RemoveUrlToList(url=url) elif (mode=='About'): About() elif (mode=='CustomUpdate'): Update_CustomUpdate(addpr('path',''),addpr('filename','')) ## elif (mode=='PlayURL'): PlayURL(url) elif (mode=='PlayURLs'): PlayURLs(url) elif (mode=='PlayURLstrm'): PlayURLstrm(url) elif (mode=='PlayFromHost'): PlayFromHost(url) elif (mode=='PlayVideo'): PlayVideo(url) elif (mode=='PlayItCustom'): PlayItCustom(url,addpr('streamurl',''),addpr('img',''),addpr('title','')) elif (mode=='PlayItCustomL2A'): PlayItCustomL2A(url,addpr('streamurl',''),addpr('img',''),addpr('title','')) elif (mode=='Settings'): _addon.addon.openSettings() # Another method: _plugin.openSettings() ## Settings for this addon. elif (mode=='ResolverSettings'): import urlresolver; urlresolver.display_settings() ## Settings for UrlResolver script.module. elif (mode=='ResolverUpdateHostFiles'): import urlresolver; urlresolver.display_settings() ## Settings for UrlResolver script.module. elif (mode=='TextBoxFile'): TextBox2().load_file(url,addpr('title','')); #eod() elif (mode=='TextBoxUrl'): TextBox2().load_url(url,addpr('title','')); #eod() elif (mode=='Download'): try: _addon.resolve_url(url) except: pass debob([url,addpr('destfile',''),addpr('destpath',''),str(tfalse(addpr('useResolver','true')))]) DownloadThis(url,addpr('destfile',''),addpr('destpath',''),tfalse(addpr('useResolver','true'))) elif (mode=='toJDownloader'): SendTo_JDownloader(url,tfalse(addpr('useResolver','true'))) elif (mode=='cFavoritesEmpty'): fav__COMMON__empty( site=site,section=section,subfav=addpr('subfav','') ); xbmc.executebuiltin("XBMC.Container.Refresh"); elif (mode=='cFavoritesRemove'): fav__COMMON__remove( site=site,section=section,subfav=addpr('subfav',''),name=addpr('title',''),year=addpr('year','') ) elif (mode=='cFavoritesAdd'): fav__COMMON__add( site=site,section=section,subfav=addpr('subfav',''),name=addpr('title',''),year=addpr('year',''),img=addpr('img',''),fanart=addpr('fanart',''),plot=addpr('plot',''),commonID=addpr('commonID',''),commonID2=addpr('commonID2',''),ToDoParams=addpr('todoparams',''),Country=addpr('country',''),Genres=addpr('genres',''),Url=url ) #,=addpr('',''),=addpr('','') elif (mode=='AddVisit'): try: visited_add(addpr('title')); RefreshList(); except: pass elif (mode=='RemoveVisit'): try: visited_remove(addpr('title')); RefreshList(); except: pass elif (mode=='EmptyVisit'): try: visited_empty(); RefreshList(); except: pass elif (mode=='refresh_meta'): refresh_meta(addpr('video_type',''),TagAnimeName(addpr('title','')),addpr('imdb_id',''),addpr('alt_id',''),addpr('year','')) else: myNote(header='Site: "'+site+'"',msg=mode+' (mode) not found.'); import mMain
def check_mode(mode='',site='',section='',url=''): deb('Mode',mode); deb('param >> site',site); deb('param >> section',section); deb('param >> url',url); deb('param >> title',addpr('title','')) if (mode=='') or (mode=='main') or (mode=='MainMenu'): if (site==''): import mMain; return if (mode=='PlayURL'): PlayURL(url) elif (mode=='PlayURLs'): PlayURLs(url) elif (mode=='PlayURLstrm'): PlayURLstrm(url) elif (mode=='PlayFromHost'): PlayFromHost(url) elif (mode=='PlayVideo'): PlayVideo(url) elif (mode=='PlayItCustom'): PlayItCustom(url,addpr('streamurl',''),addpr('img',''),addpr('title','')) elif (mode=='PlayItCustomL2A'): PlayItCustomL2A(url,addpr('streamurl',''),addpr('img',''),addpr('title','')) elif (mode=='Settings'): _addon.addon.openSettings() # Another method: _plugin.openSettings() ## Settings for this addon. elif (mode=='ResolverSettings'): import urlresolver; urlresolver.display_settings() ## Settings for UrlResolver script.module. elif (mode=='ResolverUpdateHostFiles'): import urlresolver; urlresolver.display_settings() ## Settings for UrlResolver script.module. elif (mode=='TextBoxFile'): TextBox2().load_file(url,addpr('title','')); #eod() elif (mode=='TextBoxUrl'): TextBox2().load_url(url,addpr('title','')); #eod() elif (mode=='Download'): try: _addon.resolve_url(url) except: pass debob([url,addpr('destfile',''),addpr('destpath',''),str(tfalse(addpr('useResolver','true')))]) DownloadThis(url,addpr('destfile',''),addpr('destpath',''),tfalse(addpr('useResolver','true'))) elif (mode=='toJDownloader'): SendTo_JDownloader(url,tfalse(addpr('useResolver','true'))) elif (mode=='cFavoritesEmpty'): fav__COMMON__empty( site=site,section=section,subfav=addpr('subfav','') ) elif (mode=='cFavoritesRemove'): fav__COMMON__remove( site=site,section=section,subfav=addpr('subfav',''),name=addpr('title',''),year=addpr('year','') ) elif (mode=='cFavoritesAdd'): fav__COMMON__add( site=site,section=section,subfav=addpr('subfav',''),name=addpr('title',''),year=addpr('year',''),img=addpr('img',''),fanart=addpr('fanart',''),plot=addpr('plot',''),commonID=addpr('commonid',''),commonID2=addpr('commonid2',''),ToDoParams=addpr('todoparams',''),Country=addpr('country',''),Genres=addpr('genres',''),Url=url ) #,=addpr('',''),=addpr('','') else: ### Handle importing .py file for the right site. siteL=site.lower() debob(xbmc.translatePath(os.path.join(_addonPath,site+'.py'))) if (siteL=='others'): import mOthers elif (siteL=='misc'): import mMisc elif (siteL=='mMovies_and_TV'): import mMovies_and_TV elif (siteL=='mAnime'): import mAnime elif (siteL=='mLiveStreams'): import mLiveStreams elif (siteL=='resolverplugins'): import mResolverPlugins # elif isFile(xbmc.translatePath(os.path.join(_addonPath,site+'.py')))==True: __import__(site) else: myNote(header='Mode: "'+mode+'"',msg=site+' (site) not found.'); import mMain; return
def urlresolver_settings(): urlresolver.display_settings()
def ShowResolverSettingsDialog(): urlresolver.display_settings()
def ResolverSettings(): urlresolver.display_settings()
except:pass try: iconimage = urllib.unquote_plus(params["iconimage"]) except:pass try:totalitems = int(params["totalitems"]) except:pass try: folder = urllib.unquote_plus(params["folder"]) except:pass xbmc.log('Mode: '+str(mode)) xbmc.log('Url: '+str(url)) xbmc.log('Metaname: '+str(metaname)) xbmc.log('Types: '+str(types)) xbmc.log('Name: '+str(name)) xbmc.log('Iconimage: '+str(iconimage)) xbmc.log('Folder: '+str(folder)) if mode == None or url == None or len(url)<1: MAIN() elif mode == 1:TvShows() elif mode == 2: urlresolver.display_settings() elif mode == 100:Index(url, types) elif mode == 150:FindHosts(url, name) elif mode == 200:Search() xbmcplugin.endOfDirectory(int(sys.argv[1]),succeeded=True)
def get_urlresolver_settings(): import urlresolver urlresolver.display_settings() return
trailer.trailer().play(name, url, windowedtrailer) elif action == 'traktManager': from resources.lib.modules import trakt trakt.manager(name, imdb, tvdb, content) elif action == 'authTrakt': from resources.lib.modules import trakt trakt.authTrakt() elif action == 'urlResolver': try: import urlresolver except: pass urlresolver.display_settings() elif action == 'urlResolverRDTorrent': from resources.lib.modules import control control.openSettings(query, "script.module.urlresolver") elif action == 'download': import json from resources.lib.modules import sources from resources.lib.modules import downloader try: downloader.download( name, image, sources.sources().sourcesResolve(json.loads(source)[0], True)) except: pass
def parseUrl(): import urlparse netloc = [urlparse.urlparse(sys.argv[0]).netloc, ''] if xbmc.getInfoLabel('Container.PluginName') not in netloc: sys.exit() return params = ParameterHandler() logger.info(params.getAllParameters()) # If no function is set, we set it to the default "load" function if params.exist('function'): sFunction = params.getValue('function') if sFunction == 'spacer': return True elif sFunction == 'clearCache': from resources.lib.handler.requestHandler import cRequestHandler cRequestHandler('dummy').clearCache() return elif sFunction == 'changeWatched': changeWatched(params) return elif sFunction == 'updateMeta': updateMeta(params) return elif sFunction == 'searchAlter': searchAlter(params) return elif sFunction == 'updateXstream': from resources.lib import updateManager updateManager.xStreamUpdate() return elif sFunction == 'updateUrlResolver': from resources.lib import updateManager updateManager.urlResolverUpdate() return elif sFunction == 'updateAll': from resources.lib import updateManager updateManager.xStreamUpdate() updateManager.urlResolverUpdate() return elif params.exist('remoteplayurl'): try: import urlresolver remotePlayUrl = params.getValue('remoteplayurl') sLink = urlresolver.resolve(remotePlayUrl) if sLink: xbmc.executebuiltin("PlayMedia(" + sLink + ")") else: logger.info("Could not play remote url '%s'" % (sLink)) except urlresolver.resolver.ResolverError as e: logger.info('ResolverError: %s' % e) return else: sFunction = 'load' # Test if we should run a function on a special site if not params.exist('site'): xbmc.executebuiltin('XBMC.RunPlugin(%s?function=clearCache)' % sys.argv[0]) xStreamUpdate = True if cConfig().getSetting( 'githubUpdateXstream') == 'true' else False urlResolverUpdate = True if cConfig().getSetting( 'githubUpdateUrlResolver') == 'true' else False if xStreamUpdate and urlResolverUpdate: xbmc.executebuiltin('XBMC.RunPlugin(%s?function=updateAll)' % sys.argv[0]) elif xStreamUpdate: xbmc.executebuiltin('XBMC.RunPlugin(%s?function=updateXstream)' % sys.argv[0]) elif urlResolverUpdate: xbmc.executebuiltin( 'XBMC.RunPlugin(%s?function=updateUrlResolver)' % sys.argv[0]) # As a default if no site was specified, we run the default starting gui with all plugins showMainMenu(sFunction) return sSiteName = params.getValue('site') if params.exist('playMode'): from resources.lib.gui.hoster import cHosterGui url = False playMode = params.getValue('playMode') isHoster = params.getValue('isHoster') url = params.getValue('url') manual = params.exist('manual') if cConfig().getSetting( 'hosterSelect' ) == 'Auto' and playMode != 'jd' and playMode != 'jd2' and playMode != 'pyload' and not manual: cHosterGui().streamAuto(playMode, sSiteName, sFunction) else: cHosterGui().stream(playMode, sSiteName, sFunction, url) return logger.info("Call function '%s' from '%s'" % (sFunction, sSiteName)) # If the hoster gui is called, run the function on it and return if sSiteName == 'cHosterGui': showHosterGui(sFunction) # If global search is called elif sSiteName == 'globalSearch': searchterm = False if params.exist('searchterm'): searchterm = params.getValue('searchterm') searchGlobal(searchterm) elif sSiteName == 'favGui': showFavGui(sFunction) # If addon settings are called elif sSiteName == 'xStream': oGui = cGui() oGui.openSettings() oGui.updateDirectory() # If the urlresolver settings are called elif sSiteName == 'urlresolver': import urlresolver urlresolver.display_settings() # If metahandler settings are called elif sSiteName == 'metahandler': import metahandler metahandler.display_settings() elif sSiteName == 'settings': oGui = cGui() for folder in settingsGuiElements(): oGui.addFolder(folder) oGui.setEndOfDirectory() else: # Else load any other site as plugin and run the function plugin = __import__(sSiteName, globals(), locals()) function = getattr(plugin, sFunction) function()
def parseUrl(): params = ParameterHandler() # If no function is set, we set it to the default "load" function if params.exist('function'): sFunction = params.getValue('function') if sFunction == 'spacer': return True elif sFunction == 'clearCache': from resources.lib.handler.requestHandler import cRequestHandler cRequestHandler('dummy').clearCache() return elif sFunction == 'changeWatched': changeWatched(params) return elif sFunction == 'updateMeta': updateMeta(params) return else: sFunction = 'load' # Test if we should run a function on a special site if params.exist('site'): sSiteName = params.getValue('site') logger.info(params.getAllParameters()) if params.exist('playMode'): from resources.lib.gui.hoster import cHosterGui url = False playMode = params.getValue('playMode') isHoster = params.getValue('isHoster') if isHoster == 'true': url = params.getValue('url') if cConfig().getSetting( 'autoPlay' ) == 'true' and playMode != 'jd' and playMode != 'pyload': cHosterGui().streamAuto(playMode, sSiteName, sFunction) else: cHosterGui().stream(playMode, sSiteName, sFunction, url) return else: logger.info("Call function '%s' from '%s'" % (sFunction, sSiteName)) # If the hoster gui is called, run the function on it and return if sSiteName == 'cHosterGui': showHosterGui(sFunction) return # If global search is called elif sSiteName == 'globalSearch': searchGlobal() return elif sSiteName == 'favGui': showFavGui(sFunction) return # If addon settings are called elif sSiteName == 'xStream': oGui = cGui() oGui.openSettings() oGui.updateDirectory() return # If the urlresolver settings are called elif sSiteName == 'urlresolver': import urlresolver urlresolver.display_settings() return # If metahandler settings are called elif sSiteName == 'metahandler': import metahandler metahandler.display_settings() return else: # Else load any other site as plugin and run the function plugin = __import__(sSiteName, globals(), locals()) function = getattr(plugin, sFunction) function() else: xbmc.executebuiltin('XBMC.RunPlugin(%s?function=clearCache)' % sys.argv[0]) # As a default if no site was specified, we run the default starting gui with all plugins showMainMenu(sFunction)
if (keyboard.isConfirmed()): query = keyboard.getText() addon.save_data('search',query) Search(section, query) else: return def Search(section, query): url = BASE_URL + '/?s=' + query print url GetTitles(section, url, startPage= '1', numOfPages= '1') if mode == 'main': MainMenu() elif mode == 'BrowseGenre': BrowseGenre(content) elif mode == 'GetTitles': GetTitles(section, url, startPage, numOfPages) elif mode == 'GetLinks': GetLinks(section, url) elif mode == 'GetSearchQuery': GetSearchQuery(section) elif mode == 'Search': Search(query) elif mode == 'Categories': Categories(section) elif mode == 'ResolverSettings': urlresolver.display_settings() elif mode == 'PlayVideo': PlayVideo(url, listitem)
def action_get_urlresolver_settings(self): urlresolver.display_settings()
def parseUrl(): params = ParameterHandler() # If no function is set, we set it to the default "load" function if params.exist('function'): sFunction = params.getValue('function') if sFunction == 'spacer': return True elif sFunction == 'clearCache': from resources.lib.handler.requestHandler import cRequestHandler cRequestHandler('dummy').clearCache() return elif sFunction == 'changeWatched': changeWatched(params) return elif sFunction == 'updateMeta': updateMeta(params) return elif sFunction == 'searchAlter': searchAlter(params) return else: sFunction = 'load' # Test if we should run a function on a special site if not params.exist('site'): xbmc.executebuiltin('XBMC.RunPlugin(%s?function=clearCache)' % sys.argv[0]) # As a default if no site was specified, we run the default starting gui with all plugins showMainMenu(sFunction) return sSiteName = params.getValue('site') logger.info (params.getAllParameters()) if params.exist('playMode'): from resources.lib.gui.hoster import cHosterGui url = False playMode = params.getValue('playMode') isHoster = params.getValue('isHoster') url = params.getValue('url') manual = params.exist('manual') if cConfig().getSetting('hosterSelect')=='auto' and playMode != 'jd' and playMode != 'pyload' and not manual: cHosterGui().streamAuto(playMode, sSiteName, sFunction) else: cHosterGui().stream(playMode, sSiteName, sFunction, url) return logger.info("Call function '%s' from '%s'" % (sFunction, sSiteName)) # If the hoster gui is called, run the function on it and return if sSiteName == 'cHosterGui': showHosterGui(sFunction) # If global search is called elif sSiteName == 'globalSearch': searchGlobal() elif sSiteName == 'favGui': showFavGui(sFunction) # If addon settings are called elif sSiteName == 'xStream': oGui = cGui() oGui.openSettings() oGui.updateDirectory() # If the urlresolver settings are called elif sSiteName == 'urlresolver': import urlresolver urlresolver.display_settings() # If metahandler settings are called elif sSiteName == 'metahandler': import metahandler metahandler.display_settings() else: # Else load any other site as plugin and run the function plugin = __import__(sSiteName, globals(), locals()) function = getattr(plugin, sFunction) function()
def parseUrl(): oInputParameterHandler = ParameterHandler() # If no function is set, we set it to the default "load" function if oInputParameterHandler.exist("function"): sFunction = oInputParameterHandler.getValue("function") if sFunction == 'spacer': return True if sFunction == 'changeWatched': if cConfig().getSetting('metahandler')=='true': #videoType, name, imdbID, season=season, episode=episode, year=year, watched=watched try: from metahandler import metahandlers meta = metahandlers.MetaData() #print oInputParameterHandler.getAllParameters() params = oInputParameterHandler season = '' episode = '' mediaType = params.getValue('mediaType') imdbID = params.getValue('imdbID') name = params.getValue('title') if params.exist('season'): season = params.getValue('season') if params.exist('episode'): episode = params.getValue('episode') if imdbID: meta.change_watched(mediaType, name, imdbID, season=season, episode=episode) xbmc.executebuiltin("XBMC.Container.Refresh") except: META = False logger.info("Could not import package 'metahandler'") return if sFunction == 'updateMeta': if cConfig().getSetting('metahandler')=='true': #videoType, name, imdbID, season=season, episode=episode, year=year, watched=watched try: import resources.lib.handler.metaHandler as metahandlers #from metahandler import metahandlers except: logger.info("Could not import package 'metaHandler'") return meta = metahandlers.MetaData() params = oInputParameterHandler season = '' episode = '' mediaType = params.getValue('mediaType') imdbID = params.getValue('imdbID') name = str(params.getValue('title')) year = params.getValue('year') # show meta search input oGui = cGui() sSearchText = oGui.showKeyBoard(name) if (sSearchText != False and sSearchText != ''): if mediaType == 'movie': try: foundInfo = meta.search_movies(sSearchText) except: logger.info('error or nothing found') foundInfo = False elif mediaType == 'tvshow': foundInfo = metahandlers.TheTVDB().get_matching_shows(sSearchText) else: return else: return if not foundInfo: oGui.showInfo('xStream', 'Suchanfrage lieferte kein Ergebnis') return # select possible match dialog = xbmcgui.Dialog() items = [] for item in foundInfo: if mediaType == 'movie': items.append(str(item['title'].encode('utf-8'))+' ('+str(item['year'])+')') elif mediaType == 'tvshow': items.append(str(item[1])) else: return index = dialog.select('Film/Serie wählen', items) if index > -1: item = foundInfo[index] else: return False if not imdbID: imdbID = '' if not year: year = '' if mediaType == 'movie': meta.update_meta(mediaType, name, imdbID, new_imdb_id=str(item['imdb_id']), new_tmdb_id=str(item['tmdb_id']), year=year) elif mediaType == 'tvshow': meta.update_meta(mediaType, name, imdbID, new_imdb_id=str(item[2]), year=year) #print oInputParameterHandler.getAllParameters() #if params.exist('season'): # season = params.getValue('season') #if params.exist('episode'): # episode = params.getValue('episode') #meta.update_meta(mediaType, name, imdbID, season=season, episode=episode) xbmc.executebuiltin("XBMC.Container.Refresh") return else: sFunction = "load" # Test if we should run a function on a special site if oInputParameterHandler.exist('site'): sSiteName = oInputParameterHandler.getValue('site') logger.info (oInputParameterHandler.getAllParameters()) if oInputParameterHandler.exist('playMode'): playMode = oInputParameterHandler.getValue('playMode') if cConfig().getSetting('autoPlay')=='true' and playMode != 'jd': cHosterGui().streamAuto(playMode, sSiteName, sFunction) else: cHosterGui().stream(playMode, sSiteName, sFunction) return else: logger.info("Call function '%s' from '%s'" % (sFunction, sSiteName)) # If the hoster gui is called, run the function on it and return if sSiteName == 'cHosterGui': showHosterGui(sFunction) return # If global search is called if sSiteName == 'globalSearch': searchGlobal() return if sSiteName == 'favGui': showFavGui(sFunction) return # If addon settings are called if sSiteName == 'xStream': oGui = cGui() oGui.openSettings() oGui.updateDirectory() return # If the urlresolver settings are called if sSiteName == 'urlresolver': import urlresolver urlresolver.display_settings() return # If metahandler settings are called if sSiteName == 'metahandler': import metahandler metahandler.display_settings() return # Else load any other site as plugin and run the function plugin = __import__(sSiteName, globals(), locals()) function = getattr(plugin, sFunction) function() else: # As a default if no site was specified, we run the default starting gui with all plugins showMainMenu(sFunction)