예제 #1
0
    def __init__(self,
                 grab_uid,
                 dest_dir=None,
                 log_dir=None,
                 login=None,
                 password=None):
        self.grab_uid = grab_uid.decode('UTF-8')
        if dest_dir is not None:
            self.dest_dir = dest_dir.decode('UTF-8') + u'/{}'
        else:
            self.dest_dir = self.grab_uid + u'/{}'

        try:
            os.mkdir(self.dest_dir.format(''))
        except OSError:
            pass

        self.login = login
        self.password = password
        Grab.__init__(self)
        if log_dir is not None:
            self.setup(log_dir=log_dir)
        self.open_state = False
        self.setup(hammer_mode=True,
                   hammer_timeouts=((2, 5), (10, 15), (20, 30)))
        self.auth()
예제 #2
0
파일: vk.py 프로젝트: T0ha/vk.py
 def __init__(self, aid, email, passwd, scope = None):
     Grab.__init__(self, hammer_mode = True, hammer_timeouts = ((2,5), (10, 15), (20, 45)))
     self.aid = aid
     self.email = email
     self.passwd = passwd
     self.scope = scope
     self.auth_app(scope)
예제 #3
0
    def __init__(self, steam_account, login_steam, pass_steam, code_link):
        Grab.__init__(self)
        # self.base_page = BasePage(self)
        self.steam_account = steam_account
        self.login_steam = login_steam
        self.pass_steam = pass_steam
        self.code_link = code_link
        self.steam_id = None
        self.session_id = None

        cookiefile = '../cookies/' + login_steam + '.txt'
        self.setup(
            headers={
                'Accept': "text/javascript, text/html, application/xml, text/xml, */*",
                'Accept-Encoding': 'gzip, deflate',
                'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
                'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0',
                'X-Prototype-Version': '1.7',
                'X-Requested-With': 'XMLHttpRequest'
            },
            cookiefile=cookiefile,
            reuse_cookies=True,
            debug_post=True,
            log_file='../log_steam_account/log_' + str(self.login_steam) + '.html'
        )
예제 #4
0
파일: vk.py 프로젝트: T0ha/vk.py
 def __init__(self, aid, email, passwd, scope=None):
     Grab.__init__(self,
                   hammer_mode=True,
                   hammer_timeouts=((2, 5), (10, 15), (20, 45)))
     self.aid = aid
     self.email = email
     self.passwd = passwd
     self.scope = scope
     self.auth_app(scope)
예제 #5
0
    def __init__(self, grab_uid, dest_dir = None, log_dir = None,
                    login = None, password = None):
        self.grab_uid = grab_uid.decode('UTF-8')
        if dest_dir is not None:
            self.dest_dir = dest_dir.decode('UTF-8') + u'/{}'
        else:
            self.dest_dir = self.grab_uid + u'/{}'

        try:
            os.mkdir(self.dest_dir.format(''))
        except OSError:
            pass

        self.login = login
        self.password = password
        Grab.__init__(self)
        if log_dir is not None:
            self.setup(log_dir = log_dir)
        self.open_state = False
        self.setup(hammer_mode=True, hammer_timeouts=((2, 5), (10, 15), (20, 30)))
        self.auth()