A simple script that will watch a stream for you and earn the channel points.

Overview

Twitch Channel Points Miner - v2

License Python3 PRsWelcome GitHub Repo stars GitHub closed issues GitHub last commit

Credits

A simple script that will watch a stream for you and earn the channel points.

It can wait for a streamer to go live (+450 points when the stream starts), it will automatically click the bonus button (+50 points), and it will follow raids (+250 points).

Read more about channels point here

Main difference from the original repository:

  • Improve the logging
  • Final report with all the datas
  • Rewrite the entire code using classe instead of module with global variables
  • Automatic download the followers list and use as input
  • Better 'Watch Streak' strategy in priority system #11
  • Auto claim game drops from Twitch inventory #21 Read more about game drops here
  • Place the bet / make prediction and won or lose ( ๐Ÿ€ ) your channel points! No browser needed. #41 (@lay295)

Full logs

%d/%m/%y %H:%M:%S - INFO - [run]: ๐Ÿ’ฃ  Start session: '9eb934b0-1684-4a62-b3e2-ba097bd67d35'
%d/%m/%y %H:%M:%S - INFO - [run]: ๐Ÿค“  Loading data for x streamers. Please wait ...
%d/%m/%y %H:%M:%S - INFO - [set_offline]: ๐Ÿ˜ด  Streamer(username=streamer-username1, channel_id=0000000, channel_points=67247) is Offline!
%d/%m/%y %H:%M:%S - INFO - [set_offline]: ๐Ÿ˜ด  Streamer(username=streamer-username2, channel_id=0000000, channel_points=4240) is Offline!
%d/%m/%y %H:%M:%S - INFO - [set_offline]: ๐Ÿ˜ด  Streamer(username=streamer-username3, channel_id=0000000, channel_points=61365) is Offline!
%d/%m/%y %H:%M:%S - INFO - [set_offline]: ๐Ÿ˜ด  Streamer(username=streamer-username4, channel_id=0000000, channel_points=3760) is Offline!
%d/%m/%y %H:%M:%S - INFO - [set_online]: ๐Ÿฅณ  Streamer(username=streamer-username, channel_id=0000000, channel_points=61365) is Online!
%d/%m/%y %H:%M:%S - INFO - [start_bet]: ๐Ÿ”ง  Start betting for EventPrediction(event_id=xxxx-xxxx-xxxx-xxxx, title=Please star this repo) owned by Streamer(username=streamer-username, channel_id=0000000, channel_points=61365)
%d/%m/%y %H:%M:%S - INFO - [__open_coins_menu]: ๐Ÿ”ง  Open coins menu for EventPrediction(event_id=xxxx-xxxx-xxxx-xxxx, title=Please star this repo)
%d/%m/%y %H:%M:%S - INFO - [__click_on_bet]: ๐Ÿ”ง  Click on the bet for EventPrediction(event_id=xxxx-xxxx-xxxx-xxxx, title=Please star this repo)
%d/%m/%y %H:%M:%S - INFO - [__enable_custom_bet_value]: ๐Ÿ”ง  Enable input of custom value for EventPrediction(event_id=xxxx-xxxx-xxxx-xxxx, title=Please star this repo)
%d/%m/%y %H:%M:%S - INFO - [on_message]: โฐ  Place the bet after: 89.99s for: EventPrediction(event_id=xxxx-xxxx-xxxx-xxxx-15c61914ef69, title=Please star this repo)
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€  +12 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=61377) - Reason: WATCH.
%d/%m/%y %H:%M:%S - INFO - [make_predictions]: ๐Ÿ€  Going to complete bet for EventPrediction(event_id=xxxx-xxxx-xxxx-xxxx-15c61914ef69, title=Please star this repo) owned by Streamer(username=streamer-username, channel_id=0000000, channel_points=61377)
%d/%m/%y %H:%M:%S - INFO - [make_predictions]: ๐Ÿ€  Place 5k channel points on: SI (BLUE), Points: 848k, Users: 190 (70.63%), Odds: 1.24 (80.65%)
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€  +6675 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=64206) - Reason: PREDICTION.
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿ“Š  EventPrediction(event_id=xxxx-xxxx-xxxx-xxxx, title=Please star this repo) - Result: WIN, Points won: 6675
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€  +12 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=64218) - Reason: WATCH.
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€  +12 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=64230) - Reason: WATCH.
%d/%m/%y %H:%M:%S - INFO - [claim_bonus]: ๐ŸŽ  Claiming the bonus for Streamer(username=streamer-username, channel_id=0000000, channel_points=64230)!
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€  +60 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=64290) - Reason: CLAIM.
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€  +12 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=64326) - Reason: WATCH.
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€  +400 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=64326) - Reason: WATCH_STREAK.
%d/%m/%y %H:%M:%S - INFO - [claim_bonus]: ๐ŸŽ  Claiming the bonus for Streamer(username=streamer-username, channel_id=0000000, channel_points=64326)!
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€  +60 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=64386) - Reason: CLAIM.
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€  +12 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=64398) - Reason: WATCH.
%d/%m/%y %H:%M:%S - INFO - [update_raid]: ๐ŸŽญ  Joining raid from Streamer(username=streamer-username, channel_id=0000000, channel_points=64398) to another-username!
%d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€  +250 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=6845) - Reason: RAID.

