def add_friend(self, userName, status=2, verifyContent='', autoUpdate=True):
 url = ('%s/webwxverifyuser?r=%s&pass_ticket=%s' % (self.loginInfo['url'], int(time.time()), self.loginInfo['pass_ticket']))
 data = {'BaseRequest': self.loginInfo['BaseRequest'], 'Opcode': status, 'VerifyUserListSize': 1, 'VerifyUserList': [{'Value': userName, 'VerifyUserTicket': ''}], 'VerifyContent': verifyContent, 'SceneListCount': 1, 'SceneList': 33, 'skey': self.loginInfo['skey']}
 headers = {'ContentType': 'application/json; charset=UTF-8', 'User-Agent': config.USER_AGENT}
 r = self.s.post(url, headers=headers, data=json.dumps(data, ensure_ascii=False).encode('utf8', 'replace'))
 if autoUpdate:
  self.update_friend(userName)
 return ReturnValue(rawResponse=r)

def add_friend ( self , userName , status = 2 , verifyContent = '' , autoUpdate = True ) : url = ( '%s/webwxverifyuser?r=%s&pass_ticket=%s' % ( self . loginInfo [ 'url' ] , int ( time . time ( ) ) , self . loginInfo [ 'pass_ticket' ] ) ) data = { 'BaseRequest' : self . loginInfo [ 'BaseRequest' ] , 'Opcode' : status , 'VerifyUserListSize' : 1 , 'VerifyUserList' : [ { 'Value' : userName , 'VerifyUserTicket' : '' } ] , 'VerifyContent' : verifyContent , 'SceneListCount' : 1 , 'SceneList' : 33 , 'skey' : self . loginInfo [ 'skey' ] } headers = { 'ContentType' : 'application/json; charset=UTF-8' , 'User-Agent' : config . USER_AGENT } r = self . s . post ( url , headers = headers , data = json . dumps ( data , ensure_ascii = False ) . encode ( 'utf8' , 'replace' ) ) if autoUpdate : self . update_friend ( userName ) return ReturnValue ( rawResponse = r )
add a friend or accept a friend * for adding status should be 2 * for accepting status should be 3 .