def __init__(self, url, *args, **kwargs): self.url = url v = urlsplit(url) self.PROTOCOL = v.scheme self.DOMAIN = v.netloc self.BASEPATH = v.path[:v.path.rfind('/')] BaseBrowser.__init__(self, *args, **kwargs)
def login(self): """ Attempt to log in. Note: this method does nothing if we are already logged in. """ assert isinstance(self.username, basestring) assert isinstance(self.password, basestring) # Do we really need to login? if self.is_logged(): self.logger.debug('already logged in') return self.is_logging = True # Are we on the good page? if not self.is_on_page(LoginPage): self.logger.debug('going to login page') BaseBrowser.home(self) self.logger.debug('attempting to log in') self.page.login(self.username, self.password) self.is_logging = False if not self.is_logged(): raise BrowserIncorrectPassword() self.addheaders = [['User-agent', self.USER_AGENTS['desktop_firefox']]]
def __init__(self, city, username, password, *a, **kw): self.DOMAIN = '%s.onvasortir.com' % city self.PAGES = { '%s://%s/' % (self.PROTOCOL, self.DOMAIN): PageIndex, r'%s://%s/message_read.php\?Id=.+' % (self.PROTOCOL, self.DOMAIN): PagePrivateThread, '%s://%s/vue_messages_recus.php' % (self.PROTOCOL, self.DOMAIN): PagePrivateThreadsList, '%s://%s/vue_messages_envoyes.php' % (self.PROTOCOL, self.DOMAIN): PagePrivateThreadsList, '%s://%s/page_action_connect.php' % (self.PROTOCOL, self.DOMAIN): PageLogin, r'%s://%s/\?Langue=EN' % (self.PROTOCOL, self.DOMAIN): DummyPage, '%s://%s/page_action_boost.php' % (self.PROTOCOL, self.DOMAIN): DummyPage, '%s://%s/vue_profil_all.php.php' % (self.PROTOCOL, self.DOMAIN): DummyPage, r'%s://%s/message_msg_envoi_ok.php\?.*' % (self.PROTOCOL, self.DOMAIN): DummyPage, '%s://%s/message_action_envoi.php' % (self.PROTOCOL, self.DOMAIN): DummyPage, r'%s://%s/profil_read.php\?.+' % (self.PROTOCOL, self.DOMAIN): PageUserProfile, 'http://www.onvasortir.com/?': PageCityList, 'http://www.urbeez.com/?': PageCityList, } kw['parser'] = SoupParser() BaseBrowser.__init__(self, username, password, *a, **kw) self.city = city
def login(self): """ Attempt to log in. Note: this method does nothing if we are already logged in. """ assert isinstance(self.username, basestring) assert isinstance(self.password, basestring) # Do we really need to login? if self.is_logged(): self.logger.debug('already logged in') return self.is_logging = True # Are we on the good page? if not self.is_on_page(LoginPage): self.logger.debug('going to login page') BaseBrowser.home(self) self.logger.debug('attempting to log in') self.page.login(self.username, self.password) self.is_logging = False if not self.is_logged(): raise BrowserIncorrectPassword() self.addheaders = [ ['User-agent', self.USER_AGENTS['desktop_firefox']] ]
def __init__(self, *args, **kwargs): #self.DOMAIN = domain #self.PROTOCOL = protocol #self.PAGES = {} #for key, value in PiratebayBrowser.PAGES.iteritems(): # self.PAGES[key % domain] = value BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, protocol, domain, *args, **kwargs): self.DOMAIN = domain self.PROTOCOL = protocol self.PAGES = {} for key, value in GazelleBrowser.PAGES.iteritems(): self.PAGES[key % domain] = value BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, username, password, search_query, *args, **kwargs): kwargs['get_home'] = False BaseBrowser.__init__(self, username, password, *args, **kwargs) self.add_password('http://www.adopteunmec.com/api/', self.username, self.password) self.home() self.search_query = search_query
def __init__(self, device="weboob", enable_twofactors=False, *args, **kwargs): self.device = device self.enable_twofactors = enable_twofactors BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, website, *args, **kwargs): self.DOMAIN = website self.PAGES = {'https://%s/' % website: pages.LoginPage, 'https://%s/.*\.c.*' % website: pages.AccountsList, 'https://%s/login/process' % website: pages.AccountsList, 'https://%s/accounting/listAccounts' % website: pages.AccountsList, 'https://%s/accounting/listOperations' % website: pages.AccountsList, } BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, lang, quality, *args, **kwargs): last_pages = self.PAGES self.PAGES = {} for url, page in last_pages.iteritems(): self.PAGES[url % {'lang': lang, 'searchlang': self.SEARCH_LANG[lang]}] = page BaseBrowser.__init__(self, *args, **kwargs) self.lang = lang self.quality = quality
def __init__(self, url, *args, **kwargs): self._userid = 0 v = urlsplit(url) self.PROTOCOL = v.scheme self.DOMAIN = v.netloc self.BASEPATH = v.path if self.BASEPATH.endswith('/'): self.BASEPATH = self.BASEPATH[:-1] BaseBrowser.__init__(self, *args, **kwargs) self.projects = {}
def __init__(self, *args, **kwargs): self.PAGES = OrderedDict(( ('%s://%s/Pgn/.+PageID=SoldeV3&.+' % (self.PROTOCOL, self.DOMAIN), AccountsPage), ('%s://%s/Pgn/.+PageID=Cartes&.+' % (self.PROTOCOL, self.DOMAIN), CardsPage), ('%s://%s/Pgn/.+PageID=ReleveCompteV3&.+' % (self.PROTOCOL, self.DOMAIN), HistoryPage), ('%s://%s/Pgn/.+PageID=ReleveCarte&.+' % (self.PROTOCOL, self.DOMAIN), CardHistoryPage), ('%s://%s/authent\.html' % (self.PROTOCOL, self.DOMAIN), ErrorPage), ('%s://%s/' % (self.PROTOCOL, self.DOMAIN), LoginPage), )) BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, url, apiurl, *args, **kwargs): url_parsed = urlsplit(url) self.PROTOCOL = url_parsed.scheme self.DOMAIN = url_parsed.netloc self.BASEPATH = url_parsed.path if self.BASEPATH.endswith('/'): self.BASEPATH = self.BASEPATH[:-1] self.apiurl = apiurl BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, website, *args, **kwargs): self.DOMAIN = website self.PAGES = {'https://[^/]+/': LoginPage, 'https://[^/]+/.*\.c.*': AccountsList, 'https://[^/]+/login/process%s' % self.SESSION_REGEXP: AccountsList, 'https://[^/]+/accounting/listAccounts': AccountsList, 'https://[^/]+/accounting/listOperations': AccountsList, 'https://[^/]+/accounting/showAccountDetail.+': AccountsList, 'https://[^/]+/accounting/showMoreAccountOperations.*': AccountsList, } BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, url, *args, **kwargs): url = url or 'https://thepiratebay.sx/' url_parsed = urlsplit(url) self.PROTOCOL = url_parsed.scheme self.DOMAIN = url_parsed.netloc self.PAGES = { '%s://%s/' % (self.PROTOCOL, self.DOMAIN): IndexPage, '%s://%s/search/.*/0/7/0' % (self.PROTOCOL, self.DOMAIN): TorrentsPage, '%s://%s/torrent/.*' % (self.PROTOCOL, self.DOMAIN): TorrentPage } BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, username, password, search_query, *args, **kwargs): kwargs['get_home'] = False BaseBrowser.__init__(self, username, password, *args, **kwargs) # now we do authentication ourselves #self.add_password('http://www.adopteunmec.com/api/', self.username, self.password) self.login() self.website = WebsiteBrowser(self.username, self.password, *args, **kwargs) self.website.login() self.home() self.search_query = search_query
def __init__(self, url, *args, **kwargs): v = urlsplit(url) self.PROTOCOL = v.scheme self.DOMAIN = v.netloc self.BASEPATH = v.path if self.BASEPATH.endswith('/'): self.BASEPATH = self.BASEPATH[:-1] prefix = '%s://%s%s' % (self.PROTOCOL, self.DOMAIN, self.BASEPATH) self.PAGES = {} for key, value in RedmineBrowser.PAGES.iteritems(): self.PAGES[key % prefix] = value BaseBrowser.__init__(self, *args, **kwargs)
def home(self): """ Ensure we are both logged and on the accounts list. """ self.logger.debug('accounts list page required') if self.is_on_page(AccountsList) and self.page.is_accounts_list(): self.logger.debug('already on accounts list') return # simply go to http(s)://the.doma.in/ BaseBrowser.home(self) if self.is_on_page(LoginPage): if not self.is_logged(): # So, we are not logged on the login page -- what about logging ourselves? self.login() # we assume we are logged in # for some regions, we may stay on the login page once we're # logged in, without being redirected... if self.is_on_page(LoginPage): # ... so we have to move by ourselves self.move_to_accounts_list()
def __init__(self, *args, **kwargs): BaseBrowser.__init__(self, *args, **kwargs) self._logged = False
def __init__(self, *args, **kwargs): self.strong_auth = kwargs.pop('strong_auth', False) BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, domain, username, password, *args, **kwargs): self.DOMAIN = domain self.logged = False BaseBrowser.__init__(self, parser=('lxmlsoup',), *args, **kwargs) if password: self.login(username, password)
def __init__(self, *args, **kwargs): self.lowsslcheck(self.DOMAIN_LOGIN, self.CERTHASH_LOGIN) BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): kwargs['parser'] = ('lxml',) BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): kwargs['factory'] = RobustFactory() BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, browser_params, *args, **kwargs): self.params = browser_params BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, merchant_id, *args, **kwargs): self.merchant_id = merchant_id BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, website, *args, **kwargs): self.DOMAIN = website BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): self.rotating_password = kwargs.pop('rotating_password', None) self.password_changed_cb = kwargs.pop('password_changed_cb', None) BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, protocol, domain, *args, **kwargs): self.DOMAIN = domain self.PROTOCOL = protocol BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): kwargs['parser'] = ('lxml', ) BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, accnum, *args, **kwargs): self.accnum = accnum.zfill(11) BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): self.birthday = kwargs.pop('birthday', None) BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, agency, *args, **kwargs): self.agency = agency BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, lang, quality, *args, **kwargs): self.lang = lang self.quality = quality BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, lang, quality, order, *args, **kwargs): self.lang = lang self.quality = quality self.order = order BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, quality, *args, **kwargs): BaseBrowser.__init__(self, parser=self.PARSER, *args, **kwargs) self.quality = self.FORMATS.get(quality, self.FORMATS['hd'])
def __init__(self, base_url, *args, **kw): BaseBrowser.__init__(self, *args, **kw) self.base_url = base_url self.PAGES = {re.escape(self.base_url): PageAll}
def __init__(self, api_key, *args, **kwargs): self.api_key = api_key self.user_key = None BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, website, accnum, *args, **kwargs): self.accnum = accnum.zfill(11) self.DOMAIN = 'www.%s.fr' % website self.website = website BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, secret, *args, **kwargs): self.secret = secret BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, baseurl, *args, **kwargs): self.BASEURL = baseurl BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, website, *args, **kwargs): self.DOMAIN = website self.token = None BaseBrowser.__init__(self, *args, **kwargs)
def __init__(self, nuser, *args, **kwargs): self.nuser = nuser BaseBrowser.__init__(self, *args, **kwargs)