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

用户及群组有非临时的唯一标识吗? #118

Open
hmlee9 opened this issue Jan 28, 2016 · 13 comments
Open

用户及群组有非临时的唯一标识吗? #118

hmlee9 opened this issue Jan 28, 2016 · 13 comments

Comments

@hmlee9
Copy link

hmlee9 commented Jan 28, 2016

每次重新登陆,
username(形如@XXXXXXXXX)都会变化;
后来我发现UIN这个值是固定的,
可是怎么拿到其他人的UIN呢?

谢谢!

@hmlee9
Copy link
Author

hmlee9 commented Jan 28, 2016

@DGideas
呃,你说的两个接口我都用过,你会发现每一次登陆,username都会变的
我第二次登陆的时候,如何定位同一个用户?
(username变了, nickname也可能会变,有些人的alias要么没有要么也变了——)

你确定你理解我的问题了?

@DGideas
Copy link

DGideas commented Jan 28, 2016

修改备注时会提交如下数据:

BaseRequest: {Uin: 2526511480, Sid: "fhrx3MOkyHh5DF9k", Skey: "@crypt_75342271_e39683a1471da709461259cb18986cdc",…}
CmdId: 2
RemarkName: "0.0"
UserName: "@83d3865394d81819f3c1ac3da0c95e3c"

是包括UIN的

@DGideas
Copy link

DGideas commented Jan 28, 2016

另外,在刚开始登录时的/webwxinit访问中,返回的数据也是包括UIN的,群组除外:

,{
"Uin": 2736226540,
"UserName": "@42e68ec0c62c1b4e5a7543c23830bc67",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": "she"
}

@hmlee9
Copy link
Author

hmlee9 commented Jan 28, 2016

@DGideas 大哥,BaseRequest里面那个UIN,是登陆用户自己的吧?......
/webwxinit里是有一部分UIN,但是并不是所有的,而且你也发现了没有群组的

所以我一直在找用户和群组的唯一标识 T_T

@0x5e
Copy link
Owner

0x5e commented Jan 28, 2016

@hmlee9 可能就是没有的吧,服务端应该可以通过Skey或者什么的解出来

@hmlee9
Copy link
Author

hmlee9 commented Jan 28, 2016

@0x5e 感谢您的代码!
我使用的过程做了几个小改动,例如做网络请求的时候加了一个timeout(30秒),一开始ssl的地方要判断python的版本号,2.7.9之前的版本 ssl._create_default_https_context = ssl._create_unverified_context 是会有问题的,等等

@DGideas
Copy link

DGideas commented Jan 29, 2016

@hmlee9 不是登录用户自己的啊,/webwxinit后边的请求是这样的啊,拉取的的确是用户列表和用户的UIN:

{
"Uin": 1651513818,
"UserName": "@ee45c0e25d93e2c1f5555946689f2d56a9238f907c4a6ddc0f209719b98365f6",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": ""
}
,{
"Uin": 1720477634,
"UserName": "@437e7de76095b5f27a7590fd741318bb7dadf5b3ed4da5c147265ecaef2d196f",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": ""
}
,{
"Uin": 874859500,
"UserName": "@010c75768fbed0bb629036446469d197",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": "che"
}
,{
"Uin": 3406365,
"UserName": "@2fa7c269e67ddc615879aa1db8a6d0ce",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": "van"
}
,{
"Uin": 1868141902,
"UserName": "@b38a2107590a7d9f8064a34be5381378c2294a86eb604c98f376da64404b7a91",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": ""
}
,{
"Uin": 1248431312,
"UserName": "@9d6036c0290211b2efca86b12679ead2cf89f4df0202dc7d60ca96c14d7f3403",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": ""
}
,{
"Uin": 1334598530,
"UserName": "@702cbe0c05f560d8ea814ffc0db4652a115875bce96aba493b87a14d0551c686",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": ""
}
,{
"Uin": 1332311812,
"UserName": "@b549fea3e917982542cfeaa0e84db6b5f773a394de286e6971e1c904d362dbb3",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": ""
}
,{
"Uin": 1235653337,
"UserName": "@1b8d5c912a2cf7b94af8e28ea916b285dd44f903e57af12e440f046b97da5240",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": ""
}
,{
"Uin": 1386132365,
"UserName": "@4c1a20010f24bd1c8a22eebf34f24c389e2ccc52e43bac3008bce1806b5741ce",
"NickName": "",
"AttrStatus": 0,
"PYInitial": "",
"PYQuanPin": "",
"RemarkPYInitial": "",
"RemarkPYQuanPin": "",
"MemberStatus": 0,
"DisplayName": "",
"KeyWord": ""
}

@DGideas
Copy link

DGideas commented Jan 29, 2016

@hmlee9 @0x5e/webwxinit这一步确实拉取了用户列表(每个联系人的UIN,不一样的啊),之后在/webwxcontact拉取了用户名等信息,在/webwxbatchcontact拉取了群组内用户的列表

后边两个请求确实没有UIN,不过在/webwxinit有每个人的UIN啊

@hmlee9
Copy link
Author

hmlee9 commented Jan 29, 2016

@DGideas 大哥,可能是我的语文能力比较差,你没有看懂我说的话

你提到修改备注的接口参数里面有UIN,我说那个BaseRequest里面的UIN,是登陆用户自己的

你又提到 /webwxinit 里的UIN,我说这里面只有部分用户的,而且群组的UIN没有

/webwxgetcontact/webwxbatchcontact 只能拿用户列表和用户名(用户名会变)

看一下我的题目和问题,我需要的是唯一标示...........................

@DGideas
Copy link

DGideas commented Jan 29, 2016

@hmlee9 抱歉误解你的意思了。那估计就是没有了,应该是服务器那边解出来的吧……

@hmlee9
Copy link
Author

hmlee9 commented Jan 29, 2016

@DGideas 哈哈,我提出来看看有没有高人指导一下
还是要谢谢你的回答 : )

@hexsum
Copy link

hexsum commented Feb 2, 2016

@hmlee9 好友的话可以考虑用allias这个微信帐号来唯一标识一个用户

@geekfly2016
Copy link

微信群成员可以在群改名或者成员变动的时候返回的ModMemberList中拿到群成员的Uin

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants