Esempio n. 1
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
Esempio n. 2
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
Esempio n. 3
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)
Esempio n. 4
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
Esempio n. 5
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)
Esempio n. 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
Esempio n. 7
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]
     Browser.__init__(self, *args, **kwargs)
     self.projects = {}
Esempio n. 8
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)
Esempio n. 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)
Esempio n. 10
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]
     Browser.__init__(self, *args, **kwargs)
     self.projects = {}
Esempio n. 11
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)
Esempio n. 12
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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 17
0
 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)
Esempio n. 18
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)
Esempio n. 19
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
Esempio n. 20
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
Esempio n. 21
0
 def __init__(self, *args, **kw):
     kw['parser'] = 'raw'
     Browser.__init__(self, *args, **kw)
Esempio n. 22
0
 def __init__(self, *args, **kwargs):
     self.strong_auth = kwargs.pop('strong_auth', False)
     Browser.__init__(self, *args, **kwargs)
Esempio n. 23
0
 def __init__(self, *a, **kw):
     kw['parser'] = 'json'
     Browser.__init__(self, *a, **kw)
     self.fewer_requests = not bool(self.username)
Esempio n. 24
0
 def __init__(self, nuser, *args, **kwargs):
     self.nuser = nuser
     self.DOMAIN = kwargs.pop('domain', self.DOMAIN)
     Browser.__init__(self, *args, **kwargs)
Esempio n. 25
0
 def __init__(self, *args, **kwargs):
     Browser.__init__(self, *args, **kwargs)
Esempio n. 26
0
 def __init__(self, quality, *args, **kwargs):
     Browser.__init__(self, parser=self.PARSER, *args, **kwargs)
     self.quality = self.FORMATS.get(quality, self.FORMATS['hd'])
Esempio n. 27
0
 def __init__(self, *args, **kwargs):
     self.lowsslcheck(self.DOMAIN_LOGIN, self.CERTHASH_LOGIN)
     Browser.__init__(self, *args, **kwargs)
Esempio n. 28
0
 def __init__(self, website, *args, **kwargs):
     self.DOMAIN = re.sub('^m\.', 'www.', website)
     self.accounts_url = None
     Browser.__init__(self, *args, **kwargs)
Esempio n. 29
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
Esempio n. 30
0
 def __init__(self, accnum, *args, **kwargs):
     self.accnum = accnum
     self.website = 'dispobank'
     Browser.__init__(self, *args, **kwargs)
Esempio n. 31
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}
Esempio n. 32
0
 def __init__(self, device="weboob", enable_twofactors=False,
              *args, **kwargs):
     self.device = device
     self.enable_twofactors = enable_twofactors
     Browser.__init__(self, *args, **kwargs)
Esempio n. 33
0
 def __init__(self, *args, **kwargs):
     self.strong_auth = kwargs.pop('strong_auth', False)
     Browser.__init__(self, *args, **kwargs)
Esempio n. 34
0
 def __init__(self, browser_params, *args, **kwargs):
     self.params = browser_params
     Browser.__init__(self, *args, **kwargs)
Esempio n. 35
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)
Esempio n. 36
0
 def __init__(self, merchant_id, *args, **kwargs):
     self.merchant_id = merchant_id
     Browser.__init__(self, *args, **kwargs)
Esempio n. 37
0
 def __init__(self, accnum, *args, **kwargs):
     self.accnum = accnum
     self.website = 'dispobank'
     Browser.__init__(self, *args, **kwargs)
Esempio n. 38
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)
Esempio n. 39
0
    def __init__(self, secret, *args, **kwargs):
        self.secret = secret

        Browser.__init__(self, *args, **kwargs)
Esempio n. 40
0
 def __init__(self, merchant_id, *args, **kwargs):
     self.merchant_id = merchant_id
     Browser.__init__(self, *args, **kwargs)
Esempio n. 41
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}
Esempio n. 42
0
    def __init__(self, website, *args, **kwargs):
        self.DOMAIN = website
        self.token = None

        Browser.__init__(self, *args, **kwargs)
Esempio n. 43
0
 def __init__(self, nuser, *args, **kwargs):
     self.nuser = nuser
     self.DOMAIN = kwargs.pop('domain', self.DOMAIN)
     Browser.__init__(self, *args, **kwargs)
Esempio n. 44
0
 def __init__(self, *args, **kwargs):
     self.lowsslcheck(self.DOMAIN_LOGIN, self.CERTHASH_LOGIN)
     Browser.__init__(self, *args, **kwargs)
Esempio n. 45
0
 def __init__(self, *args, **kwargs):
     Browser.__init__(self, *args, **kwargs)
Esempio n. 46
0
 def __init__(self, baseurl, *args, **kwargs):
     self.BASEURL = baseurl
     Browser.__init__(self, *args, **kwargs)
Esempio n. 47
0
 def __init__(self, nuser, *args, **kwargs):
     self.nuser = nuser
     Browser.__init__(self, *args, **kwargs)
Esempio n. 48
0
 def __init__(self, *args, **kw):
     kw['parser'] = 'raw'
     Browser.__init__(self, *args, **kw)
Esempio n. 49
0
 def __init__(self, *args, **kwargs):
     kwargs['parser'] = ('lxml',)
     Browser.__init__(self, *args, **kwargs)
Esempio n. 50
0
 def __init__(self, *args, **kwargs):
     kwargs['parser'] = ('lxml', )
     Browser.__init__(self, *args, **kwargs)
Esempio n. 51
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)
Esempio n. 52
0
 def __init__(self, lang, quality, order, *args, **kwargs):
     self.lang = lang
     self.quality = quality
     self.order = order
     Browser.__init__(self, *args, **kwargs)
Esempio n. 53
0
 def __init__(self, website, *args, **kwargs):
     self.DOMAIN = website
     Browser.__init__(self, *args, **kwargs)
Esempio n. 54
0
 def __init__(self, website, *args, **kwargs):
     self.DOMAIN = re.sub('^m\.', 'www.', website)
     self.accounts_url = None
     Browser.__init__(self, *args, **kwargs)
Esempio n. 55
0
 def __init__(self, browser_params, *args, **kwargs):
     self.params = browser_params
     Browser.__init__(self, *args, **kwargs)
Esempio n. 56
0
 def __init__(self, quality, *args, **kwargs):
     Browser.__init__(self, parser=self.PARSER, *args, **kwargs)
     self.quality = self.FORMATS.get(quality, self.FORMATS['hd'])