Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 14:20:37 ERR PuppetWeChatBridge onLoad() exception: Error: 登入失敗。 #405

Open
seaung opened this issue May 28, 2023 · 1 comment

Comments

@seaung
Copy link

seaung commented May 28, 2023

Environment

- wechaty:0.10.7
- wechaty-puppet: 0.4.23
- wechaty-puppet-service: 0.8.10 
- token type: wechaty-puppet-service
- the version of wechaty docker container: [0.65]

Description

我按照官网的步骤,具体链接为:https://wechaty.js.org/docs/puppet-services/diy,自己DIY了一个token服务,这里不用申请其他额外的token吧?我启动了我自己DIY的token服务,并尝试运行我的python代码,我用手机微信扫描登录,它提示我登入失败。
➜  ~ docker run -it --name wechaty_puppet_service_token_gateway --rm --privileged -e WECHATY_LOG -e WECHATY_PUPPET -e WECHATY_PUPPET_SERVER_PORT -e WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVER -e WECHATY_TOKEN -p 8788:8788 wechaty/wechaty:0.65

 __        __        _           _          
 \ \      / /__  ___| |__   __ _| |_ _   _  
  \ \ /\ / / _ \/ __| '_ \ / _` | __| | | | 
   \ V  V /  __/ (__| | | | (_| | |_| |_| | 
    \_/\_/ \___|\___|_| |_|\__,_|\__|\__, | 
                                     |___/  
____________________________________________________
            https://www.chatie.io
  ____                            _   _             
 / ___|___  _ __  _ __   ___  ___| |_(_)_ __   __ _ 
| |   / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | |  __/ (__| |_| | | | | (_| |
 \____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
                                              |___/ 
  ____ _           _   ____        _       
 / ___| |__   __ _| |_| __ )  ___ | |_ ___ 
| |   | '_ \ / _` | __|  _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
 \____|_| |_|\__,_|\__|____/ \___/ \__|___/
                                           
WECHATY Environment Variables: 6
WECHATY_TOKEN=7be027c2-4376-49e3-9853-462f69eee0c2
WECHATY_DOCKER=1
WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVER=false
WECHATY_PUPPET_SERVER_PORT=8788
WECHATY_LOG=verbose
WECHATY_PUPPET=wechaty-puppet-wechat

Starting Docker Container for Wechaty v0.65.15 with Node.js v14.17.5 ...
   ____ _           _   _        _        
  / ___| |__   __ _| |_(_) ___  (_) ___   
 | |   | '_ \ / _` | __| |/ _ \ | |/ _ \  
 | |___| | | | (_| | |_| |  __/_| | (_) | 
  \____|_| |_|\__,_|\__|_|\___(_)_|\___/  
                                          
     _         _   _     _               ____          
    / \  _   _| |_| |__ (_)_ __   __ _  | __ ) _   _ _ 
   / _ \| | | | __| '_ \| | '_ \ / _` | |  _ \| | | (_)
  / ___ \ |_| | |_| | | | | | | | (_| | | |_) | |_| |_ 
 /_/   \_\__,_|\__|_| |_|_|_| |_|\__, | |____/ \__, (_)
                                 |___/         |___/   

WECHATY_TOKEN=7be027c2-4376-49e3-9853-462f69eee0c2 

/wechaty ~

> [email protected] io-client /wechaty
> ts-node bin/io-client

14:19:23 INFO Config registering process.on("unhandledRejection") for development/debug
14:19:23 VERB Config constructor()
14:19:23 VERB ResolverWechaty setup()
14:19:23 VERB Wechaty init() getRavenDsn() return undefined, skipped.

| __        __        _           _
| \ \      / /__  ___| |__   __ _| |_ _   _
|  \ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
|   \ V  V /  __/ (__| | | | (_| | |_| |_| |
|    \_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|                                     |___/

=============== Powered by Wechaty ===============
       -------- https://www.chatie.io --------

My super power: download cloud bot from www.chatie.io

__________________________________________________


14:19:24 INFO Client Starting for WECHATY_TOKEN: 7be027c2-4376-49e3-9853-462f69eee0c2
14:19:24 VERB Wechaty constructor()
14:19:24 VERB StateSwitch constructor(Wechaty, "{"log":{"enableTimestamp":true,"logLevel":4,"prefixFilter":{}}}")
14:19:24 VERB StateSwitch constructor(WechatyReady, "{"log":{"enableTimestamp":true,"logLevel":4,"prefixFilter":{}}}")
14:19:24 VERB IoClient constructor({token:7be027c2-4376-49e3-9853-462f69eee0c2, wechaty:Wechaty#cli7ibkkq000015qq1j8r2iy8<>(), port:8788})
14:19:24 VERB StateSwitch constructor(IoClient, "{"log":{"enableTimestamp":true,"logLevel":4,"prefixFilter":{}}}")
14:19:24 VERB IoClient start()
14:19:24 VERB StateSwitch <IoClient> on(pending) <- (false)
14:19:24 VERB IoClient hookWechaty()
14:19:24 VERB Wechaty on(login, listener) registering... listenerCount: 0
14:19:24 VERB Wechaty on(logout, listener) registering... listenerCount: 0
14:19:24 VERB Wechaty on(message, listener) registering... listenerCount: 0
14:19:24 VERB Wechaty on(scan, listener) registering... listenerCount: 0
14:19:24 VERB IoClient startIo() with token 7be027c2-4376-49e3-9853-462f69eee0c2
14:19:24 VERB StateSwitch constructor(Io, "{"log":{"enableTimestamp":true,"logLevel":4,"prefixFilter":{}}}")
14:19:24 VERB Io instantiated with apihost[api.chatie.io], token[7be027c2-4376-49e3-9853-462f69eee0c2], protocol[io|0.0.1], cuid[cli7ibkkq000015qq1j8r2iy8]
14:19:24 VERB Io start()
14:19:24 VERB StateSwitch <Io> on(pending) <- (false)
14:19:24 VERB Io initEventHook()
14:19:24 VERB Wechaty on(error, listener) registering... listenerCount: 0
14:19:24 VERB Wechaty on(heartbeat, listener) registering... listenerCount: 0
14:19:24 VERB Wechaty on(login, listener) registering... listenerCount: 1
14:19:24 VERB Wechaty on(logout, listener) registering... listenerCount: 1
14:19:24 VERB Wechaty on(message, listener) registering... listenerCount: 1
14:19:24 VERB Wechaty on(scan, listener) registering... listenerCount: 1
14:19:24 VERB Io initWebSocket()
14:19:26 VERB Io initWebSocket() connected with protocol [io|0.0.1|cli7ibkkq000015qq1j8r2iy8||8788]
14:19:26 VERB Wechaty on(login, listener) registering... listenerCount: 2
14:19:26 VERB Wechaty on(scan, listener) registering... listenerCount: 2
14:19:26 VERB StateSwitch <Io> on(true) <- (pending)
14:19:26 VERB Wechaty <wechaty-puppet-wechat>(7be027c2-4376-49e3-9853-462f69eee0c2) start() v0.65.15 is starting...
14:19:26 VERB Wechaty id: cli7ibkkq000015qq1j8r2iy8
14:19:26 VERB StateSwitch <WechatyReady> off(true) <- (true)
14:19:26 VERB StateSwitch <Wechaty> on(pending) <- (false)
14:19:26 VERB MemoryCard constructor("7be027c2-4376-49e3-9853-462f69eee0c2")
14:19:26 VERB MemoryCard getStorage() for storage type: N/A
14:19:26 VERB getStorage name: 7be027c2-4376-49e3-9853-462f69eee0c2, options: {"type":"file"}
14:19:26 VERB StorageFile constructor(7be027c2-4376-49e3-9853-462f69eee0c2, ...)
14:19:26 VERB StorageBackend constructor(7be027c2-4376-49e3-9853-462f69eee0c2, { type: file })
14:19:26 VERB MemoryCard load() from storage: StorageFile</wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json>
14:19:26 VERB StorageFile load() from /wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json
14:19:26 VERB MemoryCard load() file not exist, NOOP
14:19:26 VERB Wechaty initPuppet() 
14:19:26 VERB MemoryCard multiplex(puppet)
14:19:26 VERB MemoryCard static multiplex(MemoryCard<7be027c2-4376-49e3-9853-462f69eee0c2>, puppet)
14:19:26 VERB MemoryCard constructor({"name":"7be027c2-4376-49e3-9853-462f69eee0c2","multiplex":{"name":"puppet","parent":{"options":{"name":"7be027c2-4376-49e3-9853-462f69eee0c2"},"name":"7be027c2-4376-49e3-9853-462f69eee0c2","payload":{},"multiplexNameList":[],"storage":{"name":"7be027c2-4376-49e3-9853-462f69eee0c2","options":{"type":"file"},"absFileName":"/wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json"}}}})
14:19:26 VERB PuppetManager resolve({puppet: wechaty-puppet-wechat, puppetOptions: undefined})
14:19:26 VERB PuppetManager resolveName(wechaty-puppet-wechat)
14:19:26 VERB PuppetManager checkModule(wechaty-puppet-wechat)
14:19:26 VERB Puppet constructor({}) #0
14:19:26 VERB StateSwitch constructor(PuppetWeChat, "{"log":{"enableTimestamp":true,"logLevel":4,"prefixFilter":{}}}")
14:19:26 VERB MemoryCard constructor(undefined)
14:19:26 VERB MemoryCard getStorage() for storage type: N/A
14:19:26 VERB MemoryCard load() from storage: N/A
14:19:26 VERB MemoryCard load() no storage
14:19:26 VERB Puppet constructor() watchdog timeout set to 60 seconds
14:19:26 VERB HotImport callerResolve(., /wechaty/node_modules/wechaty-puppet/dist/src/puppet.js)
14:19:26 VERB Puppet constructor() childClassPath=/wechaty/node_modules/wechaty-puppet-wechat/dist/src
14:19:26 VERB PuppetWeChatBridge constructor()
14:19:26 VERB StateSwitch constructor(name=PuppetWeChatBridge)
14:19:26 VERB PuppetWeChat initWatchdogForScan()
14:19:26 VERB Puppet setMemory()
14:19:26 VERB Wechaty initPuppetEventBridge(Puppet#0<PuppetWeChat>(7be027c2-4376-49e3-9853-462f69eee0c2))
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(friendship) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(login) (listenerCount:1) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(logout) (listenerCount:1) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(message) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(room-invite) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(room-join) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(room-leave) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(room-topic) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(scan) (listenerCount:1) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(dirty) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(dong) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(error) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(heartbeat) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(ready) (listenerCount:0) registering...
14:19:26 VERB Wechaty initPuppetEventBridge() puppet.on(reset) (listenerCount:0) registering...
14:19:26 VERB Wechaty wechatifyUserModules(Puppet#0<PuppetWeChat>(7be027c2-4376-49e3-9853-462f69eee0c2))
14:19:26 VERB PuppetWeChat start() with 7be027c2-4376-49e3-9853-462f69eee0c2
14:19:26 VERB StateSwitch <PuppetWeChat> on(pending) <- (false)
14:19:26 VERB PuppetWeChat initBridge()
14:19:26 VERB PuppetWeChatBridge start()
14:19:26 VERB StateSwitch <PuppetWeChatBridge> on(pending) <- (false)
14:19:26 VERB PuppetWeChatBridge initBrowser()
14:19:26 VERB PuppetWeChatBridge initBrowser() with options={"args":["--audio-output-channels=0","--disable-default-apps","--disable-translate","--disable-gpu","--disable-setuid-sandbox","--disable-sync","--hide-scrollbars","--mute-audio","--no-sandbox"],"headless":true}
14:19:26 VERB PuppetWeChatBridge initBrowser() version: HeadlessChrome/90.0.4403.0
14:19:26 VERB PuppetWeChatBridge start() initBrowser() done
14:19:26 VERB PuppetWeChatBridge initPage()
14:19:26 VERB MemoryCard <puppet> get(PUPPET_WECHAT)
14:19:26 VERB PuppetWeChatBridge cookieDomain(undefined)
14:19:26 VERB PuppetWeChatBridge initPage() before page.goto(url)
14:19:27 VERB PuppetWeChatBridge initPage() after page.goto(url)
14:19:28 VERB PuppetWeChatBridge onLoad() page.url=https://wx.qq.com/?target=t
14:19:28 VERB PuppetWeChatBridge readyAngular()
14:19:28 VERB PuppetWeChatBridge inject()
14:19:28 VERB PuppetWeChatBridge ding(ding() OK!)
14:19:28 VERB PuppetWeChatBridge clickSwitchAccount()
14:19:28 VERB StateSwitch <PuppetWeChatBridge> on(true) <- (pending)
14:19:28 VERB PuppetWeChatBridge start() initPage() done
14:19:28 VERB PuppetWeChat initBridge() done
14:19:28 VERB StateSwitch <PuppetWeChat> on(true) <- (pending)
14:19:28 VERB PuppetWeChat start() done
14:19:28 VERB Wechaty on(heartbeat, listener) registering... listenerCount: 1
14:19:28 VERB StateSwitch <Wechaty> on(true) <- (pending)
14:19:28 VERB IoClient startPuppetServer()
14:19:28 VERB PuppetServer constructor({endpoint: "0.0.0.0:8788", puppet: "Puppet#0<PuppetWeChat>(7be027c2-4376-49e3-9853-462f69eee0c2)", token: "7be027c2-4376-49e3-9853-462f69eee0c2"})
14:19:28 VERB PuppetServer start()
14:19:28 VERB EventStreamManager constructor(Puppet#0<PuppetWeChat>(7be027c2-4376-49e3-9853-462f69eee0c2))
14:19:28 VERB StateSwitch <IoClient> on(true) <- (pending)
14:19:29 VERB PuppetWeChatEvent onScan({code: 0, url: https://login.weixin.qq.com/qrcode/YdkcgBP2ag==})
14:19:29 VERB MemoryCard <puppet> set(PUPPET_WECHAT, [object Object],[object Object],[object Object])
14:19:29 VERB MemoryCard <7be027c2-4376-49e3-9853-462f69eee0c2> save() to StorageFile</wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json>
14:19:29 VERB StorageFile save() to /wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json
14:19:29 VERB PuppetWeChat start() throttleQueue.subscribe() new item: [object Object]
14:19:29 INFO IoClient [2] https://login.weixin.qq.com/l/YdkcgBP2ag==
Online QR Code Image: https://wechaty.js.org/qrcode/https%3A%2F%2Flogin.weixin.qq.com%2Fl%2FYdkcgBP2ag%3D%3D
14:19:29 VERB MemoryCard <puppet> set(PUPPET_WECHAT, [object Object],[object Object],[object Object])
14:19:29 VERB MemoryCard <7be027c2-4376-49e3-9853-462f69eee0c2> save() to StorageFile</wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json>
14:19:29 VERB StorageFile save() to /wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json
14:19:42 VERB PuppetServiceImpl stop()
14:19:42 ERR PuppetServiceImpl stop() eventStreamManager is not busy?
14:19:42 VERB PuppetWeChat stop()
14:19:42 VERB StateSwitch <PuppetWeChat> off(pending) <- (false)
14:19:42 VERB PuppetWeChat stop() make watchdog sleep before do stop
14:19:42 VERB PuppetWeChatBridge stop()
14:19:42 VERB StateSwitch <PuppetWeChatBridge> off(pending) <- (false)
14:19:42 VERB StateSwitch <PuppetWeChatBridge> off(true) <- (pending)
14:19:42 VERB StateSwitch <PuppetWeChat> off(true) <- (pending)
14:19:42 VERB PuppetServiceImpl start()
14:19:42 VERB PuppetWeChat start() with 7be027c2-4376-49e3-9853-462f69eee0c2
14:19:42 VERB StateSwitch <PuppetWeChat> on(pending) <- (false)
14:19:42 VERB PuppetWeChat initBridge()
14:19:42 VERB PuppetWeChatBridge start()
14:19:42 VERB StateSwitch <PuppetWeChatBridge> on(pending) <- (false)
14:19:42 VERB PuppetWeChatBridge initBrowser()
14:19:42 VERB PuppetWeChatBridge initBrowser() with options={"args":["--audio-output-channels=0","--disable-default-apps","--disable-translate","--disable-gpu","--disable-setuid-sandbox","--disable-sync","--hide-scrollbars","--mute-audio","--no-sandbox"],"headless":true}
14:19:42 VERB PuppetWeChatBridge initBrowser() version: HeadlessChrome/90.0.4403.0
14:19:42 VERB PuppetWeChatBridge start() initBrowser() done
14:19:42 VERB PuppetWeChatBridge initPage()
14:19:42 VERB MemoryCard <puppet> get(PUPPET_WECHAT)
14:19:42 VERB PuppetWeChatBridge cookieDomain([object Object],[object Object],[object Object])
14:19:42 VERB PuppetWeChatBridge initPage() before page.goto(url)
14:19:43 VERB PuppetWeChatBridge initPage() after page.goto(url)
14:19:44 VERB PuppetWeChatBridge onLoad() page.url=https://wx.qq.com/?target=t
14:19:44 VERB PuppetWeChatBridge readyAngular()
14:19:44 VERB PuppetWeChatBridge inject()
14:19:44 VERB PuppetWeChatBridge ding(ding() OK!)
14:19:44 VERB PuppetWeChatBridge clickSwitchAccount()
14:19:44 VERB StateSwitch <PuppetWeChatBridge> on(true) <- (pending)
14:19:44 VERB PuppetWeChatBridge start() initPage() done
14:19:44 VERB PuppetWeChat initBridge() done
14:19:44 VERB StateSwitch <PuppetWeChat> on(true) <- (pending)
14:19:44 VERB PuppetWeChat start() done
14:19:44 VERB PuppetServiceImpl event()
14:19:44 VERB EventStreamManager start(stream)
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() for Puppet#0<PuppetWeChat>(7be027c2-4376-49e3-9853-462f69eee0c2)
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(friendship) (listenerCount:1) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(login) (listenerCount:3) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(logout) (listenerCount:3) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(message) (listenerCount:1) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-invite) (listenerCount:1) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-join) (listenerCount:1) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-leave) (listenerCount:1) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(room-topic) (listenerCount:1) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(scan) (listenerCount:3) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(dirty) (listenerCount:1) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(dong) (listenerCount:1) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(error) (listenerCount:1) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(heartbeat) (listenerCount:3) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(ready) (listenerCount:2) registering...
14:19:44 VERB EventStreamManager connectPuppetEventToStreamingCall() this.puppet.on(reset) (listenerCount:0) registering...
14:19:44 VERB EventStreamManager onStreamingCallEnd(callback)
14:19:44 VERB EventStreamManager grpcEmit(EVENT_TYPE_SCAN[22], {"qrcode":"https://login.weixin.qq.com/l/YdkcgBP2ag==","status":2})
14:19:45 VERB PuppetWeChatEvent onScan({code: 0, url: https://login.weixin.qq.com/qrcode/wYyLBrQzpA==})
14:19:45 VERB MemoryCard <puppet> set(PUPPET_WECHAT, [object Object],[object Object],[object Object])
14:19:45 VERB MemoryCard <7be027c2-4376-49e3-9853-462f69eee0c2> save() to StorageFile</wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json>
14:19:45 VERB StorageFile save() to /wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json
14:19:45 VERB PuppetWeChat start() throttleQueue.subscribe() new item: [object Object]
14:19:45 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":{"code":0,"url":"https://login.weixin.qq.com/qrcode/wYyLBrQzpA=="},"type":"scan"})
14:19:45 INFO IoClient [2] https://login.weixin.qq.com/l/wYyLBrQzpA==
Online QR Code Image: https://wechaty.js.org/qrcode/https%3A%2F%2Flogin.weixin.qq.com%2Fl%2FwYyLBrQzpA%3D%3D
14:19:45 VERB EventStreamManager grpcEmit(EVENT_TYPE_SCAN[22], {"qrcode":"https://login.weixin.qq.com/l/wYyLBrQzpA==","status":2})
14:19:45 VERB MemoryCard <puppet> set(PUPPET_WECHAT, [object Object],[object Object],[object Object])
14:19:45 VERB MemoryCard <7be027c2-4376-49e3-9853-462f69eee0c2> save() to StorageFile</wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json>
14:19:45 VERB StorageFile save() to /wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json
14:19:59 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":"heartbeat@browserbridge ding"})
14:20:02 VERB PuppetWeChatEvent onScan({code: 201, url: https://login.weixin.qq.com/qrcode/wYyLBrQzpA==})
14:20:02 VERB MemoryCard <puppet> set(PUPPET_WECHAT, [object Object],[object Object],[object Object])
14:20:02 VERB MemoryCard <7be027c2-4376-49e3-9853-462f69eee0c2> save() to StorageFile</wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json>
14:20:02 VERB StorageFile save() to /wechaty/7be027c2-4376-49e3-9853-462f69eee0c2.memory-card.json
14:20:02 VERB EventStreamManager grpcEmit(EVENT_TYPE_HEARTBEAT[1], {"data":{"code":201,"url":"https://login.weixin.qq.com/qrcode/wYyLBrQzpA=="},"type":"scan"})
14:20:02 INFO IoClient [3] https://login.weixin.qq.com/l/wYyLBrQzpA==
Online QR Code Image: https://wechaty.js.org/qrcode/https%3A%2F%2Flogin.weixin.qq.com%2Fl%2FwYyLBrQzpA%3D%3D
14:20:02 VERB EventStreamManager grpcEmit(EVENT_TYPE_SCAN[22], {"qrcode":"https://login.weixin.qq.com/l/wYyLBrQzpA==","status":3})
14:20:07 VERB PuppetWeChatBridge onLoad() page.url=https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage?ticket=A9D2Mpqbv5zFhtAqECIPt66E@qrticket_0&uuid=wYyLBrQzpA==&lang=en_US&scan=1685283521
14:20:07 VERB PuppetWeChatBridge readyAngular()
14:20:37 VERB PuppetWeChatBridge readyAngular() exception: TimeoutError: waiting for function failed: timeout 30000ms exceeded
14:20:37 VERB PuppetWeChatBridge testBlockedMessage(<pre style="word-wrap: break-word; white-space: pr)
14:20:37 VERB PuppetWeChatBridge preHtmlToXml()
14:20:37 WARN PuppetWeChatBridge testBlockedMessage() error.ret=1203
14:20:37 INFO PuppetWeChatBridge 

        Please see: Account Login Issue <https://github.com/wechaty/wechaty/issues/872>

        
14:20:37 ERR PuppetWeChatBridge onLoad() exception: Error: 登入失敗。
14:20:37 VERB EventStreamManager grpcEmit(EVENT_TYPE_ERROR[16], {"data":"登入失敗。"})
14:30:11 VERB EventStreamManager this.onStreamingCallEnd() this.eventStream.on(cancelled) fired with arguments: {}
14:30:11 VERB EventStreamManager connectPuppetEventToStreamingCall() disconnect() 14 callbacks

Minimum reproducible code

import asyncio
from typing import Union

from wechaty.plugin import WechatyPlugin
from wechaty import Contact, Message, Room, Wechaty
from wechaty.wechaty import WechatyOptions
from wechaty_puppet import get_logger

logger = get_logger("wechaty_robot_py")

class WechatyRobotPlugin(WechatyPlugin):
def init(self):
super().init()

async def init_plugin(self, wechaty: Wechaty) -> None:
    return await super().init_plugin(wechaty)

async def on_message(self, msg: Message) -> None:
    is_mention_robot = await msg.mention_self()
    is_self = msg.talker().is_self()
    conversation :Union[Room, Contact] = msg.talker() if msg.room() is None else msg.room()

    mention_users = None
    if is_mention_robot:
        mention_users = [msg.talker().contact_id]

    is_room = msg.room()

    if is_room is None and conversation.get_id().__eq__("weixin"):
        return

    if "HandOffMaster" in msg.text():
        return

    if "weixin://dl/feedback?from=" in msg.text():
        return

    if is_self is not True and (
            (is_room is not None and is_mention_robot and "#" not in msg.text()) or
            (is_room is None and "#" not in msg.text())
            ):
        logger.info(f"开始处理对话, 对话内容为 {msg.text()}")
        await msg.say("hello!")

async def main():
import os
os.environ["WECHATY_PUPPET"] = "wechaty-puppet-service"
os.environ["WECHATY_PUPPET_SERVICE_TOKEN"] = "7be027c2-4376-49e3-9853-462f69eee0c2"
os.environ["WECHATY_PUPPET_SERVICE_ENDPOINT"] = "192.168.x.x:8788"
options = WechatyOptions(port=8788, host="192.168.x.x", token="7be027c2-4376-49e3-9853-462f69eee0c2")

robot = Wechaty(options=options).use(WechatyRobotPlugin())

await robot.start()

if name == "main":
asyncio.run(main())

@Zyx-A
Copy link

Zyx-A commented Aug 17, 2023

我这边的也遇到过类型的现象。确保本地 python-wechaty 代码没错,且确保作为中转代理的 wechaty 其他配置都没错的情况下,试试更换协议,也许能解决。
我就是使用 ding-dong.py 示例进行测试时,发现使用 wechaty-puppet-wechat 协议,无论是 wechaty 代理服务器自己的登陆,还是示例代码运行后的登陆,都扫码后提示报错。而更换 wechaty-puppet-wechat4u 协议后,两处不通的问题全都没有了。

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

No branches or pull requests

2 participants