def process(self, subreddit): try: _remove_subreddit(subreddit) directory.refresh() except InvalidSubreddit: dlg = Dialog() dlg.ok(_('Error'), _('There is not such subreddit.')) raise self.AskAgain
def play_url(): url = plugin.args['url'][0] if url.startswith('https://') and ( xbmc.getCondVisibility('system.platform.android') or xbmc.getCondVisibility('system.platform.ios')): dialog = Dialog() dialog.ok("NRK Nett-TV", "Direktestrømmer er ikke støttet på iOS/Android") xbmcplugin.setResolvedUrl(plugin.handle, True, ListItem(path=url))
def valid_user(): global query if not query.validated_user: # Warn the user that it's not a valid user dialog = Dialog() dialog.ok("Warning", "The DLIVE add-on has not found your user on DLIVE") return False return True
def force(mode): mode=str(mode) if path.exists(setxml): res=dom.read(setxml) adv=getchild(res,res,"advancedsettings") nw=getchild(res,adv,"network") bm=getchild(res,nw,"buffermode") for text in bm.childNodes: bm.removeChild(text) bm.appendChild(res.createTextNode(mode)) else: res=minidom.parseString("<advancedsettings><network><buffermode>%s</buffermode></network></advancedsettings>"%mode) dom.write(setxml,res) dialog = Dialog() dialog.ok('UMP', 'LibCurl Buffering Mode set to %s'%mode,logs[mode],"YOU NEED TO RESTART KODI TO CHANGES TAKE AFFECT")
def AdulteSources( self, Url='aHR0cHM6Ly93d3cubXJzZXhlLmNvbS9jYXQvNjIvc29kb21pZS8='): print "Recherche de la liste de chaine..." Page = str(cDL().TelechargPage(url=b64decode(Url))) ret = [] if not Page.startswith("Erreur"): match = re.compile('thumb-list(.*?)<ul class="right pagination">', re.DOTALL | re.IGNORECASE).findall(Page) #xbmc.log("Resulta 1 tri: "+str(match)) match1 = re.compile( r'<li class="[^"]*">\s<a class="thumbnail" href="([^"]+)">\n<script.+?([^;]+);</script>\n<figure>\n<img id=".+?" src="([^"]+)".+?/>\n<figcaption>\n<span class="video-icon"><i class="fa fa-play"></i></span>\n<span class="duration"><i class="fa fa-clock-o"></i>([^<]+)</span>\n(.+?)\n', re.DOTALL | re.IGNORECASE).findall(match[0]) for url, Timage, image, Temp, Descript in match1: ret.append( (url, "https:" + image, Timage.split("(")[1][:-1].replace( "'", "").split(","), Descript + " " + Temp)) print "Recherche OK..." try: nextp = re.compile( r'<li class="arrow"><a href="(.+?)">suivant</li>').findall( Page) ret.append(('https://www.mrsexe.com' + nextp[0], "", [], "Page Suivante...")) except: pass else: dialog = Dialog() ok = dialog.ok("Telechargement impossible...", Page) return ret
def force(mode): mode = str(mode) if path.exists(setxml): res = dom.read(setxml) adv = getchild(res, res, "advancedsettings") nw = getchild(res, adv, "network") bm = getchild(res, nw, "buffermode") for text in bm.childNodes: bm.removeChild(text) bm.appendChild(res.createTextNode(mode)) else: res = minidom.parseString( "<advancedsettings><network><buffermode>%s</buffermode></network></advancedsettings>" % mode) dom.write(setxml, res) dialog = Dialog() dialog.ok('UMP', 'LibCurl Buffering Mode set to %s' % mode, logs[mode], "YOU NEED TO RESTART KODI TO CHANGES TAKE AFFECT")
def bt_login(): global login_cache username = xbmcaddon.Addon().getSetting("user") password = xbmcaddon.Addon().getSetting("password") pickled_cookies, success = login_cache.cacheFunction( BitchuteLogin, username, password) if not success: login_cache.delete('%') data_cache.delete('%') # clear out the login/data caches q = Dialog() q.ok("Login failed", "Unable to login to Bitchute with the details provided") return [], False cookies = pickle.loads(pickled_cookies) #expires = next(x for x in cookies if x.name == 'sessionid').expires return cookies, True
def get_dlive_userid(): global query, menu # What is the Display Name set as in the add-on settings display_name = xbmcaddon.Addon().getSetting("user") # set the query object if it has a valid blockchain user-id if not query.set_user(display_name): # Warn the user that it's not a valid user and resort to DLive so the add-on at least runs dialog = Dialog() dialog.ok( "Unable to find your DLIVE user", "The DLIVE add-on cannot find the Display Name specified in settings. Using the default: DLive" ) query.set_user("DLive") # set it as winsomehax xbmcaddon.Addon().setSetting( id="user", value="DLive") # Write that to the settings return display_name
results = torrentz(query) settings.dialog.notification(settings.name_provider, 'Searching in ThePirateBay', settings.icon, 1000) results += thepiratebay(query) settings.dialog.notification(settings.name_provider, 'Searching in BTjunkie', settings.icon, 1000) results += btjunkie(query) settings.dialog.notification(settings.name_provider, 'Searching in Kickass', settings.icon, 1000) results += kickass(query) settings.dialog.notification(settings.name_provider, 'Searching in TorrentProject', settings.icon, 1000) results += torrentproject(query) # check if we get results if results == [] or results is None: dialog.ok('Search2Pulsar', 'No results') else: list = [result['name'] for result in results] seeds = ['S:%s ' % result['seeds'] for result in results] peers = ['P:%s ' % result['peers'] for result in results] magnet = [result['uri'] for result in results] lists = [ item1 + item2 + item3 for (item1, item2, item3) in zip(seeds, peers, list)] list_rep = dialog.select('Choose File to play with %s' % settings.plugin, lists + ['CANCEL']) if list_rep < len(list): if settings.plugin == 'XBMCtorrent': executebuiltin( "PlayMedia(plugin://plugin.video.xbmctorrent/play/%s)" % quote_plus(magnet[list_rep])) elif settings.plugin == 'KmediaTorrent': executebuiltin("PlayMedia(plugin://plugin.video.kmediatorrent/play/%s)" % quote_plus(magnet[list_rep])) elif settings.plugin == "Torrenter": executebuiltin(
steamExe = getSteamExe(addon) cmd = [ahkExe, "%s" % steamExe, addon.getSetting('username'), addon.getSetting('password')] subprocess.check_call(cmd) def getSteamExe(addon): steamFolder = addon.getSetting('steam_install_folder') steamBinPath = os.path.join(steamFolder, STEAM_BINARY_NAME) if not os.path.isfile(steamBinPath): raise NotFoundError(addon.getLocalizedString(71004)) return steamBinPath class NotFoundError(BaseException): def __init__(self, msg): self.msg = msg if __name__ == "__main__": addon = Addon(__scriptID__) try: launchSteamBpm(addon) except CalledProcessError as e: log('AHK return code: %d' % e.returncode) msg = addon.getLocalizedString(72000 + e.returncode) log(msg, LOGERROR) dialog = Dialog() dialog.ok(addon.getLocalizedString(71005), msg) except BaseException as e: log(str(e), LOGERROR) dialog = Dialog() dialog.ok(addon.getLocalizedString(71005), str(e))
def info_dialog(cls, title, message): dialog = Dialog() return dialog.ok(title, message)
def error_dialog(cls, message): dialog = Dialog() return dialog.ok("Error", message)