예제 #1
0
파일: browser.py 프로젝트: lissyx/weboob
 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)
예제 #2
0
    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']]]
예제 #3
0
파일: browser.py 프로젝트: Boussadia/weboob
    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
예제 #4
0
파일: browser.py 프로젝트: eirmag/weboob
 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)
예제 #5
0
파일: browser.py 프로젝트: Boussadia/weboob
    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']]
            ]
예제 #6
0
파일: browser.py 프로젝트: jocelynj/weboob
    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)
예제 #7
0
파일: browser.py 프로젝트: jocelynj/weboob
    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)
예제 #8
0
파일: browser.py 프로젝트: eirmag/weboob
    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
예제 #9
0
파일: browser.py 프로젝트: hugues/weboob
 def __init__(self,
              device="weboob",
              enable_twofactors=False,
              *args,
              **kwargs):
     self.device = device
     self.enable_twofactors = enable_twofactors
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #10
0
파일: browser.py 프로젝트: jocelynj/weboob
 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)
예제 #11
0
파일: browser.py 프로젝트: jocelynj/weboob
    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
예제 #12
0
파일: browser.py 프로젝트: eirmag/weboob
    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
예제 #13
0
 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 = {}
예제 #14
0
파일: browser.py 프로젝트: Boussadia/weboob
 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)
예제 #15
0
    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)
예제 #16
0
 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 = {}
예제 #17
0
 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)
예제 #18
0
파일: browser.py 프로젝트: blckshrk/Weboob
 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)
예제 #19
0
파일: browser.py 프로젝트: Boussadia/weboob
    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
예제 #20
0
파일: browser.py 프로젝트: jocelynj/weboob
    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)
예제 #21
0
파일: browser.py 프로젝트: lissyx/weboob
    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
예제 #22
0
 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)
예제 #23
0
    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()
예제 #24
0
 def __init__(self, *args, **kwargs):
     BaseBrowser.__init__(self, *args, **kwargs)
     self._logged = False
예제 #25
0
파일: browser.py 프로젝트: eirmag/weboob
 def __init__(self, *args, **kwargs):
     self.strong_auth = kwargs.pop('strong_auth', False)
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #26
0
파일: browser.py 프로젝트: lissyx/weboob
 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)
예제 #27
0
 def __init__(self, *args, **kwargs):
     self.lowsslcheck(self.DOMAIN_LOGIN, self.CERTHASH_LOGIN)
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #28
0
파일: browser.py 프로젝트: Boussadia/weboob
 def __init__(self, *args, **kwargs):
     kwargs['parser'] = ('lxml',)
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #29
0
파일: browser.py 프로젝트: eirmag/weboob
 def __init__(self, *args, **kwargs):
     kwargs['factory'] = RobustFactory()
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #30
0
 def __init__(self, browser_params, *args, **kwargs):
     self.params = browser_params
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #31
0
파일: browser.py 프로젝트: hugues/weboob
 def __init__(self, merchant_id, *args, **kwargs):
     self.merchant_id = merchant_id
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #32
0
파일: browser.py 프로젝트: Boussadia/weboob
 def __init__(self, *args, **kwargs):
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #33
0
 def __init__(self, website, *args, **kwargs):
     self.DOMAIN = website
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #34
0
파일: browser.py 프로젝트: eirmag/weboob
 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)
예제 #35
0
 def __init__(self, protocol, domain, *args, **kwargs):
     self.DOMAIN = domain
     self.PROTOCOL = protocol
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #36
0
 def __init__(self, *args, **kwargs):
     kwargs['parser'] = ('lxml', )
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #37
0
 def __init__(self, accnum, *args, **kwargs):
     self.accnum = accnum.zfill(11)
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #38
0
 def __init__(self, *args, **kwargs):
     self.birthday = kwargs.pop('birthday', None)
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #39
0
 def __init__(self, agency, *args, **kwargs):
     self.agency = agency
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #40
0
파일: browser.py 프로젝트: lissyx/weboob
 def __init__(self, *args, **kwargs):
     self.birthday = kwargs.pop('birthday', None)
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #41
0
 def __init__(self, browser_params, *args, **kwargs):
     self.params = browser_params
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #42
0
 def __init__(self, *args, **kwargs):
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #43
0
 def __init__(self, *args, **kwargs):
     self.strong_auth = kwargs.pop('strong_auth', False)
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #44
0
파일: browser.py 프로젝트: lissyx/weboob
 def __init__(self, lang, quality, *args, **kwargs):
     self.lang = lang
     self.quality = quality
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #45
0
 def __init__(self, lang, quality, order, *args, **kwargs):
     self.lang = lang
     self.quality = quality
     self.order = order
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #46
0
 def __init__(self, quality, *args, **kwargs):
     BaseBrowser.__init__(self, parser=self.PARSER, *args, **kwargs)
     self.quality = self.FORMATS.get(quality, self.FORMATS['hd'])
예제 #47
0
 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}
예제 #48
0
파일: browser.py 프로젝트: lissyx/weboob
    def __init__(self, api_key, *args, **kwargs):
        self.api_key = api_key
        self.user_key = None

        BaseBrowser.__init__(self, *args, **kwargs)
예제 #49
0
 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)
예제 #50
0
    def __init__(self, secret, *args, **kwargs):
        self.secret = secret

        BaseBrowser.__init__(self, *args, **kwargs)
예제 #51
0
파일: browser.py 프로젝트: lissyx/weboob
 def __init__(self, baseurl, *args, **kwargs):
     self.BASEURL = baseurl
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #52
0
파일: browser.py 프로젝트: blckshrk/Weboob
    def __init__(self, website, *args, **kwargs):
        self.DOMAIN = website
        self.token = None

        BaseBrowser.__init__(self, *args, **kwargs)
예제 #53
0
파일: browser.py 프로젝트: Boussadia/weboob
 def __init__(self, lang, quality, order, *args, **kwargs):
     self.lang = lang
     self.quality = quality
     self.order = order
     BaseBrowser.__init__(self, *args, **kwargs)
예제 #54
0
파일: browser.py 프로젝트: blckshrk/Weboob
 def __init__(self, nuser, *args, **kwargs):
     self.nuser = nuser
     BaseBrowser.__init__(self, *args, **kwargs)