Less logs

%d/%m %H:%M:%S - ๐Ÿ’ฃ  Start session: '9eb934b0-1684-4a62-b3e2-ba097bd67d35'
%d/%m %H:%M:%S - ๐Ÿค“  Loading data for 13 streamers. Please wait ...
%d/%m %H:%M:%S - ๐Ÿ˜ด  streamer-username1 (xxx points) is Offline!
%d/%m %H:%M:%S - ๐Ÿ˜ด  streamer-username2 (xxx points) is Offline!
%d/%m %H:%M:%S - ๐Ÿ˜ด  streamer-username3 (xxx points) is Offline!
%d/%m %H:%M:%S - ๐Ÿ˜ด  streamer-username4 (xxx points) is Offline!
%d/%m %H:%M:%S - ๐Ÿฅณ  streamer-username (xxx points) is Online!
%d/%m %H:%M:%S - ๐Ÿ”ง  Start betting for EventPrediction: Please star this repo owned by streamer-username (xxx points)
%d/%m %H:%M:%S - ๐Ÿ”ง  Open coins menu for EventPrediction: Please star this repo
%d/%m %H:%M:%S - ๐Ÿ”ง  Click on the bet for EventPrediction: Please star this repo
%d/%m %H:%M:%S - ๐Ÿ”ง  Enable input of custom value for EventPrediction: Please star this repo
%d/%m %H:%M:%S - โฐ  Place the bet after: 89.99s EventPrediction: Please star this repo
%d/%m %H:%M:%S - ๐Ÿš€  +12 โ†’ streamer-username (xxx points) - Reason: WATCH.
%d/%m %H:%M:%S - ๐Ÿ€  Going to complete bet for EventPrediction: Please star this repo owned by streamer-username (xxx points)
%d/%m %H:%M:%S - ๐Ÿ€  Place 5k channel points on: SI (BLUE), Points: 848k, Users: 190 (70.63%), Odds: 1.24 (80.65%)
%d/%m %H:%M:%S - ๐Ÿš€  +6675 โ†’ streamer-username (xxx points) - Reason: PREDICTION.
%d/%m %H:%M:%S - ๐Ÿ“Š  EventPrediction: Please star this repo - Result: WIN, Points won: 6675
%d/%m %H:%M:%S - ๐Ÿš€  +12 โ†’ streamer-username (xxx points) - Reason: WATCH.
%d/%m %H:%M:%S - ๐Ÿš€  +12 โ†’ streamer-username (xxx points) - Reason: WATCH.
%d/%m %H:%M:%S - ๐Ÿš€  +60 โ†’ streamer-username (xxx points) - Reason: CLAIM.
%d/%m %H:%M:%S - ๐Ÿš€  +12 โ†’ streamer-username (xxx points) - Reason: WATCH.
%d/%m %H:%M:%S - ๐Ÿš€  +400 โ†’ streamer-username (xxx points) - Reason: WATCH_STREAK.
%d/%m %H:%M:%S - ๐Ÿš€  +60 โ†’ streamer-username (xxx points) - Reason: CLAIM.
%d/%m %H:%M:%S - ๐Ÿš€  +12 โ†’ streamer-username (xxx points) - Reason: WATCH.
%d/%m %H:%M:%S - ๐ŸŽญ  Joining raid from streamer-username (xxx points) to another-username!
%d/%m %H:%M:%S - ๐Ÿš€  +250 โ†’ streamer-username (xxx points) - Reason: RAID.

Final report:

%d/%m/%y %H:%M:%S - ๐Ÿ›‘  End session 'f738d438-cdbc-4cd5-90c4-1517576f1299'
%d/%m/%y %H:%M:%S - ๐Ÿ“„  Logs file: /.../path/Twitch-Channel-Points-Miner-v2/logs/username.timestamp.log
%d/%m/%y %H:%M:%S - โŒ›  Duration 10:29:19.547371

%d/%m/%y %H:%M:%S - ๐Ÿ“Š  BetSettings(Strategy=Strategy.SMART, Percentage=7, PercentageGap=20, MaxPoints=7500
%d/%m/%y %H:%M:%S - ๐Ÿ“Š  EventPrediction(event_id=xxxx-xxxx-xxxx-xxxx, title="Event Title1")
		Streamer(username=streamer-username, channel_id=0000000, channel_points=67247)
		Bet(TotalUsers=1k, TotalPoints=11M), Decision={'choice': 'B', 'amount': 5289, 'id': 'xxxx-yyyy-zzzz'})
		Outcome0(YES (BLUE) Points: 7M, Users: 641 (58.49%), Odds: 1.6, (5}%)
		Outcome1(NO (PINK),Points: 4M, Users: 455 (41.51%), Odds: 2.65 (37.74%))
		Result: {'type': 'LOSE', 'won': 0}
%d/%m/%y %H:%M:%S - ๐Ÿ“Š  EventPrediction(event_id=yyyy-yyyy-yyyy-yyyy, title="Event Title2")
		Streamer(username=streamer-username, channel_id=0000000, channel_points=3453464)
		Bet(TotalUsers=921, TotalPoints=11M), Decision={'choice': 'A', 'amount': 4926, 'id': 'xxxx-yyyy-zzzz'})
		Outcome0(YES (BLUE) Points: 9M, Users: 562 (61.02%), Odds: 1.31 (76.34%))
		Outcome1(YES (PINK) Points: 3M, Users: 359 (38.98%), Odds: 4.21 (23.75%))
		Result: {'type': 'WIN', 'won': 6531}
%d/%m/%y %H:%M:%S - ๐Ÿ“Š  EventPrediction(event_id=ad152117-251b-4666-b683-18e5390e56c3, title="Event Title3")
		Streamer(username=streamer-username, channel_id=0000000, channel_points=45645645)
		Bet(TotalUsers=260, TotalPoints=3M), Decision={'choice': 'A', 'amount': 5054, 'id': 'xxxx-yyyy-zzzz'})
		Outcome0(YES (BLUE) Points: 689k, Users: 114 (43.85%), Odds: 4.24 (23.58%))
		Outcome1(NO (PINK) Points: 2M, Users: 146 (56.15%), Odds: 1.31 (76.34%))
		Result: {'type': 'LOSE', 'won': 0}

%d/%m/%y %H:%M:%S - ๐Ÿค–  Streamer(username=streamer-username, channel_id=0000000, channel_points=67247), Total points gained (after farming - before farming): -7838
%d/%m/%y %H:%M:%S - ๐Ÿ’ฐ  WATCH(35 times, 350 gained), CLAIM(11 times, 550 gained), PREDICTION(1 times, 6531 gained)
%d/%m/%y %H:%M:%S - ๐Ÿค–  Streamer(username=streamer-username1, channel_id=0000000, channel_points=4240), Total points gained (after farming - before farming): 0
%d/%m/%y %H:%M:%S - ๐Ÿค–  Streamer(username=streamer-username2, channel_id=0000000, channel_points=61365), Total points gained (after farming - before farming): 977
%d/%m/%y %H:%M:%S - ๐Ÿ’ฐ  WATCH(11 times, 132 gained), REFUND(1 times, 605 gained), CLAIM(4 times, 240 gained)
%d/%m/%y %H:%M:%S - ๐Ÿค–  Streamer(username=streamer-username3, channel_id=0000000, channel_points=6815), Total points gained (after farming - before farming): 0
%d/%m/%y %H:%M:%S - ๐Ÿค–  Streamer(username=streamer-username4, channel_id=0000000, channel_points=16386), Total points gained (after farming - before farming): 0
%d/%m/%y %H:%M:%S - ๐Ÿค–  Streamer(username=streamer-username5, channel_id=0000000, channel_points=25960), Total points gained (after farming - before farming): 1680
%d/%m/%y %H:%M:%S - ๐Ÿ’ฐ  WATCH(53 times, 530 gained), CLAIM(17 times, 850 gained)
%d/%m/%y %H:%M:%S - ๐Ÿค–  Streamer(username=streamer-username6, channel_id=0000000, channel_points=9430), Total points gained (after farming - before farming): 1120
%d/%m/%y %H:%M:%S - ๐Ÿ’ฐ  WATCH(42 times, 420 gained), WATCH_STREAK(1 times, 450 gained), CLAIM(14 times, 700 gained)
%d/%m/%y %H:%M:%S - ๐Ÿค–  Streamer(username=streamer-username7, channel_id=0000000, channel_points=2380), Total points gained (after farming - before farming): 0
%d/%m/%y %H:%M:%S - ๐Ÿค–  Streamer(username=streamer-username8, channel_id=0000000, channel_points=10230), Total points gained (after farming - before farming): 0

How to use:

  1. Clone this repository git clone https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2
  2. Install all the requirements pip install -r requirements.txt
  3. Create your run.py file start from example.py
# -*- coding: utf-8 -*-

import logging
from TwitchChannelPointsMiner import TwitchChannelPointsMiner
from TwitchChannelPointsMiner.logger import LoggerSettings
from TwitchChannelPointsMiner.classes.entities.Bet import Strategy, BetSettings, Condition, OutcomeKeys, FilterCondition
from TwitchChannelPointsMiner.classes.entities.Streamer import Streamer, StreamerSettings

twitch_miner = TwitchChannelPointsMiner(
    username="your-twitch-username",
    claim_drops_startup=False,                  # If you want to auto claim all drops from Twitch inventory on startup
    logger_settings=LoggerSettings(
        save=True,                              # If you want to save logs in file (suggested)
        console_level=logging.INFO,             # Level of logs - use logging.DEBUG for more info)
        file_level=logging.DEBUG,               # Level of logs - If you think the log file it's too big use logging.INFO
        emoji=True,                             # On Windows we have a problem to print emoji. Set to false if you have a problem
        less=False                              # If you think that the logs are too much verborse set this to True
    ),
    streamer_settings=StreamerSettings(
        make_predictions=True,                  # 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
        watch_streak=True,                      # If a streamer go online change the priotiry of streamers array and catch the watch screak. Issue #11
        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 stragegy)
            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 #33
            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.LTE,           # 'by' must be [GT, LT, GTE, LTE] than value
                value=800
            )
        )
    )
)

# You can customize the settings for each streamer. If not settings was provided the script will use the streamer_settings from TwitchChannelPointsMiner.
# If no streamer_settings 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.mine(
    [
        Streamer("streamer-username01", settings=StreamerSettings(make_predictions=True  , follow_raid=False , claim_drops=True  , watch_streak=True , bet=BetSettings(strategy=Strategy.SMART      , percentage=5 , stealth_mode=True,  percentage_gap=20 , max_points=234   , filter_condition=FilterCondition(by=OutcomeKeys.TOTAL_USERS,      where=Condition.LTE, value=800 ) ) )),
        Streamer("streamer-username02", settings=StreamerSettings(make_predictions=False , follow_raid=True  , claim_drops=False ,                     bet=BetSettings(strategy=Strategy.PERCENTAGE , percentage=5 , stealth_mode=False, percentage_gap=20 , max_points=1234  , filter_condition=FilterCondition(by=OutcomeKeys.TOTAL_POINTS,     where=Condition.GTE, value=250 ) ) )),
        Streamer("streamer-username03", settings=StreamerSettings(make_predictions=True  , follow_raid=False ,                     watch_streak=True , bet=BetSettings(strategy=Strategy.SMART      , percentage=5 , stealth_mode=False, percentage_gap=30 , max_points=50000 , filter_condition=FilterCondition(by=OutcomeKeys.ODDS,             where=Condition.LT,  value=300 ) ) )),
        Streamer("streamer-username04", settings=StreamerSettings(make_predictions=False , follow_raid=True  ,                     watch_streak=True                                                                                                                                                                                                                                 )),
        Streamer("streamer-username05", settings=StreamerSettings(make_predictions=True  , follow_raid=True  , claim_drops=True ,  watch_streak=True , bet=BetSettings(strategy=Strategy.HIGH_ODDS  , percentage=7 , stealth_mode=True,  percentage_gap=20 , max_points=90    , filter_condition=FilterCondition(by=OutcomeKeys.PERCENTAGE_USERS, where=Condition.GTE, value=300 ) ) )),
        Streamer("streamer-username06"),
        Streamer("streamer-username07"),
        Streamer("streamer-username08"),
        "streamer-username09",
        "streamer-username10",
        "streamer-username11"
    ],                                 # Array of streamers (order = priority)
    followers=False                    # Automatic download the list of your followers (unable to set custom settings for you followers list)
)

You can also use all the default values except for your username obv. Short version:

from TwitchChannelPointsMiner import TwitchChannelPointsMiner
twitch_miner = TwitchChannelPointsMiner("your-twitch-username")
twitch_miner.mine(["streamer1", "streamer2"])                   # Array of streamers OR
twitch_miner.mine(followers=True)                               # Automatic use the followers list OR
twitch_miner.mine(["streamer1", "streamer2"], followers=True)   # Mixed
  1. Start mining! python run.py

Limits

Twitch has a limit - you can't watch more than 2 channels at one time. We take the first two streamers from the list as they have the highest priority.

Make sure to write the streamers array in order of priority from left to right. If you use followers=True Twitch return the streamers order by followed_at. So your last follow have the highest priority.

Settings

LoggerSettings

Key Type Default Description
save bool True If you want to save logs in file (suggested)
less bool False Reduce the logging format and message verbosity #10
console_level level logging.INFO Level of logs in terminal - Use logging.DEBUG for more helpful messages.
file_level level logging.DEBUG Level of logs in file save - If you think the log file it's too big use logging.INFO
emoji bool For Windows is False else True On Windows we have a problem to print emoji. Set to false if you have a problem

StreamerSettings

Key Type Default Description
make_predictions bool True Choose if you want to make predictions / bet or not
follow_raid bool True Choose if you want to follow raid +250 points
claim_drops bool True If this values is True the script will increase the watch-time for the current game. With this you are able to claim the drops from Twitch Inventory #21
watch_streak bool True Choose if you want to change priority for this streamers and try to catch the Watch Streak event #11
bet BetSettings Rules to follow for the bet

BetSettings

Key Type Default Description
strategy Strategy SMART Choose your strategy! See above for more info
percentage int 5 Place the x% of your channel points
percentage_gap int 20 Gap difference between outcomesA and outcomesB (for SMART stragegy)
max_points int 50000 If the x percentage of your channel points is GT bet_max_points set this value
stealth_mode bool False If the calculated amount of channel points is GT the highest bet, place the highest value minus 1-2 points #33
filter_condition FilterCondition None Based on this filter the script will skip some bet #29

