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.21k stars 676 forks source link

Streamer <name> does not exist, 401 Unauthorized #379

Closed Classic298 closed 2 years ago

Classic298 commented 2 years ago

Describe the bug When starting the bot, no matter if WITH password or without, the bot immediately tells me, that my configured streamer "does not exist" and the bot stops working resulting in an exception.

To Reproduce

  1. Set up the Bot
  2. Enter your Username
  3. It doesn't matter if you enter your password or not, it will fail either way.
  4. Configure a streamer
  5. run it

Expected behavior It works like it did for months

Desktop (please complete the following information):

Additional context The outputs:

04/01/22 00:10:58 - INFO - [run]: 💣  Start session: '<session id>'
04/01/22 00:10:58 - INFO - [run]: 🤓  Loading data for 1 streamers. Please wait...
04/01/22 00:10:58 - INFO - [run]: 😢  Streamer <streamer name> does not exist
04/01/22 00:10:59 - ERROR - [error]: error from callback <function WebSocketsPool.on_message at 0x761df610>: Error while trying to listen for a topic: {'type': 'RESPONSE', 'error': 'ERR_BADAUTH', 'nonce': 'bd0T6ZbhdQDUTFQo8nbqPjreSLsOL2'}
  File "/home/pi/.local/lib/python3.9/site-packages/websocket/_app.py", line 400, in _callback
    callback(self, *args)
  File "/home/pi/Twitch-Channel-Points-Miner-v2/TwitchChannelPointsMiner/classes/WebSocketsPool.py", line 378, in on_message
    raise RuntimeError(f"Error while trying to listen for a topic: {response}")
^C04/01/22 00:11:02 - INFO - [end]: CTRL+C Detected! Please wait just a moment!
04/01/22 00:11:02 - INFO - [on_close]: #0 - WebSocket closed

More detailed logs:

04/01/22 00:10:58 - DEBUG - urllib3.connectionpool - [_new_conn]: Starting new HTTPS connection (1): raw.githubusercontent.com:443
04/01/22 00:10:58 - DEBUG - urllib3.connectionpool - [_make_request]: https://raw.githubusercontent.com:443 "GET /Tkd-Alex/Twitch-Channel-Points-Miner-v2/master/TwitchChannelPointsMiner/__init__.py HTTP/1.1" 200 125
04/01/22 00:10:58 - INFO - TwitchChannelPointsMiner.TwitchChannelPointsMiner - [run]: Start session: '<session id>'
04/01/22 00:10:58 - INFO - TwitchChannelPointsMiner.TwitchChannelPointsMiner - [run]: Loading data for 1 streamers. Please wait...
04/01/22 00:10:58 - DEBUG - urllib3.connectionpool - [_new_conn]: Starting new HTTPS connection (1): gql.twitch.tv:443
04/01/22 00:10:58 - DEBUG - urllib3.connectionpool - [_make_request]: https://gql.twitch.tv:443 "POST /gql HTTP/1.1" 401 89
04/01/22 00:10:58 - DEBUG - TwitchChannelPointsMiner.classes.Twitch - [post_gql_request]: Data: {'operationName': 'ReportMenuItem', 'extensions': {'persistedQuery': {'version': 1, 'sha256Hash': '8f3628981255345ca5e5453dfd844efffb01d6413a9931498836e6268692a30c'}}, 'variables': {'channelLogin': '<streamer name>'}}, Status code: 401, Content: {"error":"Unauthorized","status":401,"message":"The \"Authorization\" token is invalid."}
04/01/22 00:10:58 - INFO - TwitchChannelPointsMiner.TwitchChannelPointsMiner - [run]: Streamer <streamer name> does not exist
04/01/22 00:10:59 - DEBUG - TwitchChannelPointsMiner.classes.TwitchWebSocket - [send]: #0 - Send: {"type":"PING"}
04/01/22 00:10:59 - DEBUG - TwitchChannelPointsMiner.classes.TwitchWebSocket - [send]: #0 - Send: {"type":"LISTEN","nonce":"bd0T6ZbhdQDUTFQo8nbqPjreSLsOL2","data":{"topics":["community-points-user-v1.273963666"],"auth_token":"<auth token>"}}
04/01/22 00:10:59 - DEBUG - TwitchChannelPointsMiner.classes.TwitchWebSocket - [send]: #0 - Send: {"type":"PING"}
04/01/22 00:10:59 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #0 - Received: { "type": "PONG" }
04/01/22 00:10:59 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #0 - Received: {"type":"RESPONSE","error":"ERR_BADAUTH","nonce":"bd0T6ZbhdQDUTFQo8nbqPjreSLsOL2"}
04/01/22 00:10:59 - ERROR - websocket - [error]: error from callback <function WebSocketsPool.on_message at 0x761df610>: Error while trying to listen for a topic: {'type': 'RESPONSE', 'error': 'ERR_BADAUTH', 'nonce': 'bd0T6ZbhdQDUTFQo8nbqPjreSLsOL2'}
04/01/22 00:10:59 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #0 - Received: { "type": "PONG" }
04/01/22 00:11:02 - INFO - TwitchChannelPointsMiner.TwitchChannelPointsMiner - [end]: CTRL+C Detected! Please wait just a moment!

And finally, my setup:

twitch_miner.mine(
    [Streamer("<streamer name>", settings=StreamerSettings(make_predictions=False, follow_raid=True, claim_drops=True, watch_streak=True, join_chat=True))], followers=False
    )

Of course I did insert my username (and my password, sometimes, sometimes not for testing purposes) But no matter what, the bot doesn't work and it results in an Exception

Classic298 commented 2 years ago

UPDATE: I just re-made my run.py file with the new example.py. After all, my run.py definitely became a little old.

But: same issue. Streamer does not exist.

simonk83 commented 2 years ago

From the log it looks like maybe your two factor token expired and it’s not asking for a new one (either that or your password is wrong). Maybe try disabling two factor for a bit and try the script again. If that works, re-enable two factor and the script might ask you to enter your new token

Classic298 commented 2 years ago

From the log it looks like maybe your two factor token expired and it’s not asking for a new one (either that or your password is wrong). Maybe try disabling two factor for a bit and try the script again. If that works, re-enable two factor and the script might ask you to enter your new token

I tried that. I deleted the 2FA. But the bot crashes in the exact same way.

Classic298 commented 2 years ago

From the log it looks like maybe your two factor token expired and it’s not asking for a new one (either that or your password is wrong). Maybe try disabling two factor for a bit and try the script again. If that works, re-enable two factor and the script might ask you to enter your new token

UPDATE

I deleted everything from my folder (except run.py) Then i did the git reset --hard then git pull

then execute run.py

It WORKS!

Just reset everything and it works. ridiculous.