Tkd-Alex / Twitch-Channel-Points-Miner-v2

A simple script that will watch a stream for you and earn the channel points.
GNU General Public License v3.0
1.22k stars 678 forks source link

login error error_code:5027 #606

Open Lucifer192192 opened 2 years ago

Lucifer192192 commented 2 years ago

ERROR - [login_flow]: Unknown error: {'error': 'Oops! We encountered an unexpected error. Please try again.', 'error_code': 5027, 'error_desc ription': 'client blocked from this operation'}

GMPerfectZ commented 2 years ago

Same error here

Lucifer192192 commented 2 years ago

It seems to be the Twitch browser

Lucifer192192 commented 2 years ago

The ios app is fine

obertobr commented 2 years ago

I solved it for now by forcing it to take the browser cookie I edited the Twitch-Channel-Points-Miner-v2-1.1\TwitchChannelPointsMiner\classes\TwitchLogin.py

127.                     else:
128.                         #logger.error(f"Unknown error: {login_response}")
129.                         #raise NotImplementedError(
130.                         #    f"Unknown TwitchAPI error code: {err_code}"
131.                         #)
132.                         use_backup_flow = True
133.                         break
134. 
135.                 if "access_token" in login_response:

sorry for my english, i'm using google translator =(

Hendrik292 commented 2 years ago

are you german?

Hendrik292 commented 2 years ago

Unfortunately it does not work grafik

m3dll commented 2 years ago

I have the same problem here error 5027, maybe he doesnt accept my login because i have an underscore in it idk where is the problem ? image

fetanq commented 2 years ago

I think it might be related to 2-factor authentication. That the API is not able to handle the 2FA step. That's my hunch at least without knowing anything about this module.

The containment provided by @obertobr worked for me. Commenting out lines 128-131. And adding lines 132-133. After doing this it will fall-back to a more basic method of logging in where you have to login using Chrome or Firefox. And that the API fetches the login cookie in order for the API to be logged in. @Hendrik292 I assume you only commented out the lines, and forgot to add the two new ones (line 132-133 in the example of @obertobr ).

m3dll commented 2 years ago

@fetanq even with the containment provided by @obertobr ive got another code error. About 2FA I disabled it but when I try to log in with a new device that send me a mail but when I run the script it doesnt send the mail. So dont think it's about 2FA image

abdulelah2737 commented 2 years ago

I solved it for now by forcing it to take the browser cookie I edited the Twitch-Channel-Points-Miner-v2-1.1\TwitchChannelPointsMiner\classes\TwitchLogin.py

127.                     else:
128.                         #logger.error(f"Unknown error: {login_response}")
129.                         #raise NotImplementedError(
130.                         #    f"Unknown TwitchAPI error code: {err_code}"
131.                         #)
132.                         use_backup_flow = True
133.                         break
134. 
135.                 if "access_token" in login_response:

sorry for my english, i'm using google translator =(

confirm worked

obertobr commented 2 years ago

I think it might be related to 2-factor authentication. That the API is not able to handle the 2FA step. That's my hunch at least without knowing anything about this module.

The containment provided by @obertobr worked for me. Commenting out lines 128-131. And adding lines 132-133. After doing this it will fall-back to a more basic method of logging in where you have to login using Chrome or Firefox. And that the API fetches the login cookie in order for the API to be logged in. @Hendrik292 I assume you only commented out the lines, and forgot to add the two new ones (line 132-133 in the example of @obertobr ).

from what I saw in the code, the API asks for 2-factor authentication if necessary, and it's giving an error before that, I think it's more likely that twitch has changed the way it receives data, thus giving an error in the code

@fetanq even with the containment provided by @obertobr ive got another code error. About 2FA I disabled it but when I try to log in with a new device that send me a mail but when I run the script it doesnt send the mail. So dont think it's about 2FA image

You forgot to comment out lines 128 and 129

m3dll commented 2 years ago

I think it might be related to 2-factor authentication. That the API is not able to handle the 2FA step. That's my hunch at least without knowing anything about this module. The containment provided by @obertobr worked for me. Commenting out lines 128-131. And adding lines 132-133. After doing this it will fall-back to a more basic method of logging in where you have to login using Chrome or Firefox. And that the API fetches the login cookie in order for the API to be logged in. @Hendrik292 I assume you only commented out the lines, and forgot to add the two new ones (line 132-133 in the example of @obertobr ).

from what I saw in the code, the API asks for 2-factor authentication if necessary, and it's giving an error before that, I think it's more likely that twitch has changed the way it receives data, thus giving an error in the code

@fetanq even with the containment provided by @obertobr ive got another code error. About 2FA I disabled it but when I try to log in with a new device that send me a mail but when I run the script it doesnt send the mail. So dont think it's about 2FA image

You forgot to comment out lines 128 and 129

Yes I totally forgot to comment out lines 128 & 129 my bad, its logging now using my browser I have some WebSocket error now Im gonna search in the issues ty all

m3dll commented 2 years ago

Solved the cookie problem by cleaning firefox history cookies btw everything seems to be fine ty all

xBlackZero commented 2 years ago

I was still getting error, then I removed those spaces and it worked =P pic

ceoshikhar commented 2 years ago

https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/blob/0c5f2f3a1fd8889985acc5cbe58af53d06fb7f53/TwitchChannelPointsMiner/constants.py#L6

I think Twitch has blocked this Client ID hence the "Client blocked from this operation". Any idea how to get a new Client ID?

Rakambda commented 2 years ago

This client ID is the twitch website and isn't blocked. This is due to recent changes on twitch with "integrity" checks that applies on both the passport API (login) & GQL API (claiming rewards, drops, ...).

When using the browser this doesn't happen because the "integrity" call is performed as expected.

Same underlying issue as #592

qvbvs commented 2 years ago

I solved it for now by forcing it to take the browser cookie I edited the Twitch-Channel-Points-Miner-v2-1.1\TwitchChannelPointsMiner\classes\TwitchLogin.py

127.                     else:
128.                         #logger.error(f"Unknown error: {login_response}")
129.                         #raise NotImplementedError(
130.                         #    f"Unknown TwitchAPI error code: {err_code}"
131.                         #)
132.                         use_backup_flow = True
133.                         break
134. 
135.                 if "access_token" in login_response:

sorry for my english, i'm using google translator =(

confirm worked

its working, thanks

ghost commented 2 years ago

I solved it for now by forcing it to take the browser cookie I edited the Twitch-Channel-Points-Miner-v2-1.1\TwitchChannelPointsMiner\classes\TwitchLogin.py

127.                     else:
128.                         #logger.error(f"Unknown error: {login_response}")
129.                         #raise NotImplementedError(
130.                         #    f"Unknown TwitchAPI error code: {err_code}"
131.                         #)
132.                         use_backup_flow = True
133.                         break
134. 
135.                 if "access_token" in login_response:

sorry for my english, i'm using google translator =(

image lol

c0rrre commented 2 years ago

You need to move line 128-133 one space to the left

ghost commented 2 years ago

You need to move line 128-133 one space to the left

still the same error

obertobr commented 2 years ago

You need to move line 128-133 one space to the left

still the same error

127 too

ghost commented 2 years ago

You need to move line 128-133 one space to the left

still the same error

127 too

image nope ;/

c0rrre commented 2 years ago

image nope ;/

Aaaand 135 :)

ghost commented 2 years ago

image nope ;/

Aaaand 135 :)

image

obertobr commented 2 years ago

image nope ;/

Aaaand 135 :)

image

is missing line 134 and 135 in your code image

ghost commented 2 years ago

thanks, it worked sorry for spamming these prints

ranger81 commented 2 years ago

Workaround without installed Chrome/Firefox browser

To let you all know, in case you are running the script on a server without installed Chrome or Firefox browser, you can do the following workaround:

In file TwitchChannelPointsMiner/classes/TwitchLogin.py comment out line 141, then insert instead the following line: self.set_token(input("Enter auth-token: ")). Additionally, adjust lines 128-131 as explained here. Pay attention to the indentation!

Now you can perform the login on your locally installed browser and manually check the cookie content. From the domain twitch.tv you should find a cookie with the name auth-token. Copy its contents.

Then start the Points Miner script and it will ask for the auth-token. Paste the previously copied cookie value and you should be logged in.

fadeff commented 2 years ago

how many spaces do i remove from 125 to 133

Lucifer192192 commented 2 years ago

twitch add kasada captcha, I can't even login on to Twitch from my browser

jactimel commented 2 years ago

image he seguido los pasos y no me funciona

Hendrik292 commented 2 years ago

Screenshot_14 it doesn't work

lombed commented 2 years ago

Workaround without installed Chrome/Firefox browser

To let you all know, in case you are running the script on a server without installed Chrome or Firefox browser, you can do the following workaround:

In file TwitchChannelPointsMiner/classes/TwitchLogin.py comment out line 141, then insert instead the following line: self.set_token(input("Enter auth-token: ")). Additionally, adjust lines 128-131 as explained here. Pay attention to the indentation!

