rdavydov / Twitch-Channel-Points-Miner-v2

[NEW] A simple script that will watch a stream for you and earn the channel points. A successor of Tkd-Alex's original repo.
GNU General Public License v3.0
1.21k stars 352 forks source link

ERR_BADAUTH & campaigns/inventory Errors #321

Closed misspent closed 1 year ago

misspent commented 1 year ago

Describe the bug

I am currently having persistent difficulties in getting proper functionality with the application. Despite diligently attempting a range of troubleshooting steps, I have been unable to successfully resolve the problem. Regrettably, the application has yet to work as intended.

Steps to reproduce

All I do it run the file

Expected behavior

To work as intended, but it doesn't for me.

Operating system

Windows 10 Pro 22H2 (10.0.19045 Build 19045)

Python version

3.11.4

Miner version

1.8.3

Other relevant software versions

No response

Logs

📄 Log File ```python 05/08/23 21:46:50 - INFO - TwitchChannelPointsMiner.TwitchChannelPointsMiner - [__init__]: Twitch Channel Points Miner v2-1.8.3 (fork by rdavydov) 05/08/23 21:46:50 - INFO - TwitchChannelPointsMiner.TwitchChannelPointsMiner - [__init__]: https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2 05/08/23 21:46:50 - INFO - TwitchChannelPointsMiner.TwitchChannelPointsMiner - [run]: Start session: '' 05/08/23 21:47:13 - INFO - TwitchChannelPointsMiner.TwitchChannelPointsMiner - [run]: Load 0 followers from your profile! 05/08/23 21:47:13 - INFO - TwitchChannelPointsMiner.TwitchChannelPointsMiner - [run]: Loading data for 12 streamers. Please wait... 05/08/23 21:47:24 - INFO - TwitchChannelPointsMiner.TwitchChannelPointsMiner - [run]: Streamer streamer-username11 does not exist 05/08/23 21:47:26 - INFO - TwitchChannelPointsMiner.classes.Chat - [run]: Join IRC Chat: cohhcarnage 05/08/23 21:47:26 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_online]: Streamer(username=cohhcarnage, channel_id=26610234, channel_points=400) is Online! 05/08/23 21:47:27 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_offline]: Streamer(username=kiraonttv, channel_id=27871877, channel_points=820) is Offline! 05/08/23 21:47:29 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_offline]: Streamer(username=immarksman, channel_id=15386355, channel_points=20) is Offline! 05/08/23 21:47:31 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_offline]: Streamer(username=syntacyt, channel_id=155426882, channel_points=0) is Offline! 05/08/23 21:47:32 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_offline]: Streamer(username=zackrawrr, channel_id=552120296, channel_points=0) is Offline! 05/08/23 21:47:34 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_offline]: Streamer(username=burkeblack, channel_id=44338537, channel_points=10) is Offline! 05/08/23 21:47:36 - INFO - TwitchChannelPointsMiner.classes.Chat - [run]: Join IRC Chat: quin69 05/08/23 21:47:36 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_online]: Streamer(username=quin69, channel_id=56649026, channel_points=0) is Online! 05/08/23 21:47:38 - INFO - TwitchChannelPointsMiner.classes.Chat - [run]: Join IRC Chat: lirik 05/08/23 21:47:38 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_online]: Streamer(username=lirik, channel_id=23161357, channel_points=0) is Online! 05/08/23 21:47:39 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_offline]: Streamer(username=aceu, channel_id=88946548, channel_points=0) is Offline! 05/08/23 21:47:41 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_offline]: Streamer(username=lprod_, channel_id=119690902, channel_points=0) is Offline! 05/08/23 21:47:43 - INFO - TwitchChannelPointsMiner.classes.entities.Streamer - [set_offline]: Streamer(username=tubinmonkey, channel_id=43250238, channel_points=0) is Offline! 05/08/23 21:48:14 - ERROR - websocket - [error]: error from callback : Error while trying to listen for a topic: {'type': 'RESPONSE', 'error': 'ERR_BADAUTH', 'nonce': 'wyaO6TUElDeIAdKHEqpkLm4M3Q4emV'} 05/08/23 21:48:14 - ERROR - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_error]: #0 - WebSocket error: Error while trying to listen for a topic: {'type': 'RESPONSE', 'error': 'ERR_BADAUTH', 'nonce': 'wyaO6TUElDeIAdKHEqpkLm4M3Q4emV'} ```
❓ Code that ought to be shown in the log file but doesn't? I'm not sure why. ```python Exception in thread Sync campaigns/inventory: Traceback (most recent call last): File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner self.run() File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run self._target(*self._args, **self._kwargs) File "C:\Users\USERNAME\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\Twitch.py", line 799, in sync_campaigns self.__get_drops_dashboard(status="ACTIVE") File "C:\Users\USERNAME\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\Twitch.py", line 700, in __get_drops_dashboard filter(lambda x: x["status"] == status.upper(), campaigns)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable ```
📝 Contents in my Run.py file ```python # -*- coding: utf-8 -*- import logging from colorama import Fore from TwitchChannelPointsMiner import TwitchChannelPointsMiner from TwitchChannelPointsMiner.logger import LoggerSettings, ColorPalette from TwitchChannelPointsMiner.classes.Chat import ChatPresence from TwitchChannelPointsMiner.classes.Discord import Discord from TwitchChannelPointsMiner.classes.Matrix import Matrix from TwitchChannelPointsMiner.classes.Telegram import Telegram from TwitchChannelPointsMiner.classes.Settings import Priority, Events, FollowersOrder from TwitchChannelPointsMiner.classes.entities.Bet import Strategy, BetSettings, Condition, OutcomeKeys, FilterCondition, DelayMode from TwitchChannelPointsMiner.classes.entities.Streamer import Streamer, StreamerSettings twitch_miner = TwitchChannelPointsMiner( username="", password="", # If no password will be provided, the script will ask interactively claim_drops_startup=True, # If you want to auto claim all drops from Twitch inventory on the startup priority=[ # Custom priority in this case for example: Priority.DROPS, # - When we don't have anymore watch streak to catch, wait until all drops are collected over the streamers Priority.STREAK, # - We want first of all to catch all watch streak from all streamers Priority.POINTS_DESCEDING # - When we have all of the drops claimed and no watch-streak available, use the order priority (POINTS_ASCENDING, POINTS_DESCEDING) ], enable_analytics=False, # Disables Analytics if False. Disabling it significantly reduces memory consumption disable_ssl_cert_verification=False, # Set to True at your own risk and only to fix SSL: CERTIFICATE_VERIFY_FAILED error disable_at_in_nickname=True, # Set to True if you want to check for your nickname mentions in the chat even without @ sign logger_settings=LoggerSettings( save=True, # If you want to save logs in a file (suggested) console_level=logging.INFO, # Level of logs - use logging.DEBUG for more info console_username=False, # Adds a username to every console log line if True. Useful when you have many open consoles with different accounts auto_clear=True, # Create a file rotation handler with interval = 1D and backupCount = 7 if True (default) time_zone="", # Set a specific time zone for console and file loggers. Use tz database names. Example: "America/Denver" file_level=logging.INFO, # Level of logs - If you think the log file it's too big, use logging.INFO emoji=False, # On Windows, we have a problem printing emoji. Set to false if you have a problem less=False, # If you think that the logs are too verbose, set this to True colored=True, # If you want to print colored text color_palette=ColorPalette( # You can also create a custom palette color (for the common message). STREAMER_ONLINE = Fore.GREEN, # Don't worry about lower/upper case. The script will parse all the values. STREAMER_OFFLINE = Fore.RED, # Read more in README.md BET_WIN = Fore.GREEN # Color allowed are: [BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET]. ) ), streamer_settings=StreamerSettings( make_predictions=False, # If you want to Bet / Make prediction follow_raid=True, # Follow raid to obtain more points claim_drops=True, # We can't filter rewards base on stream. Set to False for skip viewing counter increase and you will never obtain a drop reward from this script. Issue #21 claim_moments=True, # If set to True, https://help.twitch.tv/s/article/moments will be claimed when available watch_streak=True, # If a streamer go online change the priority of streamers array and catch the watch screak. Issue #11 chat=ChatPresence.ONLINE, # Join irc chat to increase watch-time [ALWAYS, NEVER, ONLINE, OFFLINE] bet=BetSettings( strategy=Strategy.SMART, # Choose you strategy! percentage=5, # Place the x% of your channel points percentage_gap=20, # Gap difference between outcomesA and outcomesB (for SMART strategy) max_points=50000, # If the x percentage of your channel points is gt bet_max_points set this value stealth_mode=True, # If the calculated amount of channel points is GT the highest bet, place the highest value minus 1-2 points Issue #33 delay_mode=DelayMode.FROM_END, # When placing a bet, we will wait until `delay` seconds before the end of the timer delay=6, minimum_points=20000, # Place the bet only if we have at least 20k points. Issue #113 filter_condition=FilterCondition( by=OutcomeKeys.TOTAL_USERS, # Where apply the filter. Allowed [PERCENTAGE_USERS, ODDS_PERCENTAGE, ODDS, TOP_POINTS, TOTAL_USERS, TOTAL_POINTS] where=Condition.GTE, # 'by' must be [GT, LT, GTE, LTE] than value value=1.3 ) ) ) ) # You can customize the settings for each streamer. If not settings were provided, the script would use the streamer_settings from TwitchChannelPointsMiner. # If no streamer_settings are provided in TwitchChannelPointsMiner the script will use default settings. # The streamers array can be a String -> username or Streamer instance. # The settings priority are: settings in mine function, settings in TwitchChannelPointsMiner instance, default settings. # For example, if in the mine function you don't provide any value for 'make_prediction' but you have set it on TwitchChannelPointsMiner instance, the script will take the value from here. # If you haven't set any value even in the instance the default one will be used #twitch_miner.analytics(host="127.0.0.1", port=5000, refresh=5, days_ago=7) # Start the Analytics web-server twitch_miner.mine( [ "CohhCarnage", "KiraOnTTV", "ImMarksman", "SyntacYT", "zackrawrr", "BurkeBlack", "Quin69", "LIRIK", "aceu", "lProd_", "TubinMonkey" ], # Array of streamers (order = priority) followers=True, # Automatic download the list of your followers followers_order=FollowersOrder.DESC # Sort the followers list by follow date. ASC or DESC ) ```

