wechaty / wechaty

Conversational RPA SDK for Chatbot Makers. Join our Discord: https://discord.gg/7q8NBZbQzt

Home Page:https://wechaty.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New account login issue

maheshgosemath opened this issue · comments

Hi,

I'm using npm to create a bot and followed an example code from the repo.
My bot code is as follows: (mybot.js)

const { Wechaty } = require('wechaty')
const QrcodeTerminal  = require('qrcode-terminal')
const bot = Wechaty.instance()

bot.on('scan', (url, code) => {
  if (!/201|200/.test(String(code))) {
    const loginUrl = url.replace(/\/qrcode\//, '/l/')
    QrcodeTerminal.generate(loginUrl)
  }
  console.log('${url}\n[${code}] Scan QR Code in above url to login: ')
});
bot.on('login', user => console.log('User ${user} logined'))
bot.on('message', message => console.log('Message: ${message}'))
bot.on("error", (e) => console.log('Error: ${e}'))
bot.init() 

On running the bot code I get the following logs:

mahesh@Mahesh-Gosemath:~/code/wechaty$ node mybot.js
09:11:14 INFO Wechaty v0.10.13 initializing...
09:11:14 INFO PuppetWebBridge init() initBrowser() down
09:11:15 INFO PuppetWebBridge initPage() before page.goto(domain)
09:11:22 INFO PuppetWebBridge initPage() after page.goto(domain)
09:11:22 INFO PuppetWebBridge init() initPage() down
https://login.weixin.qq.com/qrcode/4aT0xMjs_Q==
[0] Scan QR Code in above url to login:

On scanning the QR code I get the following message:

https://login.weixin.qq.com/qrcode/4aT0xMjs_Q==
[201] Scan QR Code in above url to login: 

As per documentation code 201 means the QR code is scanned and it is waiting for confirmation.
But the shell keeps waiting infinitely. It never enters the login event.

I tried logging on https://web.wechat.com/ by scanning code, though the code was scanned successfully it didn't log me in with the following message:

For account security, newly registered WeChat accounts are unable to log in to Web WeChat. To use WeChat on a computer, use Windows WeChat or Mac WeChat at http://wechat.com

Is there any relation between the wechat login message and wechaty waiting for confirmation?
Can't we use wechaty for wechat with new accounts?

NodeJs version I'm using is: 6.11.4

mahesh@Mahesh-Gosemath:~/code/wechaty$ node --version
v6.11.4

Hello, thanks for using Wechaty.

Your issue is related to the latest policy changing from Tencent: Newly created Wechat Account will not be able to login via Web Wechat anymore. Wechaty is using the Web API of Wechat, which means newly created account will not use Wechaty to log in.

The solution will be:

  1. use a Wechat Account that registered before Jun 2017.
  2. wait for Wechaty to support PuppetWine/PuppetAndroid(currently still in prototype stage)

Sorry to tell you that.

Also see: #603

BTW: could you please to post the HTML Source Code of the page when you get the For account security, newly registered WeChat accounts are unable to log in to Web WeChat. To use WeChat on a computer, use Windows WeChat or Mac WeChat at http://wechat.com error message?

I need this source code because I think it's better to emit an error message for the user to show this message instead of just saw a useless login message.

The alert appears after the following API is called and it response it returns is blank.
Link

Thanks. I understand that this is an alert window.

Could you find a Wechat Account that registered before Jun 2017?

It was working normally with me for 4 days with many logins (50+ maybe)
all of a sudden it refused to login with this error....

I haven't changed anything with the account and this happened :(

@xinbenlv have any ideas if we can use OS X app cookies with it?
Thanks

HTTP/1.1 200 OK
Content-Type: text/plain;charset=utf-8
Transfer-Encoding: chunked
Connection: Keep-alive

<error><ret>1203</ret><message>For account security, newly registered WeChat accounts are unable to log in to Web WeChat. To use WeChat on a computer, use Windows WeChat or Mac WeChat at http://wechat.com</message></error>

@seifhatem thank you!

commented

@zixia the same issue, bug my account registered in 2013

BTW: i can login https://web.wechat.com/

No I couldn’t find an account before Jun 2017

commented

@zixia my account is definitely before 2017. Have same issue.
It works for me 3 days ago.
I am located at US

I have an account is registered after June 2017, the previous test can not log on the web, but the first two days can suddenly log in, but less than 3 days to be banned landing web again.

@zixia the same issue, but my account registered before 2016

BTW: i can login https://web.wechat.com/

What's your version? Please post the full log as required.

Any solution to this issue yet? I am seeing the same problem.
By the way, can you advise what would people do if their account is registered after June 2017? Are they not allowed to use Web WeChat at all?

Any solution yet?

@baselbers , I haven't found any, so i had to give up and install the wechat app on a phone man. I was trying to avoid that, hopefully one day these guys would provide us with a fix or solution.

Some devs just don't understand using a web app instead of a native app is less convenient as hell.

@zixia I am running into the same problem described here. How is that wait for Wechaty to support PuppetWine/PuppetAndroid(currently still in prototype stage) going to solve the problem? And is this now available?

@nsorrors yes, it's now available.

Currently it's in alpha stage, learn more at #1296

Wechaty v0.15(or above) Can Resolve This Login Issue

If you are experiencing this New Account Login Issue with Web API, and still want to use Wechaty as your ChatBot SDK, you are lucky from now because we have a branding new PuppetPadchat that can let you log in your new account without any problem.

Start from Wechaty v0.15, we enable new Puppet System with all protocols support, include but not limited to Android, iOS, Pad, Win32, Web.

Learn more at:

Juzi.bot is providing free tokens for the developers who have a strong will and ability to build a valuable chatbot for users.

Learn more about wechaty-puppet-padplus, which is a iPad protocol puppet provider.

Cool

My account is created before 2017, still, I cannot login from the webui

The accounts that created before 2017 will have high probabilities to be able to login via web, but not guaranteed.

Why do you need to open wechat payment to continue the operation.

Update Jan 2022

In 2021, UOS can help developers to log in their bot account via the Web Protocol. (related blog post: 重磅:使用UOS微信桌面版协议登录,wechaty免费版web协议重放荣光, Leo chen, Apr 13, 2021

However, it seems that the UOS has been disabled after Jan 1, 2022. See

郁闷

郁闷

Update Feb 2022: recommend using Wechaty Puppet XP

It seems that the UOS patch has no solution to be enabled again. (If anyone has a solution, please submit a PR)

So for users who need a free Wechaty Puppet Provider (WPP), we are suggesting that you can try the Wechaty Puppet XP which is a free WPP based on the Windows WeChat Client.

I will lock this thread for now. Please file a new issue if there's any need.

Merge to: