TychoTheTaco / Twitch-Drops-Bot

A Node.js bot that will automatically watch Twitch streams and claim drop rewards.
MIT License
281 stars 37 forks source link

[Bug] no login possible #267

Open BulldozerPete opened 1 year ago

BulldozerPete commented 1 year ago

Describe the bug Can' login into docker container

Screenshots If applicable, add screenshots to help explain your problem.

Logs [2022-12-09 15:53:16] [info] Loading config file: config.json [2022-12-09 15:53:16] [warn] Overriding browser option because we are inside a docker container! [2022-12-09 15:53:16] [warn] Adding browser option: --no-sandbox because we are inside a docker container! [2022-12-09 15:53:16] [info] Logging in... [2022-12-09 15:53:24] [info] Checking for email verification... [2022-12-09 15:53:54] [error] TimeoutError: Waiting for selector .//*[contains(text(), "please enter the 6-digit code we sent")] failed: Waiting failed: 30000ms exceeded at Timeout. (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:64:32) at listOnTimeout (node:internal/timers:564:17) at process.processTimers (node:internal/timers:507:7) [2022-12-09 15:53:54] [info] Checking for 2FA verification... [2022-12-09 15:54:24] [error] TimeoutError: Waiting for selector .//*[contains(text(), "Enter the code found in your authenticator app")] failed: Waiting failed: 30000ms exceeded at Timeout. (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:64:32) at listOnTimeout (node:internal/timers:564:17) at process.processTimers (node:internal/timers:507:7) [2022-12-09 15:54:24] [info] No extra verification found! [2022-12-09 15:54:24] [info] Waiting for cookies to be created... [2022-12-09 15:54:27] [info] Waiting for cookies to be created... [2022-12-09 15:54:30] [info] Waiting for cookies to be created... [2022-12-09 15:54:33] [info] Waiting for cookies to be created... [2022-12-09 15:54:36] [info] Waiting for cookies to be created... [2022-12-09 15:54:39] [info] Waiting for cookies to be created... [2022-12-09 15:54:42] [info] Waiting for cookies to be created... [2022-12-09 15:54:45] [info] Waiting for cookies to be created... [2022-12-09 15:54:48] [info] Waiting for cookies to be created... [2022-12-09 15:54:51] [info] Waiting for cookies to be created... [2022-12-09 15:54:54] [error] Error: Timed out while waiting for cookies to be created! at LoginPage. (file:///app/dist/pages/login.js:62:31) at Generator.next () at fulfilled (file:///app/dist/pages/login.js:4:58)

acewins727 commented 1 year ago

same issue, I just installed docker for the first time, maybe a bug in the last version, I'll have to try using an older version of docker

whyphyrl commented 1 year ago

same here older version doenst work for me to :/

BlackNL16 commented 1 year ago

@BulldozerPete @whyphyrl @acewins727 use the copy cookies method, grab ur cookies with editthiscookie extension or export and place it in a file named "cookies-.json". this solved the problem for me. I was also unabel to logon with the interactive method.

these 2 cookies are the required ones. image

BlackNL16 commented 1 year ago

[ { "domain": ".twitch.tv", "expirationDate": 1705685244, "hostOnly": false, "httpOnly": false, "name": "auth-token", "path": "/", "sameSite": "no_restriction", "secure": true, "session": false, "storeId": "0", "value": "", "id": 2 }, { "domain": ".twitch.tv", "expirationDate": 1705685246.654696, "hostOnly": false, "httpOnly": false, "name": "unique_id", "path": "/", "sameSite": "no_restriction", "secure": true, "session": false, "storeId": "0", "value": "", "id": 13 } ]

BulldozerPete commented 1 year ago

@BlackNL16 what is the name of the cookie? screenshot

BlackNL16 commented 1 year ago

@BulldozerPete you need auth-token and unique_id

BulldozerPete commented 1 year ago

@BlackNL16 Done. Still same error.

my commands, after login via ssh: cd Twitch-Drops-Bot sudo nano cookies-.json copy and paste of your text from above, added my auth-token and unique_id, saved file, started container via docker run --rm -v /home/sam/Twitch-Drops-Bot:/app/data -i -t --name twitchbot --sig-proxy=false ghcr.io/tychothetaco/twitch-drops-bot:latest