Additional context

🚀 Steps Taken to Address the Issue

  1. Cleared the cache.
  2. Modified settings in the run.py file.
  3. Re-installed the application on four separate occasions.
  4. Deleted logs multiple times.
  5. Re-installed Python in an attempt to rectify the problem.

Please let me know if there are any conditions that must be met in order to properly resolve this issue, as I am willing to provide additional information and actively assist in testing efforts should that prove helpful in resolving this matter.

Friebay commented 1 year ago

I'm encountering the same error when attempting to start the program today. Considering Twitch was experiencing some issues yesterday, it's possible that this bug is somehow related to that.

Edit: just turn off drops for now.

rdavydov commented 1 year ago

ERR_BADAUTH is already known as an error that happens when you have a wrong cookie file and wrong credentials in run.py.

rdavydov commented 1 year ago

Regarding campaigns/inventory errors, just set claim_drops=False, in your run.py while I'm working on a fix.

21mtd commented 1 year ago

It was a problem on Twitch, people couldn't load Twitch at all, like all got IP banned. Everything is fine for now. Update: Drop/campaigns currently causing errors in logs. Last night, the bot didnt work at all (all streamers don't exist)

misspent commented 1 year ago

@rdavydov Thank you for the tool and working on a fix :) @Friebay Thanks both of you for telling me how to temporarily fix it (managed to get rid of the one error)

