Skip to content
This repository has been archived by the owner on Jul 18, 2021. It is now read-only.

修复获取通讯录问题 #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
修复获取通讯录问题
通过pass_ticket获取通讯录列表在刚才貌似没法使用了,看了下好像更换成了cookie中的webwx_data_ticket
zs1379 committed Jan 8, 2016

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 7d1197f274e6d5d1b27f20d99e236a9cea805542
31 changes: 18 additions & 13 deletions wdf.py
Original file line number Diff line number Diff line change
@@ -23,6 +23,9 @@
import math
import subprocess
import ssl
import urllib
import urllib2
import cookielib

DEBUG = False

@@ -50,6 +53,16 @@
My = []
SyncKey = ''


cj = cookielib.LWPCookieJar()
cookie_support = urllib2.HTTPCookieProcessor(cj)
opener = urllib2.build_opener(cookie_support, urllib2.HTTPHandler)
urllib2.install_opener(opener)

postdata = {
'a' : '1'
}

try:
xrange
range = xrange
@@ -166,10 +179,8 @@ def waitForLogin():
def login():
global skey, wxsid, wxuin, pass_ticket, BaseRequest

request = getRequest(url=redirect_uri)
response = wdf_urllib.urlopen(request)
data = response.read().decode('utf-8', 'replace')

data = urllib2.urlopen(redirect_uri).read().decode('utf-8', 'replace')

# print(data)

'''
@@ -258,16 +269,10 @@ def webwxinit():


def webwxgetcontact():

url = base_uri + \
'/webwxgetcontact?pass_ticket=%s&skey=%s&r=%s' % (
pass_ticket, skey, int(time.time()))

request = getRequest(url=url)
request.add_header('ContentType', 'application/json; charset=UTF-8')
response = wdf_urllib.urlopen(request)
data = response.read()

'/webwxgetcontact?skey=%s&r=%s' % (
skey, int(time.time()))
data = urllib2.urlopen(url).read()
if DEBUG:
f = open(os.path.join(os.getcwd(), 'webwxgetcontact.json'), 'wb')
f.write(data)