BulldozerPete commented 1 year ago

docker run --rm -v /home/sam/Twitch-Drops-Bot:/app/data -i -t --name twitchbot --sig-proxy=false ghcr.io/tychothetaco/twitch-drops-bot:latest [2022-12-21 18:06:53] [info] Loading config file: config.json [2022-12-21 18:06:53] [warn] Overriding browser option because we are inside a docker container! [2022-12-21 18:06:53] [warn] Adding browser option: --no-sandbox because we are inside a docker container! [2022-12-21 18:06:55] [info] Logging in... [2022-12-21 18:07:02] [info] Checking for email verification... [2022-12-21 18:07:32] [error] TimeoutError: Waiting for selector .//*[contains(text(), "please enter the 6-digit code we sent")] failed: Waiting failed: 30000ms exceeded at Timeout. (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:64:32) at listOnTimeout (node:internal/timers:564:17) at process.processTimers (node:internal/timers:507:7) [2022-12-21 18:07:32] [info] Checking for 2FA verification... [2022-12-21 18:08:02] [error] TimeoutError: Waiting for selector .//*[contains(text(), "Enter the code found in your authenticator app")] failed: Waiting failed: 30000ms exceeded at Timeout. (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:64:32) at listOnTimeout (node:internal/timers:564:17) at process.processTimers (node:internal/timers:507:7) [2022-12-21 18:08:02] [info] No extra verification found! [2022-12-21 18:08:02] [info] Waiting for cookies to be created... [2022-12-21 18:08:05] [info] Waiting for cookies to be created... [2022-12-21 18:08:08] [info] Waiting for cookies to be created... [2022-12-21 18:08:11] [info] Waiting for cookies to be created... [2022-12-21 18:08:14] [info] Waiting for cookies to be created... [2022-12-21 18:08:17] [info] Waiting for cookies to be created... [2022-12-21 18:08:20] [info] Waiting for cookies to be created... [2022-12-21 18:08:23] [info] Waiting for cookies to be created... [2022-12-21 18:08:26] [info] Waiting for cookies to be created... [2022-12-21 18:08:29] [info] Waiting for cookies to be created... [2022-12-21 18:08:32] [error] Error: Timed out while waiting for cookies to be created! at LoginPage. (file:///app/dist/pages/login.js:62:31) at Generator.next () at fulfilled (file:///app/dist/pages/login.js:4:58)

BlackNL16 commented 1 year ago

@BulldozerPete please remove username / password from config.

this is my config.json file.

{ "auth_token": "", "browser": "google-chrome", "games": [ "Sea of Thieves", "Rocket League", "fishing planet", "theHunter: Call of the Wild", "World of Tanks", "World of Warships"
], "headless": true, "headless_login": true, "interval": 5, "load_timeout_secs": 30, "failed_stream_retry": 3, "failed_stream_timeout": 30, "browser_args": [], "watch_unlisted_games": false, "hide_video": false, "show_account_not_linked_warning": true, "ignored_games": [], "attempt_impossible_campaigns": true, "watch_streams_when_no_drop_campaigns_active": false, "broadcasters": [], "do_version_check": true, "tui": { "enabled": false }, "updates": { "type": "release", "enabled": true }, "logging": { "enabled": true, "level": "info" }, "auto_claim_drops": true, "auto_claim_community_points": true, "notifications": { "discord": [], "telegram": [] } }

BulldozerPete commented 1 year ago

@BlackNL16 done.