Now you can perform the login on your locally installed browser and manually check the cookie content. From the domain twitch.tv you should find a cookie with the name auth-token. Copy its contents.

Then start the Points Miner script and it will ask for the auth-token. Paste the previously copied cookie value and you should be logged in.

and add 132-133

builtbyproxy commented 2 years ago

Workaround without installed Chrome/Firefox browser

To let you all know, in case you are running the script on a server without installed Chrome or Firefox browser, you can do the following workaround:

In file TwitchChannelPointsMiner/classes/TwitchLogin.py comment out line 141, then insert instead the following line: self.set_token(input("Enter auth-token: ")). Additionally, adjust lines 128-131 as explained here. Pay attention to the indentation!

Now you can perform the login on your locally installed browser and manually check the cookie content. From the domain twitch.tv you should find a cookie with the name auth-token. Copy its contents.

Then start the Points Miner script and it will ask for the auth-token. Paste the previously copied cookie value and you should be logged in.

How do we do this if we are running the docker compose option?

Is there the option for us to provide this in the run.py file? I've given it a shot in the following PR: #616

Voltzy commented 2 years ago

else:

  1. logger.error(f"Unknown error: {login_response}")

  2. raise NotImplementedError(

  3. f"Unknown TwitchAPI error code: {err_code}"

  4. )

  5. use_backup_flow = True
  6. break
  7. if "a

Confirming this works when done properly.

cjonsson97 commented 2 years ago

Workaround without installed Chrome/Firefox browser

To let you all know, in case you are running the script on a server without installed Chrome or Firefox browser, you can do the following workaround:

In file TwitchChannelPointsMiner/classes/TwitchLogin.py comment out line 141, then insert instead the following line: self.set_token(input("Enter auth-token: ")). Additionally, adjust lines 128-131 as explained here. Pay attention to the indentation!

Now you can perform the login on your locally installed browser and manually check the cookie content. From the domain twitch.tv you should find a cookie with the name auth-token. Copy its contents.

Then start the Points Miner script and it will ask for the auth-token. Paste the previously copied cookie value and you should be logged in.

I need to reenter my auth-token everytime I paste it, any idea what I would have done wrong?

jactimel commented 2 years ago

image a alguien sigue saliendo este error

VelesSage commented 2 years ago

made this fix Workaround without installed Chrome/Firefox browser, I entered my token, Streamer chap does not exist, please tell me what to do?

C:\Python\Twitch-Channel-Points-Miner-v2-master>python example1.py 11/10/22 14:54:13 - INFO - [run]: Start session: '07e89e3a-3f20-4d1f-9f66-20a4f243f31d' 11/10/22 14:54:13 - INFO - [run]: Loading data for 11 streamers. Please wait... 11/10/22 14:54:14 - INFO - [run]: Streamer chap does not exist 11/10/22 14:54:15 - INFO - [run]: Streamer streamer-username02 does not exist 11/10/22 14:54:16 - INFO - [run]: Streamer streamer-username03 does not exist 11/10/22 14:54:17 - INFO - [run]: Streamer streamer-username04 does not exist 11/10/22 14:54:18 - INFO - [run]: Streamer streamer-username05 does not exist 11/10/22 14:54:18 - INFO - [run]: Streamer streamer-username06 does not exist 11/10/22 14:54:19 - INFO - [run]: Streamer streamer-username07 does not exist 11/10/22 14:54:20 - INFO - [run]: Streamer streamer-username08 does not exist 11/10/22 14:54:21 - INFO - [run]: Streamer streamer-username09 does not exist 11/10/22 14:54:22 - INFO - [run]: Streamer streamer-username10 does not exist 11/10/22 14:54:23 - INFO - [run]: Streamer streamer-username11 does not exist 11/10/22 14:54:24 - WARNING - [warning]: websocket connected 11/10/22 14:54:24 - ERROR - [error]: error from callback <function WebSocketsPool.on_message at 0x000002520B80A1F0>: Error while trying to listen for a topic: {'type': 'RESPONSE', 'error': 'ERR_BADAUTH', 'nonce': 'B3vf8DV0fZH88GeSrtRFX9mEnsK3Ge'} 11/10/22 14:54:24 - ERROR - [on_error]: #0 - WebSocket error: Error while trying to listen for a topic: {'type': 'RESPONSE', 'error': 'ERR_BADAUTH', 'nonce': 'B3vf8DV0fZH88GeSrtRFX9mEnsK3Ge'}

BeastModeCoding commented 2 years ago

