sm00th / bitlbee-discord

Bitlbee plugin for Discord (http://discordapp.com)
GNU General Public License v2.0
291 stars 27 forks source link

Login error: Login error: (null) - captcha-required #150

Closed carbolymer closed 6 years ago

carbolymer commented 6 years ago

after invoking of following commands in btlbee:

account add discord email@gmail.com pass
account discord on

I am getting following error messages:

<root> discord - Login error: Login error: (null)
<root> discord - Logging in: Signing off..
<root> discord - Logging in: Reconnecting in 5 seconds..

Shell log:

bitlbee@honeycomb:/etc/bitlbee$ BITLBEE_DEBUG=1 bitlbee -nvD
Warning: Warning: Couldn't write PID to `/var/run/bitlbee.pid'
DEBUG util: Writing file prefs.xml to directory /var/lib/bitlbee//purple
DEBUG util: Writing file /var/lib/bitlbee//purple/prefs.xml
Warning: Error opening helpfile: /usr/share/bitlbee/discord-help.txt.
[19:59:12] >>> ((null)) discord_http_login 190
About to send HTTP request:
POST /api/auth/login HTTP/1.1
Host: discordapp.com
User-Agent: Bitlbee-Discord
Content-Type: application/json
Content-Length: 54

{"email":"email@gmail.com","password":"pass"}
HTTP response headers:
HTTP/1.1 400 BAD REQUEST
Date: Fri, 18 May 2018 19:59:12 GMT
Content-Type: application/json
Content-Length: 37
Connection: keep-alive
Set-Cookie: __cfduid=cookiehash; expires=Sat, 18-May-19 19:59:12 GMT; path=/; domain=.discordapp.com; HttpOnly
Strict-Transport-Security: max-age=31536000; includeSubDomains
Via: 1.1 google
Alt-Svc: clear
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: cut-AMS

Finishing HTTP request with status: 400 BAD REQUEST
[19:59:12] <<< ((null)) discord_http_login_cb [400] 37
{"captcha_key": ["captcha-required"]}

[19:59:17] >>> ((null)) discord_http_login 190
About to send HTTP request:
POST /api/auth/login HTTP/1.1
Host: discordapp.com
User-Agent: Bitlbee-Discord
Content-Type: application/json
Content-Length: 54

{"email":"email@gmail.com","password":"pass"}
HTTP response headers:
HTTP/1.1 400 BAD REQUEST
Date: Fri, 18 May 2018 19:59:18 GMT
Content-Type: application/json
Content-Length: 37
Connection: keep-alive
Set-Cookie: __cfduid=cookiehash; expires=Sat, 18-May-19 19:59:17 GMT; path=/; domain=.discordapp.com; HttpOnly
Strict-Transport-Security: max-age=31536000; includeSubDomains
Via: 1.1 google
Alt-Svc: clear
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: cut-AMS

Finishing HTTP request with status: 400 BAD REQUEST
[19:59:18] <<< ((null)) discord_http_login_cb [400] 37
{"captcha_key": ["captcha-required"]}

Any ideas how to fix this?

carbolymer commented 6 years ago

Workaround:

  1. Extract token from discord's local storage in browser
  2. invoke commands (replace xxxx with the token):
    acc discord off
    acc discord set token_cache xxxx
    acc discord on

    Source: https://github.com/sm00th/bitlbee-discord/issues/118

sm00th commented 6 years ago

Thanks for the log, I've been hunting the way discord sends this captcha message.