Next error: docker run --rm -v /home/sam/Twitch-Drops-Bot:/app/data -i -t --name twitchbot --sig-proxy=false ghcr.io/tychothetaco/twitch-drops-bot:latest [2022-12-22 06:59:09] [info] Loading config file: config.json [2022-12-22 06:59:10] [warn] Overriding browser option because we are inside a docker container! [2022-12-22 06:59:10] [warn] Adding browser option: --no-sandbox because we are inside a docker container! [2022-12-22 06:59:10] [info] Using auth_token to log in [2022-12-22 06:59:10] [error] Error: Missing device ID! at Client. (file:///app/dist/twitch.js:80:23) at Generator.next () at file:///app/dist/twitch.js:8:71 at new Promise () at __awaiter (file:///app/dist/twitch.js:4:12) at Client.fromCookies (file:///app/dist/twitch.js:58:16) at file:///app/dist/index.js:539:37 at Generator.next () at fulfilled (file:///app/dist/index.js:4:58) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

BlackNL16 commented 1 year ago

@BulldozerPete

make sure you named the cookiefile as following

"cookies-bulldozerpete.json"

BulldozerPete commented 1 year ago

I renamed the file to "cookies-USERNAME_TWITCH.json"

Worked for me. Thank you very much @BlackNL16 !

BlackNL16 commented 1 year ago

Glad I could help you with this, been struggling myself also to got it working first time xD

Verzonden vanaf Outlook voor Androidhttps://aka.ms/AAb9ysg


From: BulldozerPete @.> Sent: Thursday, December 22, 2022 11:51:28 AM To: TychoTheTaco/Twitch-Drops-Bot @.> Cc: BlackNL16 @.>; Mention @.> Subject: Re: [TychoTheTaco/Twitch-Drops-Bot] [Bug] no login possible (Issue #267)

I renamed the file to "cookies-USERNAME_TWITCH.json"

Worked for me. Thank you very much @BlackNL16https://github.com/BlackNL16 !

— Reply to this email directly, view it on GitHubhttps://github.com/TychoTheTaco/Twitch-Drops-Bot/issues/267#issuecomment-1362691000, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASQJMHJ7UOHKM75CSWN4LD3WOQXDBANCNFSM6AAAAAASZPXKWE. You are receiving this because you were mentioned.Message ID: @.***>

kumitom commented 1 year ago

@BulldozerPete you need auth-token and unique_id

My old cookies just expired and I just forgot how to deal with it. Thank you for your hint! Now my bot is working again :)

BulldozerPete commented 1 year ago

@BlackNL16 Do you know if there is an option to auto-claim drops?

BlackNL16 commented 1 year ago

Hi Pete,

I personally use an browser extension which claims them, when I open my browser I've one tab with the Twitch inventory and them it auto claims them.

If I remember it right there already was a bug issue for this and it has something todo with twitch implementations of some kind of antibot thingy.

Verzonden vanaf Outlook voor Androidhttps://aka.ms/AAb9ysg


From: BulldozerPete @.> Sent: Tuesday, January 24, 2023 8:37:48 AM To: TychoTheTaco/Twitch-Drops-Bot @.> Cc: BlackNL16 @.>; Mention @.> Subject: Re: [TychoTheTaco/Twitch-Drops-Bot] [Bug] no login possible (Issue #267)

@BlackNL16https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FBlackNL16&data=05%7C01%7C%7C6ef7e5c7055e418292e808dafddde4ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638101426707348461%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=2P2qL0asCHMCcpzVxJMlpjaoZ9QnBp2x7Z7nq%2Bc81y4%3D&reserved=0 Do you know if there is an option to auto-claim drops?

— Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FTychoTheTaco%2FTwitch-Drops-Bot%2Fissues%2F267%23issuecomment-1401499582&data=05%7C01%7C%7C6ef7e5c7055e418292e808dafddde4ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638101426707348461%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=MbIYPjhQdBgx6RWbdcZdA5BUujkaTJ34%2BlJuIYy7KQQ%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FASQJMHPN6W4Z45SCZHMO3BTWT6BEZANCNFSM6AAAAAASZPXKWE&data=05%7C01%7C%7C6ef7e5c7055e418292e808dafddde4ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638101426707348461%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GKxtV%2FdGdp7DCkmvMLE%2BcCOvNnm52ObBXqvLAy5vKyU%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

BulldozerPete commented 1 year ago

@BlackNL16 Now I have got a new error: [2023-02-23 16:23:57] [error] Failed to get drop campaign details

Do I need to update my auth-token?

delta-whiplash commented 1 year ago

hello I have the sames errors