made this fix Workaround without installed Chrome/Firefox browser, I entered my token, Streamer chap does not exist, please tell me what to do?

C:\Python\Twitch-Channel-Points-Miner-v2-master>python example1.py 11/10/22 14:54:13 - INFO - [run]: Start session: '07e89e3a-3f20-4d1f-9f66-20a4f243f31d' 11/10/22 14:54:13 - INFO - [run]: Loading data for 11 streamers. Please wait... 11/10/22 14:54:14 - INFO - [run]: Streamer chap does not exist 11/10/22 14:54:15 - INFO - [run]: Streamer streamer-username02 does not exist 11/10/22 14:54:16 - INFO - [run]: Streamer streamer-username03 does not exist 11/10/22 14:54:17 - INFO - [run]: Streamer streamer-username04 does not exist 11/10/22 14:54:18 - INFO - [run]: Streamer streamer-username05 does not exist 11/10/22 14:54:18 - INFO - [run]: Streamer streamer-username06 does not exist 11/10/22 14:54:19 - INFO - [run]: Streamer streamer-username07 does not exist 11/10/22 14:54:20 - INFO - [run]: Streamer streamer-username08 does not exist 11/10/22 14:54:21 - INFO - [run]: Streamer streamer-username09 does not exist 11/10/22 14:54:22 - INFO - [run]: Streamer streamer-username10 does not exist 11/10/22 14:54:23 - INFO - [run]: Streamer streamer-username11 does not exist 11/10/22 14:54:24 - WARNING - [warning]: websocket connected 11/10/22 14:54:24 - ERROR - [error]: error from callback <function WebSocketsPool.on_message at 0x000002520B80A1F0>: Error while trying to listen for a topic: {'type': 'RESPONSE', 'error': 'ERR_BADAUTH', 'nonce': 'B3vf8DV0fZH88GeSrtRFX9mEnsK3Ge'} 11/10/22 14:54:24 - ERROR - [on_error]: #0 - WebSocket error: Error while trying to listen for a topic: {'type': 'RESPONSE', 'error': 'ERR_BADAUTH', 'nonce': 'B3vf8DV0fZH88GeSrtRFX9mEnsK3Ge'}

The thing that helped me to solve that problem is to delete cookies, login on twitch, get new cookies, retrieve and use new "auth-token". After that everything started to work normal

VelesSage commented 2 years ago

I deleted the cookies files, it didn't help, it's possible that I have several twitch accounts, chrome browser, I also log in with 10 configured users, and each has its own synchronization, its own cookies. I think that I could not go in without a fix, for the reason that the miner could not determine where to take the cookies, because of the accounts. And where to show, to prescribe in a manner, where to take these cookies, I do not know. I don't know how to do it in order to prescribe in a Miner-v2 that the browser is chrome and account 1, account 2, so that he sees it with this account cookies, and I need to run a few more Twitch with chrome accs at the same time, how to implement it?

qwerty123-noname commented 2 years ago

image but after fix this I get his problem... What is it and how to fix that?

Payker15 commented 1 year ago

Workaround without installed Chrome/Firefox browser

To let you all know, in case you are running the script on a server without installed Chrome or Firefox browser, you can do the following workaround:

In file TwitchChannelPointsMiner/classes/TwitchLogin.py comment out line 141, then insert instead the following line: self.set_token(input("Enter auth-token: ")). Additionally, adjust lines 128-131 as explained here. Pay attention to the indentation!

Now you can perform the login on your locally installed browser and manually check the cookie content. From the domain twitch.tv you should find a cookie with the name auth-token. Copy its contents.

Then start the Points Miner script and it will ask for the auth-token. Paste the previously copied cookie value and you should be logged in.

Where i can search auth_token?

Payker15 commented 1 year ago

Workaround without installed Chrome/Firefox browser

To let you all know, in case you are running the script on a server without installed Chrome or Firefox browser, you can do the following workaround: In file TwitchChannelPointsMiner/classes/TwitchLogin.py comment out line 141, then insert instead the following line: self.set_token(input("Enter auth-token: ")). Additionally, adjust lines 128-131 as explained here. Pay attention to the indentation! Now you can perform the login on your locally installed browser and manually check the cookie content. From the domain twitch.tv you should find a cookie with the name auth-token. Copy its contents. Then start the Points Miner script and it will ask for the auth-token. Paste the previously copied cookie value and you should be logged in.

Where i can search auth_token?

I copy auth-token contents. But when i start script run.py they closed, how i can fix it?

DIMITREOS commented 1 year ago

Easy Repair image