示例#1
0
    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()
        Browser.__init__(self, username, password, *a, **kw)
        self.city = city
示例#2
0
 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('/')]
     Browser.__init__(self, *args, **kwargs)
示例#3
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')
            Browser.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']]
            ]
示例#4
0
    def __init__(self, *args, **kwargs):
        BASEURL = self.BASEURL.rstrip('/')

        self.PROTOCOL, self.DOMAIN = BASEURL.split('://', 2)
        self.PAGES_REV = {
            LogoutPage: BASEURL + '/outil/IQEN/Authentication/logout',
            LogoutOkPage: BASEURL + '/outil/IQEN/Authentication/logoutOk',
            HomePage: BASEURL + '/indexcle.html',
            MessagesPage: BASEURL + '/outil/IQEN/Bureau/mesMessages',
            MovementsPage: BASEURL + '/outil/IQMT/mvt.Synthese/syntheseMouvementPerso',
        }
        self.PAGES = {
            self.PAGES_REV[HomePage]: HomePage,
            self.PAGES_REV[LogoutPage]: LogoutPage,
            self.PAGES_REV[LogoutOkPage]: LogoutOkPage,
            self.PAGES_REV[MessagesPage]: MessagesPage,
            self.PAGES_REV[MovementsPage]: MovementsPage,
            BASEURL + '/outil/IQMT/mvt.Synthese/paginerReleve': MovementsPage,
            BASEURL + '/': RootPage,
            BASEURL + '/outil/IQEN/Authentication/dejaConnecte': AlreadyConnectedPage,
            BASEURL + '/outil/IQEN/Authentication/sessionExpiree': ExpiredPage,
        }

        Browser.__init__(self, *args, **kwargs)
        self._logged = False
示例#5
0
文件: browser.py 项目: dasimon/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('/')]
     Browser.__init__(self, *args, **kwargs)
示例#6
0
    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()
        Browser.__init__(self, username, password, *a, **kw)
        self.city = city
示例#7
0
    def __init__(self, *args, **kwargs):
        BASEURL = self.BASEURL.rstrip('/')

        self.PROTOCOL, self.DOMAIN = BASEURL.split('://', 2)
        self.PAGES_REV = {
            LogoutPage:
            BASEURL + '/outil/IQEN/Authentication/logout',
            LogoutOkPage:
            BASEURL + '/outil/IQEN/Authentication/logoutOk',
            HomePage:
            BASEURL + '/indexcle.html',
            MessagesPage:
            BASEURL + '/outil/IQEN/Bureau/mesMessages',
            MovementsPage:
            BASEURL + '/outil/IQMT/mvt.Synthese/syntheseMouvementPerso',
        }
        self.PAGES = {
            self.PAGES_REV[HomePage]: HomePage,
            self.PAGES_REV[LogoutPage]: LogoutPage,
            self.PAGES_REV[LogoutOkPage]: LogoutOkPage,
            self.PAGES_REV[MessagesPage]: MessagesPage,
            self.PAGES_REV[MovementsPage]: MovementsPage,
            BASEURL + '/outil/IQMT/mvt.Synthese/paginerReleve': MovementsPage,
            BASEURL + '/': RootPage,
            BASEURL + '/outil/IQEN/Authentication/dejaConnecte':
            AlreadyConnectedPage,
            BASEURL + '/outil/IQEN/Authentication/sessionExpiree': ExpiredPage,
        }

        Browser.__init__(self, *args, **kwargs)
        self._logged = False
示例#8
0
文件: browser.py 项目: linura/weboob
 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]
     Browser.__init__(self, *args, **kwargs)
     self.projects = {}
示例#9
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
        Browser.__init__(self, *args, **kwargs)
示例#10
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
        Browser.__init__(self, *args, **kwargs)
示例#11
0
文件: browser.py 项目: dasimon/weboob
 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]
     Browser.__init__(self, *args, **kwargs)
     self.projects = {}
示例#12
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),
     ))
     Browser.__init__(self, *args, **kwargs)
示例#13
0
 def __init__(self, url, *args, **kwargs):
     url = url or 'https://%s/' % random.choice(self.DOMAINS)
     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
     }
     Browser.__init__(self, *args, **kwargs)
示例#14
0
 def __init__(self, url, *args, **kwargs):
     url = url or 'https://thepiratebay.se/'
     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
     }
     Browser.__init__(self, *args, **kwargs)
