예제 #1
0
 def _ptlogin(self):
     url = 'http://ptlogin2.qq.com/login'
     params = {
         'u': self.uid,
         'p': self.encodepwd,
         'verifycode': self.verify,
         'u1': 'http://web2.qq.com/loginproxy.html?strong=true',
         'remember_uin': 1,
         'aid': 1003903,
         'h': 1,
         'ptredirect': 0,
         'ptlang': 2052,
         'from_ui': 1,
         'pttype': 1,
         'dumy': '',
         'fp': 'loginerroralert',
     }
     self.cookies['verifysession'] = self.verify
     Headers['Cookie'] = self.cookies.output()
     resp, content = Get(url, params=params, headers=Headers)
     self.cookies = Cookie(resp.get('set-cookie', ''))
     match = CB.match(content)
     if int(match.group('one')) == 0:
         return True
     else:
         return False
예제 #2
0
파일: api.py 프로젝트: cadim/pyqq
	def _prelogin(self):
		url = 'http://ptlogin2.qq.com/login'
		params = {
			'u':self.id,
			'p':self.encodepwd,
			'verifycode':self.verify,
			'u1':'http://web2.qq.com/loginproxy.html?strong=true',
			'remember_uin':1,
			'aid':1003903,
			'h':1,
			'ptredirect':0,
			'ptlang':2052,
			'from_ui':1,
			'pttype':1,
			'dumy':'',
			'fp':'loginerroralert',
	    }
		self.cookies['verifysession'] = self.verify
		Headers['Cookie']=self.cookies.output()
		resp,content = Get(url,params=params,headers=Headers)
		self.cookies = Cookie(resp.get('set-cookie',''))
		match = CB.match(content)
		if int(match.group('one')) == 0:
			return True
		else:
			return False
예제 #3
0
파일: api.py 프로젝트: cadim/pyqq
	def _check(self):
		url = 'http://ptlogin2.qq.com/check'
		params = {
		    'uin':self.id,
			'appid':1003903
		}
		resp, content = Get(url,params = params,headers=Headers)  
		logging.info('check:%s',content)
		self.cookies = Cookie(resp.get('set-cookie',''))
		match = CheckVC.match(content)
		self.verify = match.group('content')
		return int(match.group('status')),self.verify
예제 #4
0
파일: api.py 프로젝트: virqin/OAuth
    def _check(self):
		url = 'http://ptlogin2.qq.com/check'
		params = {
		    'uin':self.id,
			'appid':1003903
		}
		resp, content = Get(url,params = params,headers=Headers)  
		logging.info('check:%s',content)
		self.cookies = Cookie(resp.get('set-cookie',''))
		match = CheckVC.match(content)
		self.verify = match.group('content')
		return int(match.group('status')),self.verify
예제 #5
0
파일: api.py 프로젝트: cadim/pyqq
	def _channel_poll2(self):
	    url = 'http://d.web2.qq.com/channel/poll2'  
	    params ={
	        'clientid':self.clientid,
	        'psessionid':self.psessionid,
	        't':int(time.time()),
	        'vfwebqq':self.vfwebqq
	    }  
	    Headers['Cookie'] = getcookiestr(self.cookies)
	    resp,content = Get(url,params=params,headers=Headers) 
	    self.cookies=Cookie(resp.get('set-cookie','')) 
	    print resp
	    print content
예제 #6
0
파일: api.py 프로젝트: virqin/OAuth
    def _channel_poll2(self):
	    url = 'http://d.web2.qq.com/channel/poll2'  
	    params ={
	        'clientid':self.clientid,
	        'psessionid':self.psessionid,
	        't':int(time.time()),
	        'vfwebqq':self.vfwebqq
	    }  
	    Headers['Cookie'] = getcookiestr(self.cookies)
	    resp,content = Get(url,params=params,headers=Headers) 
	    self.cookies=Cookie(resp.get('set-cookie','')) 
	    print resp
	    print content
예제 #7
0
파일: api.py 프로젝트: virqin/OAuth
    def _channel_poll(self):
	    url = 'http://web2-b.qq.com/channel/poll'  
	    params = {
	        'clientid':self.clientid, 
	        'psessionid':self.psessionid,
	        't':int(time.time())
	    } 
	    Headers['Cookie']=getcookiestr(self.cookies) 
	    resp,content = Get(url,params=params,headers=Headers) 
	    self.cookies = Cookie(resp.get('set-cookie','')) 
	    content_dict= json.loads(content)   
	    if resp['status'] == '200' and content_dict['retcode'] == 0:
	        return content_dict['result']
	    else:
	        logging.error('resp:%s,content:%s',str(resp),content)
	        return None