Bet strategy

  • MOST_VOTED: Select the option most voted based on users count
  • HIGH_ODDS: Select the option with the highest odds
  • PERCENTAGE: Select the option with the highest percentage based on odds (It's the same that show Twitch) - Should be the same of select LOWEST_ODDS
  • SMART: If the majority in percent chose an option then follow the other users, otherwise choose the option with the highest odds

Screenshot

Here a concrete example:

  • MOST_VOTED: 21 Users have select 'over 7.5', instead of 9 'under 7.5'
  • HIGH_ODDS: The highest odd is 2.27 on 'over 7.5' vs 1.79 on 'under 7.5'
  • PERCENTAGE: The highest percentage is 56% for 'under 7.5'
  • SMART: Calculate the percentage based on the users. The percentage are: 'over 7.5': 70% and 'under 7.5': 30%. If the difference between the two percatage are highter thant percentage_gap select the highest percentage, else the highest odds. In this case if percentage_gap = 20 ; 70-30 = 40 > percentage_gap, so the bot will select 'over 7.5'

FilterCondition

Key Type Default Description
by OutcomeKeys None Key to apply the filter
where Condition None Condition that should match for place bet
value number None Value to compare

Allowed values for by are:

  • PERCENTAGE_USERS (no sum) [Would never want a sum as it'd always be 100%]
  • ODDS_PERCENTAGE (no sum) [Doesn't make sense to sum odds]
  • ODDS (no sum) [Doesn't make sense to sum odds]
  • DECISION_USERS (no sum)
  • DECISION_POINTS (no sum)
  • TOP_POINTS (no sum) [Doesn't make sense to the top points of both sides]
  • TOTAL_USERS (sum)
  • TOTAL_POINTS (sum)

Allowed values for where are: GT, LT, GTE, LTE

Example

  • If you want to place the bet ONLY if the total of users participants in the bet are greater than 200 FilterCondition(by=OutcomeKeys.TOTAL_USERS, where=Condition.GT, value=200)
  • If you want to place the bet ONLY if the winning odd of your decision is greater than or equal 1.3 FilterCondition(by=OutcomeKeys.ODDS, where=Condition.GTE, value=1.3)
  • If you want to place the bet ONLY if highest bet is lower than 2000 FilterCondition(by=OutcomeKeys.TOP_POINTS, where=Condition.LT, value=2000)

Migrating from old repository (the original one):

If you already have a twitch-cookies.pkl and you don't want to login again please create a cookies/ folder in the current directory and then copy the .pkl file with a new name your-twitch-username.pkl

.
+-- run.py
+-- cookies
|   +-- your-twitch-username.pkl

Windows

Other users have find multiple problems on Windows my suggestion are:

  • Stop use Windows ๐Ÿ˜
  • Suppress the emoji in logs with logger_settings=LoggerSettings(emoji=False)

Other usefully infos can be founded here: https://github.com/gottagofaster236/Twitch-Channel-Points-Miner/issues/31

Issue / Debug

When you open a new issue please use the correct template. Please provide at least the following information/files:

  • Operation System
  • Python Version
  • logs/ LoggerSettings(file_level=logging.DEBUG)

Make sure also to have the latest commit.

Disclaimer

This project comes with no gurantee or warranty. You are responsible for whatever happens from using this project. It is possible to get soft or hard banned by using this project if you are not careful. This is a personal project and is in no way affiliated with Twitch.

Comments
  • Drop collection

    Drop collection

    Current repo implementation does not count viewing time towards timed Drop rewards.

    The example I looked at needs to be claimed (button clicked) every hour to continue earning towards watched time. So simply going afk only ever builds up time for 1 drop. You can Claim via a popup message box in chat (same as channel points) or via the inventory page, you could have multiple claim buttons here. I've included code for both buttons should they require css descriptors.

    twitchchatclaimbutton.txt twitchinventoryclaimbutton.txt

    I assume this also means other types of Drop reward are not able to be collected?

    Solution could be to keep the channel stream open, which I don't believe currently happens, clicking the claim button when it appears. Most pages have the "drops enabled" tag so wouldn't need to happen if no drops enabled. Or a periodic check of your inventory for available items to be claimed could be a simpler catch-all (assuming watch progress starts to be recorded).

    enhancement 
    opened by SiIason 57
  • Show analytics of your points mining

    Show analytics of your points mining

    Description

    You can navigate to localhost:5000 and see a chart with your points history. We collect every update like watch, claim, prediction, etc.

    The following screenshot are just an example.

    Screenshot

    Type of change

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [x] New feature (non-breaking change which adds functionality)
    • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)

    Checklist:

    • [x] My code follows the style guidelines of this project
    • [x] I have performed a self-review of my own code
    • [x] I have commented on my code, particularly in hard-to-understand areas
    • [x] I have made corresponding changes to the documentation (README.md)
    • [x] My changes generate no new warnings
    • [x] Any dependent changes have been updated in requirements.txt
    enhancement 
    opened by Tkd-Alex 56
  • more than one account

    more than one account

    threads do not allow more than one account, but the process allows, through the multiprocessing module, the Process function, thus the websocket module can use more than one account, but each process takes exactly the same amount of memory as one process, which now may need to be changed itself websocket module, if there are analogues (not searched)

    enhancement 
    opened by Lim0H 46
  • when the conexion down they no reconnect automatically

    when the conexion down they no reconnect automatically

    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem. You can enable the screenshot using: BrowserSettings(do_screenshot=True)

    Desktop (please complete the following information):

    • OS: [e.g. Windows]
    • Browser [e.g. chrome, firefox]
    • Python version [e.g. 3.x]

    Additional context Add any other context about the problem here.

    bug 
    opened by juandeigo1014o 46
  • Improvement Drops from Twitch Inventory

    Improvement Drops from Twitch Inventory

    • Close #65
    • Close #40
    • Close #35
    • Close #27

    I'm currently working on this, I've changed multiple things. @SiIason can you please test it for us?

    This version is in early stage, and maybe you will find a multiple issue. Please report under this page

    The following logs will be edited in the future:

    12/02/21 16:07:16 - INFO - [send_minute_watched_events]: Streamer(username=nordschnack, channel_id=00000, channel_points=0)
    12/02/21 16:07:16 - INFO - [send_minute_watched_events]: Stream(title=๐Ÿ‘‰โ—๐Ÿ’• Drop ON | TALK | GAMING | GRAPHICS๐Ÿ”ž[Ger | ENG] โ–บ ใƒ„ โ™ฅ Nordy๐Ÿ’• ใƒ„, game=ArcheAge: Unchained, tags=Drops Enabled, German, Gaming News, Live Vlogging)
    12/02/21 16:07:16 - INFO - [send_minute_watched_events]: Campaign(id=xxxx, name=AA:Unchained - Feb Event, game={'id': '514519', 'name': 'ArcheAge: Unchained', 'displayName': 'ArcheAge: Unchained', '__typename': 'Game'}, in_inventory=True)
    12/02/21 16:07:16 - INFO - [send_minute_watched_events]: Drop(id=xxxx, name=Bound Stormwail Sax, benefit=Bound Stormwail Sax, minutes_required=120, has_preconditions_met=True, current_minutes_watched=65, percentage_progress=54%, drop_instance_id=None, is_claimed=False)
    12/02/21 16:07:16 - INFO - [send_minute_watched_events]: |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ                       |	54% [65/120]
    

    Currently, the logs are printed each minute. In the future will be printed only at (0, 25, 50, 75, 100)%. We need also an idea to print only the current drops active. I don't know how to catch. Because we are watching two streamers with drops active, but obviously the drops are increase only for one campaign.

    I've also added a Priority system. Related to #27

    from TwitchChannelPointsMiner.classes.Settings import Priority
    TwitchChannelPointsMiner(priority=[Priority.DROPS, Priority.STREAK, Priority.ORDER])
    
    enhancement improvements 
    opened by Tkd-Alex 31
  • Use GraphQL instead of Helix API

    Use GraphQL instead of Helix API

    Description

    The current Client-ID seems to don't work any more for the Helix API request. Current workaround It's to use the GraphQL request to get streamer_id and followers list.

    Fixes #281 #284 #292 #293

    Type of change

    Please delete options that are not relevant.

    • [x] Bug fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality not to work as expected)

    Checklist:

    • [x] My code follows the style guidelines of this project
    • [x] I have performed a self-review of my code
    • [x] I have commented on my code, particularly in hard-to-understand areas
    • [x] I have made corresponding changes to the documentation (README.md)
    • [x] My changes generate no new warnings
    • [x] Any dependent changes have been updated in requirements.txt
    bug 
    opened by Tkd-Alex 30
  • Make it Heroku friendly

    Make it Heroku friendly

    I've been trying to run it on Heroku and its quite hard. Every time I restart dynos, it will create new session thus needing to enter 2fa key. Without console, it really hard. image

    If i remove 2fa this happen: image

    enhancement 
    opened by hokagay7 30
  • Unable to complete the bet.

    Unable to complete the bet. "Cast prediction" button issue.

    image

    I think the problem is related to this "Cast prediction" I've never seen before :fearful:

    Originally posted by @Tkd-Alex in https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/6#issuecomment-766334818


    We are currently waiting the @Element21 html logs for fix this.

    bug 
    opened by Tkd-Alex 27
  • Connect user to chat to increase watchtime

    Connect user to chat to increase watchtime

    add irc chat client list user as viewer in selected chat viewtime increases while connected

    Referenced issue https://github.com/gottagofaster236/Twitch-Channel-Points-Miner/issues/16

    enhancement 
    opened by anoviel 26
  • Features/improvements to analytics

    Features/improvements to analytics

    Description

    • [x] A feature to sort streamers by current point totals as well as alphabetical order. ~~Sort by online/offline status as well possibly.~~
    • [ ] ~~A separate graph that includes the points/changes/etc from all tracked streamers in one, showing the sum total of points in all channels that are tracked by the bot. Ability to include/exclude streamers from this graph would be useful too, maybe have checkboxes for all the streamers and a select/deselect all button.~~
    • [x] Move the list of streamers to the side of the graph, and make it vertical instead of horizontal at the top. Would really help when you have a big list of streamers.
    • [x] Option to only show stats from x date/time without having to zoom in or select the last part of the graph and/or a zoom in option that always zooms in to the last part of the graph instead of in the middle of it.

    Fixes #117

    Type of change

    Please delete options that are not relevant.

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [x] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality not to work as expected)

    Checklist:

    • [x] My code follows the style guidelines of this project
    • [x] I have performed a self-review of my code
    • [x] I have commented on my code, particularly in hard-to-understand areas
    • [ ] I have made corresponding changes to the documentation (README.md)
    • [x] My changes generate no new warnings
    improvements 
    opened by Tkd-Alex 22
  • No bets placed anymore

    No bets placed anymore

    There are several channels where the script used to place bets in the past, and it doesnt work anymore. Runtime of the bets is always arround 2 minutes. There are less then 400 people in the channels and only a handful of them place a bet.

    For each bet I see the similar two lines in my log, but no bet is placed for many many days now. There is no other entry before or after these two lines in regards to this bet event.

    I tired to modify the delay to no avail.

    Any Idea what I'm doing wrong or is going wrong?

    LOG: 12/08/21 16:56:12 - DEBUG - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: #0 - Received: {"type":"MESSAGE","data":{"topic":"predictions-channel-v1.28868142","message":"{$ 12/08/21 16:56:12 - INFO - TwitchChannelPointsMiner.classes.WebSocketsPool - [on_message]: Place the bet after: 0.78s for: EventPrediction(event_id=e0fe55fd-e30e-4e3d-b6f5-b65ec861c3ec, s$ 12/08/21 16:56:13 - INFO - TwitchChannelPointsMiner.classes.Twitch - [make_predictions]: Going to complete bet for EventPrediction(event_id=e0fe55fd-e30e-4e3d-b6f5-b65ec861c3ec, streamer=$ 12/08/21 16:56:13 - DEBUG - TwitchChannelPointsMiner.classes.TwitchWebSocket - [send]: #0 - Send: {"type":"PING"}

    CONFIG: streamer_settings=StreamerSettings( make_predictions=True, # 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. Is$ watch_streak=True, # If a streamer go online change the priotiry of streamers array and catch the watch screak. Issue #11 join_chat=True, # Join irc chat to increase watch-time 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 stragegy) max_points=5000, # 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 #33 delay_mode=DelayMode.FROM_START, delay=0.8, 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.LTE, # 'by' must be [GT, LT, GTE, LTE] than value value=800 ) ) )

    bug 
    opened by hoak2 16
  • Just drop and Site update

    Just drop and Site update

    Hello, it would be nice to find channels that drop drops from channels we do not follow and watch them. The site may change a little, it would be a better use, such as renewing followers and editing other settings without turning the bot off and on.

    enhancement 
    opened by potovzuc 0
  • Bump actions/setup-python from 4.1.0 to 4.4.0

    Bump actions/setup-python from 4.1.0 to 4.4.0

    Bumps actions/setup-python from 4.1.0 to 4.4.0.

    Release notes

    Sourced from actions/setup-python's releases.

    Add support to install multiple python versions

    In scope of this release we added support to install multiple python versions. For this you can try to use this snippet:

        - uses: actions/setup-python@v4
          with:
            python-version: |
                3.8
                3.9
                3.10
    

    Besides, we changed logic with throwing the error for GHES if cache is unavailable to warn (actions/setup-python#566).

    Improve error handling and messages

    In scope of this release we added improved error message to put operating system and its version in the logs (actions/setup-python#559). Besides, the release

    v4.3.0

    • Update @โ€‹actions/core to 1.10.0 version #517
    • Update @โ€‹actions/cache to 3.0.4 version #499
    • Only use github.token on github.com #443
    • Improvement of documentation #477 #479 #491 #492

    Add check-latest input and bug fixes

    In scope of this release we add theย check-latestย input. Ifย check-latestย is set toย true, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, the version will then be downloaded fromย python-versionsย repository. By defaultย check-latestย is set toย false. For PyPy it will to try to reach https://downloads.python.org/pypy/versions.json

    Example of usage:

    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.9'
          check-latest: true
      - run: python --version
    

    Besides, it includes such changes as

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • I'm getting Twitch API Error code: 5023

    I'm getting Twitch API Error code: 5023

    Describe the bug Currently on Ubuntu 20.04 LTS, Python 3.8.10 I'm getting Twitch API Error code: 5023. Message shows 'Please update your app to continue' and 'client is not supported for this feature'

    image

    Desktop (please complete the following information):

    • OS: Ubuntu Server 20.04
    • Python version: 3.8.10

    Additional context Does anyone have this same issue?

    bug 
    opened by ssoaora 1
  • Could not build wheels for lz4

    Could not build wheels for lz4

    Hello. In the coming days, on November 27, I had a problem in this python scripting application. Two days ago I reset my Windows 10 due to crashes that won't be fixed anyway and didn't get any solution online. So my problem is that when you go into cmd?:/users /.../downloads/Twitch-Profile-Points-Miner-v2-master (folder) and enter ">pip install -r requirements.txt " its starts loading the libraries needed for this program, then in lib browser_cookie3 stops the operation with errors, probably 2-3, and I can't do anything do to fix it. I'm just wasting my time trying to figure out what to do, so this is a demonstration of my problem. image

    bug 
    opened by georugiy 3
Owner
Alessandro Maggio
Tkd-Alexยฉ UNICT DMI Student
Alessandro Maggio
Get informed when your DeFI Earn CRO Validator is jailed or changes the commission rate.

CRO-DeFi-Warner Intro CRO-DeFi-Warner can be used to notify you when a validator changes the commission rate or gets jailed. It can also notify you wh

null 5 May 16, 2022
A Script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag.

Channel Auto Message Forward A script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag

null 16 Oct 21, 2022
A Script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag.

Channel Auto Message Post A script to automate fowarding all new messages from one/many channel(s) to another channel(s), without the forwarded tag. C

null 16 Oct 21, 2022
๐Ÿ“ข Video Chat Stream Telegram Bot. Can โณ Stream Live Videos, Radios, YouTube Videos & Telegram Video Files On Your Video Chat Of Channels & Groups !

Telegram Video Chat Bot (Beta) ?? Video Chat Stream Telegram Bot ?? Can Stream Live Videos, Radios, YouTube Videos & Telegram Video Files On Your Vide

brutโœ˜โถโน // ใƒฆใ‚นใƒ• 15 Dec 24, 2022
The purpose of this bot is to take soundcloud track requests, that are posted in the stream-requests channel, and add them to a playlist, to make the process of scrolling through the requests easier for Root

Discord Song Collector Dont know if anyone is actually going to read this, but the purpose of this bot is to check every message in the stream-request

null 2 Mar 1, 2022
It connects to Telegram's API. It generates JSON files containing channel's data, including channel's information and posts.

It connects to Telegram's API. It generates JSON files containing channel's data, including channel's information and posts. You can search for a specific channel, or a set of channels provided in a text file (one channel per line.)

Esteban Ponce de Leon 75 Jan 2, 2023
Send notification to your telegram group/channel/private whenever a new video is uploaded on a youtube channel!

YouTube Feeds Bot. Send notification to your telegram group/channel/private whenever a new video is uploaded on a youtube channel! Variables BOT_TOKEN

Aditya 30 Dec 7, 2022
Python bot for send videos of a Youtube channel to a telegram group , channel or chat

py_youtube_to_telegram Usage: If you want to install ytt and use it, run this command: sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/nima

Nima Fanniasl 8 Nov 22, 2022
A Bot Telegram Anti Users Channel to automatic ban users who using channel to send message in group.

Tg_Anti_UsersChannel A Bot Telegram Anti Users Channel to automatic ban users who using channel to send message in group. Features: Automatic ban Whit

idzeroid 6 Dec 26, 2021
a simple floating window for watch cryptocurrency price

floating-monitor with cryptocurrency ๆตฎๅ‹•่ฆ–็ช—่™›ๆ“ฌ่ฒจๅนฃๅƒนๆ ผ็›ฃๆŽง a floating monitor window to show price of cryptocurrency. use binance api to get price ๅŠ้€ๆ˜Ž็š„ๆตฎๅ‹•่ฆ–็ช—่ฎ“ไฝ ๆ–นไพฟ

Lin_Yi_Shen 1 Oct 22, 2021
If you are in allot of groups or channel and you would like to leave them at once use this

Telegram-auto-leave-groups If you are in allot of groups or channel and you would like to leave them at once use this USER GUIDE ?? Insert your telegr

Julius Njoroge 4 Jan 3, 2023
A simple script & container to pull COVID data from covidlive.com.au and post a summary to a slack channel

CovidLive AU Summary Slackbot This bot is a very simple slackbot that pulls data, summarises and posts up to date AU COVID stats to a provided slack c

James 3 Dec 18, 2021
null 4 Oct 28, 2021
A repo-watcher to watch for commits on a repo an trigger GitHub action by sending a `repository_dispatch` event to destinantion repo

repo-watcher-dispatch-sender This app is used to send a repository_dispatch event to the destination repo set in config.py or Environmental Variables

Divide Projectsโ„ข 2 Feb 6, 2022
RichWatch is wrapper around AWS Cloud Watch to display beautiful logs with help of Python library Rich.

RichWatch is TUI (Textual User Interface) for AWS Cloud Watch. It formats and pretty prints Cloud Watch's logs so they are much more readable. Because

null 21 Jul 25, 2022
Unencrypted Story View Botter is a helpful tool that allows thousands of people to watch your posts.

Unencrypted Story View Botter is a helpful tool that allows thousands of people to watch your posts.

null 8 Aug 5, 2022
A custom Discord Rich Presence to display when you're studying so you're stupid friends won't disturb you when you're studying.

Studying RPC Description A custom Discord Rich Presence to display when you're studying so you're stupid friends won't disturb you when you're studyin

John Edmerson Pizarra 4 Nov 19, 2022
This bot will pull a stream of tweets based on rules you set and automatically reply to them.

Twitter reply bot This bot will pull a stream of tweets based on rules you set and automatically reply to them. I built this bot in order to help comb

Brains 1 Feb 13, 2022
A Phyton script working for stream twits from twitter by tweepy to mongoDB

twitter-to-mongo A python script that uses the Tweepy library to pull Tweets with specific keywords from Twitter's Streaming API, and then stores the

null 3 Feb 3, 2022