示例#15
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/ord-web/ord//ord-liste-compte-emetteur.json' % (self.PROTOCOL, self.DOMAIN), (OrderPage, JsonParser())),
         ('%s://%s/authent\.html' % (self.PROTOCOL, self.DOMAIN), ErrorPage),
         ('%s://%s/' % (self.PROTOCOL, self.DOMAIN), LoginPage),
     ))
     Browser.__init__(self, *args, **kwargs)
示例#16
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,
                  }
     Browser.__init__(self, *args, **kwargs)
示例#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,
     }
     Browser.__init__(self, *args, **kwargs)
示例#18
0
文件: browser.py 项目: dasimon/weboob
 def __init__(self, website, *args, **kwargs):
     if website in self.new_login_domain:
         self.DOMAIN = re.sub('^m\.', 'w2.', website)
         self.new_login = True
     else:
         self.DOMAIN = re.sub('^m\.', 'www.', website)
     self.accounts_url = None
     self.savings_url = None
     self._sag = None  # updated while browsing
     self.code_caisse = None  # constant for a given website
     self.perimeters = None
     self.current_perimeter = None
     self.broken_perimeters = list()
     Browser.__init__(self, *args, **kwargs)
示例#19
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),
     ))
     Browser.__init__(self, *args, **kwargs)
示例#20
0
文件: browser.py 项目: P4ncake/weboob
    def __init__(self, username, password, search_query, *args, **kwargs):
        kwargs['get_home'] = False
        Browser.__init__(self, username, password, *args, **kwargs)

        # now we do authentication ourselves
        #self.add_password('https://www.adopteunmec.com/api/', self.username, self.password)
        self.login()

        kwargs.pop('get_home')
        self.website = WebsiteBrowser(self.username, self.password, *args, **kwargs)
        self.website.login()

        self.home()

        self.search_query = search_query
示例#21
0
    def __init__(self, username, password, search_query, *args, **kwargs):
        kwargs['get_home'] = False
        Browser.__init__(self, username, password, *args, **kwargs)

        # now we do authentication ourselves
        #self.add_password('https://www.adopteunmec.com/api/', self.username, self.password)
        self.login()

        kwargs.pop('get_home')
        self.website = WebsiteBrowser(self.username, self.password, *args,
                                      **kwargs)
        self.website.login()

        self.home()

        self.search_query = search_query
示例#22
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/
        Browser.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()
示例#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/
        Browser.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, website, accnum, *args, **kwargs):
     self.accnum = accnum.replace(' ','').zfill(11)
     self.DOMAIN = 'www.%s.fr' % website
     self.website = website
     Browser.__init__(self, *args, **kwargs)
示例#25
0
 def __init__(self, website, *args, **kwargs):
     self.DOMAIN = re.sub('^m\.', 'www.', website)
     self.accounts_url = None
     Browser.__init__(self, *args, **kwargs)
示例#26
0
 def __init__(self, nuser, *args, **kwargs):
     self.nuser = nuser
     Browser.__init__(self, *args, **kwargs)
示例#27
0
文件: browser.py 项目: vicnet/weboob
 def __init__(self, *args, **kwargs):
     Browser.__init__(self, *args, **kwargs)
示例#28
0
 def __init__(self, device="weboob", enable_twofactors=False,
              *args, **kwargs):
     self.device = device
     self.enable_twofactors = enable_twofactors
     Browser.__init__(self, *args, **kwargs)
示例#29
0
 def __init__(self, base_url, *args, **kw):
     Browser.__init__(self, *args, **kw)
     self.base_url = base_url
     self.PAGES = {re.escape(self.base_url): PageAll}
示例#30
0
 def __init__(self, nuser, *args, **kwargs):
     self.nuser = nuser
     self.DOMAIN = kwargs.pop('domain', self.DOMAIN)
     Browser.__init__(self, *args, **kwargs)
示例#31
0
文件: browser.py 项目: dasimon/weboob
 def __init__(self, quality, *args, **kwargs):
     Browser.__init__(self, parser=self.PARSER, *args, **kwargs)
     self.quality = self.FORMATS.get(quality, self.FORMATS['hd'])
示例#32
0
 def get_document(self, result, parser=None, encoding=None):
     from io import BytesIO
     buf = BytesIO(result.read().replace('\0', ''))
     return Browser.get_document(self, buf, parser, encoding)
示例#33
0
 def __init__(self, merchant_id, *args, **kwargs):
     self.merchant_id = merchant_id
     Browser.__init__(self, *args, **kwargs)
示例#34
0
 def __init__(self, browser_params, *args, **kwargs):
     self.params = browser_params
     Browser.__init__(self, *args, **kwargs)
