如何使用”朋友圈首页消息“这个功能
环境
Python 3.12.1 windows 11 x64 wxhelper 3.9.2.23-v9 wechat 3.9.2.23 x86
遇到的问题
使用postman 发送请求到0.0.0.0:19088/api/?type=53
postman 收到 result: okay 然后 tcpserver.py 没有任何输出 但是根据doc我预期看到
{
'data': [
{
'content': '朋友圈[玫瑰][玫瑰]',
'createTime': 1675827480,
'senderId': 'wxid_12333',
'snsId': 14057859804711563695,
'xml': '<TimelineObject><id><![CDATA[1405712322563695]]></id><username><![CDATA[wxid_12333]]></username><createTime><![CDATA[1675827480]]></createTime><contentDescShowType>0</contentDescShowType><contentDescScene>0</contentDescScene><private><![CDATA[0]]></private><contentDesc><![CDATA[朋友圈[玫瑰][玫瑰]]]></contentDesc><contentattr><![CDATA[0]]></contentattr><sourceUserName></sourceUserName><sourceNickName></sourceNickName><statisticsData></statisticsData><weappInfo><appUserName></appUserName><pagePath></pagePath><version><![CDATA[0]]></version><debugMode><![CDATA[0]]></debugMode><shareActionId></shareActionId><isGame><![CDATA[0]]></isGame><messageExtraData></messageExtraData><subType><![CDATA[0]]></subType><preloadResources></preloadResources></weappInfo><canvasInfoXml></canvasInfoXml><ContentObject><contentStyle><![CDATA[2]]></contentStyle><contentSubStyle><![CDATA[0]]></contentSubStyle><title></title><description></description><contentUrl></contentUrl></ContentObject><actionInfo><appMsg><mediaTagName></mediaTagName><messageExt></messageExt><messageAction></messageAction></appMsg></actionInfo><appInfo><id></id></appInfo><location poiClassifyId="" poiName="" poiAddress="" poiClassifyType="0" city=""></location><publicUserName></publicUserName><streamvideo><streamvideourl></streamvideourl><streamvideothumburl></streamvideothumburl><streamvideoweburl></streamvideoweburl></streamvideo></TimelineObject>'
}]
}
我的步骤
-
下载3.9.2.23-v9 release
-
用 ’微信DLL注入器V1.0.3‘ 注入 release中带的injector.dll
-
用
netstat -ano | findstr "your wechat pid"确认 port 19088 已经打开 -
运行 release 中的 python/tcpserver.py, 用上述方法确认 19099 已打开
-
本地运行postman post to
0.0.0.0:19088/api/?type=53, 返回为 ··· { "code": 1, "result": "OK" } ··· tcpserver 没有任何输出 -
运行 python/client.py 下的sns_first()
def sns_first():
"""
朋友圈首页
:return:
"""
url = "127.0.0.1:19088/api/?type=53"
payload = {}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
得到报错 ··· raise InvalidSchema(f"No connection adapters were found for {url!r}") requests.exceptions.InvalidSchema: No connection adapters were found for '127.0.0.1:19088/api/?type=53' ···
朋友圈消息是通过消息回调的。需要先hook消息
朋友圈消息是通过消息回调的。需要先hook消息
感谢指点, 需要在payload 里加上
{
"port": "19099",
"ip": "127.0.0.1"
}
这样tcpserver才可以收到信息。
发现现在documentation还不是很完善,有没有汇总的api endpoint 的使用doc, 我可以参与完善一下。还是直接在readme添加?
朋友圈消息是通过消息回调的。需要先hook消息
我调用
ip:19088/api/hookSyncMsg { "port": "19099", "ip":"127.0.0.1", "url":"http://localhost:8080", "timeout":"3000", "enableHttp":"0" }
第一次调用返回0,多次就是2
所以,我就调一次,然后开tcp tcp可以收私人消息,但是data总是空[] 3.9.5.81