ERR_BADAUTH is already known as an error that happens when you have a wrong cookie file and wrong credentials in run.py.

That confused me because I know I have the right credentials and "wrong cookie file" also dumbfounds me given how the file is generated for me when I activate my account and I only use one twitch account

rdavydov commented 1 year ago

Delete the cookie file (cookies/username.pkl) and log in again with the miner to generate a new, correct one.

Friebay commented 1 year ago

Now I am getting this error in WebSocketsPool.py: Exception has occurred: WebSocketException socket is already opened File "C:\Users\user\Downloads\Twitch-Channel-Points-Miner-v2-master\Twitch-Channel-Points-Miner-v2-master\TwitchChannelPointsMiner\classes\WebSocketsPool.py", line 77, in <lambda> thread_ws = Thread(target=lambda: self.ws[index].run_forever()) websocket._exceptions.WebSocketException: socket is already opened

Is this error related to this bug?

Edit: After redownloading WebSocketsPool.py, the error has been resolved.

rdavydov commented 1 year ago

Now I am getting this error in WebSocketsPool.py: Exception has occurred: WebSocketException socket is already opened File "C:\Users\user\Downloads\Twitch-Channel-Points-Miner-v2-master\Twitch-Channel-Points-Miner-v2-master\TwitchChannelPointsMiner\classes\WebSocketsPool.py", line 77, in <lambda> thread_ws = Thread(target=lambda: self.ws[index].run_forever()) websocket._exceptions.WebSocketException: socket is already opened

Is this error related to this bug?

I don't think so. Just try to restart the miner.

misspent commented 1 year ago

Delete the cookie file (cookies/username.pkl) and log in again with the miner to generate a new, correct one.

I've tried that multiple times and I still get the error. I've reset my password too as a test and that did nothing.

Error I get ```python 06/08/23 20:03:08 - ERROR - [error]: error from callback : Error while trying to listen for a topic: {'type': 'RESPONSE', 'error': 'ERR_BADAUTH', 'nonce': 'hCL4bFlyeLdhLgrLXa3X4ZxwgciquJ'} 06/08/23 20:03:08 - ERROR - [on_error]: #0 - WebSocket error: Error while trying to listen for a topic: {'type': 'RESPONSE', 'error': 'ERR_BADAUTH', 'nonce': 'hCL4bFlyeLdhLgrLXa3X4ZxwgciquJ'} ```

Does it have some other dependencies I'm missing? I'll start messing with it some more, and I'll keep you updated if I somehow manage to get it working.


Edit: I changed my username and password, then reinstalled and got it all working, and I'm 99% sure it was a user issue. Thank you for the help you lot 👍

Vojtak42 commented 1 year ago

The campaigns error was already fixed?

rdavydov commented 1 year ago

@Vojtak42 see #326