def three(self, **kwargs): """ Accept webserver parms and show Indexers page """ if kwargs: if 'access' in kwargs: cfg.cherryhost.set(kwargs['access']) cfg.enable_https.set(kwargs.get('enable_https',0)) cfg.autobrowser.set(kwargs.get('autobrowser',0)) cfg.username.set(kwargs.get('web_user', '')) cfg.password.set(kwargs.get('web_pass', '')) if not cfg.username() or not cfg.password(): sabnzbd.interface.set_auth(cherrypy.config) # Create Indexers page info = self.info.copy() info['num'] = '» %s' % T('Step Three') info['number'] = 3 info['newzbin_user'] = cfg.newzbin_username() info['newzbin_pass'] = cfg.newzbin_password.get_stars() info['newzbin_bookmarks'] = cfg.newzbin_bookmarks() info['newzbin_url'] = cfg.newzbin_url() info['matrix_user'] = cfg.matrix_username() info['matrix_apikey'] = cfg.matrix_apikey() info['T'] = Ttemplate template = Template(file=os.path.join(self.__web_dir, 'three.html'), searchList=[info], compilerSettings=sabnzbd.interface.DIRECTIVES) return template.respond()
def three(self, **kwargs): """ Accept webserver parms and show Indexers page """ if kwargs: if 'access' in kwargs: cfg.cherryhost.set(kwargs['access']) cfg.enable_https.set(kwargs.get('enable_https', 0)) cfg.autobrowser.set(kwargs.get('autobrowser', 0)) cfg.username.set(kwargs.get('web_user', '')) cfg.password.set(kwargs.get('web_pass', '')) if not cfg.username() or not cfg.password(): sabnzbd.interface.set_auth(cherrypy.config) # Create Indexers page info = self.info.copy() info['num'] = '» %s' % T('Step Three') info['number'] = 3 info['newzbin_user'] = cfg.newzbin_username() info['newzbin_pass'] = cfg.newzbin_password.get_stars() info['newzbin_bookmarks'] = cfg.newzbin_bookmarks() info['newzbin_url'] = cfg.newzbin_url() info['matrix_user'] = cfg.matrix_username() info['matrix_apikey'] = cfg.matrix_apikey() info['T'] = Ttemplate template = Template(file=os.path.join(self.__web_dir, 'three.html'), searchList=[info], compilerSettings=sabnzbd.interface.DIRECTIVES) return template.respond()
def _matrix_url(url): """ Patch up the url for nzbmatrix.com """ matrix_id = 0 m = _RE_NZBMATRIX.search(url) if not m: mx = _RE_NZBXXX.search(url) if m: site = 'nzbmatrix.com' user = urllib.quote_plus(cfg.matrix_username()) key = urllib.quote_plus(cfg.matrix_apikey()) elif mx: site = 'nzbxxx.com' user = urllib.quote_plus(cfg.xxx_username()) key = urllib.quote_plus(cfg.xxx_apikey()) m = mx if m: matrix_id = m.group(2) if not _RE_NZBMATRIX_USER.search(url) or not _RE_NZBMATRIX_API.search( url): url = '%s://api.%s/v1.1/download.php?id=%s&username=%s&apikey=%s' % \ (_PROTOCOL, site, matrix_id, user, key) return url, matrix_id
def _matrix_url(url): """ Patch up the url for nzbmatrix.com """ matrix_id = 0 m = _RE_NZBMATRIX.search(url) if m: matrix_id = m.group(2) if not _RE_NZBMATRIX_USER.search(url) or not _RE_NZBMATRIX_API.search(url): user = urllib.quote_plus(cfg.matrix_username()) key = urllib.quote_plus(cfg.matrix_apikey()) url = '%s://api.nzbmatrix.com/v1.1/download.php?id=%s&username=%s&apikey=%s' % \ (_PROTOCOL, matrix_id, user, key) return url, matrix_id