示例#35
0
 def __init__(self, *args, **kwargs):
     self.lowsslcheck(self.DOMAIN_LOGIN, self.CERTHASH_LOGIN)
     Browser.__init__(self, *args, **kwargs)
示例#36
0
    def get_exception(self, e):
        if (isinstance(e, urllib2.HTTPError) and hasattr(e, 'getcode')
                and e.getcode() in (410, )):
            return BrowserHTTPNotFound

        return Browser.get_exception(self, e)
示例#37
0
    def __init__(self, website, *args, **kwargs):
        self.DOMAIN = website
        self.token = None

        Browser.__init__(self, *args, **kwargs)
示例#38
0
 def __init__(self, accnum, *args, **kwargs):
     self.accnum = accnum
     self.website = 'dispobank'
     Browser.__init__(self, *args, **kwargs)
示例#39
0
文件: browser.py 项目: kyrre/weboob
 def __init__(self, *args, **kwargs):
     self.lowsslcheck(self.DOMAIN_LOGIN, self.CERTHASH_LOGIN)
     Browser.__init__(self, *args, **kwargs)
示例#40
0
    def __init__(self, secret, *args, **kwargs):
        self.secret = secret

        Browser.__init__(self, *args, **kwargs)
示例#41
0
 def __init__(self, baseurl, *args, **kwargs):
     self.BASEURL = baseurl
     Browser.__init__(self, *args, **kwargs)
示例#42
0
 def __init__(self, api_key, *a, **kw):
     kw['parser'] = 'json'
     Browser.__init__(self, *a, **kw)
     self.api_key = api_key or VelibBrowser.API_KEY
示例#43
0
文件: browser.py 项目: P4ncake/weboob
    def get_exception(self, e):
        if isinstance(e, urllib2.HTTPError) and hasattr(e, 'getcode'):
            if e.getcode() in (410,):
                return BrowserHTTPNotFound

        return Browser.get_exception(self, e)
示例#44
0
文件: browser.py 项目: dasimon/weboob
 def __init__(self, *args, **kwargs):
     self.strong_auth = kwargs.pop('strong_auth', False)
     Browser.__init__(self, *args, **kwargs)
示例#45
0
 def __init__(self, *args, **kwargs):
     self.strong_auth = kwargs.pop('strong_auth', False)
     Browser.__init__(self, *args, **kwargs)
示例#46
0
 def __init__(self, *args, **kw):
     kw['parser'] = 'raw'
     Browser.__init__(self, *args, **kw)
示例#47
0
 def __init__(self, quality, *args, **kwargs):
     Browser.__init__(self, parser=self.PARSER, *args, **kwargs)
     self.quality = self.FORMATS.get(quality, self.FORMATS['hd'])
示例#48
0
 def __init__(self, *args, **kw):
     kw['parser'] = 'raw'
     Browser.__init__(self, *args, **kw)
示例#49
0
 def __init__(self, accnum, *args, **kwargs):
     self.accnum = accnum
     self.website = 'dispobank'
     Browser.__init__(self, *args, **kwargs)
示例#50
0
 def __init__(self, *args, **kwargs):
     kwargs['parser'] = ('lxml',)
     Browser.__init__(self, *args, **kwargs)
示例#51
0
 def __init__(self, *args, **kwargs):
     kwargs['parser'] = ('lxml', )
     Browser.__init__(self, *args, **kwargs)
示例#52
0
 def __init__(self, domain, username, password, *args, **kwargs):
     self.DOMAIN = domain
     self.logged = False
     Browser.__init__(self, parser=('lxmlsoup', ), *args, **kwargs)
     if password:
         self.login(username, password)
示例#53
0
 def __init__(self, lang, quality, order, *args, **kwargs):
     self.lang = lang
     self.quality = quality
     self.order = order
     Browser.__init__(self, *args, **kwargs)
示例#54
0
 def __init__(self, website, *args, **kwargs):
     self.DOMAIN = website
     Browser.__init__(self, *args, **kwargs)
示例#55
0
 def __init__(self, website, *args, **kwargs):
     self.DOMAIN = re.sub('^m\.', 'www.', website)
     self.accounts_url = None
     Browser.__init__(self, *args, **kwargs)
示例#56
0
 def __init__(self, browser_params, *args, **kwargs):
     self.params = browser_params
     Browser.__init__(self, *args, **kwargs)
示例#57
0
 def __init__(self, *args, **kwargs):
     Browser.__init__(self, *args, **kwargs)