GithubHelp home page GithubHelp logo

tkd-alex / twitch-channel-points-miner-v2 Goto Github PK

View Code? Open in Web Editor NEW
1.2K 32.0 633.0 1.91 MB

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

License: GNU General Public License v3.0

Python 90.30% HTML 4.32% CSS 0.79% Dockerfile 0.51% JavaScript 4.08%
script streaming bot channel-points miner python twitch

twitch-channel-points-miner-v2's Introduction

Twitch Channel Points Miner - v2

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

⚠️ This project is not mainted anymore, please use the updated repo at https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2


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

📢 Help wanted

Currently, we have a lot of PRs requests opened, but the time to test and improve It's less and less. If you want to help the community and the project, please test the following PRs and give us feedback:

README Contents

  1. 🤝 Community
  2. 🚀 Main differences from the original repository
  3. 🧾 Logs feature
  4. 🧐 How to use
  5. 🔧 Settings
  6. 📈 Analytics
  7. 🍪 Migrating from an old repository (the original one)
  8. 🪟 Windows
  9. 📱 Termux
  10. ⚠️ Disclaimer

Community

If you have any type of issue, need help, or want to suggest a new feature, please open a GitHub Issue. Don't reach me on Instagram, Telegram, Discord, Twitter (but you can follow me 😆), or somewhere else. If you don't have an account on this platform, you can create it. It's free. I do not want to be rude, but if you have a problem, maybe another user can also have the same problem, and your issue can help the community. Same for the new feature, your idea can help other users, and It's beautiful to discuss between us.

If you want to help with this project, please leave a star 🌟 and share it with your friends! 😎

If you want to offer me a coffee, I would be grateful ❤️

Buy Me A Coffee

Donate BTC 36GSMYngiiXYqBMnNwYwZc8n6s67LGn4V5
Donate ETH 0x3cc331b8AB0634CCcfa3bd57E0C625F7E886cAfa
Donate SOL pg8Z2VqMVskSEA77g5QqppaQjehGGCWJfVPw9n91AX1

If you have any issues or you want to contribute, you are welcome! But please before read the CONTRIBUTING.md file.

Main differences from the original repository:

  • Improve the logging - Emoji, colors, file and soo on
  • Final report with all the data
  • Rewrite the entire code using classe instead of module with global variables
  • Automatic download the follower's list and use it 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 a prediction and win or lose (🍀) your channel points! No browser needed. #41 (@lay295)
  • Analytics chart that show the progress of your points with various annotations #96
  • Join IRC Chat for increase watch-time and get StreamElements points #47

Logs feature

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 - 💰  CLAIM(11 times, 550 gained), PREDICTION(1 times, 6531 gained), WATCH(35 times, 350 gained)
%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 - 💰  CLAIM(4 times, 240 gained), REFUND(1 times, 605 gained), WATCH(11 times, 132 gained)
%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 - 💰  CLAIM(17 times, 850 gained), WATCH(53 times, 530 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 - 💰  CLAIM(14 times, 700 gained), WATCH(42 times, 420 gained), WATCH_STREAK(1 times, 450 gained)

How to use:

First of all please create a run.py file. You can just copy example.py and modify it according to your needs.

# -*- 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.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="your-twitch-username",
    password="write-your-secure-psw",           # If no password will be provided, the script will ask interactively
    claim_drops_startup=False,                  # If you want to auto claim all drops from Twitch inventory on the startup
    priority=[                                  # Custom priority in this case for example:
        Priority.STREAK,                        # - We want first of all to catch all watch streak from all streamers
        Priority.DROPS,                         # - When we don't have anymore watch streak to catch, wait until all drops are collected over the streamers
        Priority.ORDER                          # - When we have all of the drops claimed and no watch-streak available, use the order priority (POINTS_ASCENDING, POINTS_DESCEDING)
    ],
    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
        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 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="GREEN",            # Don't worry about lower/upper case. The script will parse all the values.
            streamer_offline="red",             # Read more in README.md
            BET_wiN=Fore.MAGENTA                # Color allowed are: [BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET].
        ),
        telegram=Telegram(                                                          # You can omit or leave None if you don't want to receive updates on Telegram
            chat_id=123456789,                                                      # Chat ID to send messages @GiveChatId
            token="123456789:shfuihreuifheuifhiu34578347",                          # Telegram API token @BotFather
            events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, "BET_LOSE"],   # Only these events will be sent to the chat
            disable_notification=True,                                              # Revoke the notification (sound/vibration)
        ),
        discord=Discord(
            webhook_api="https://discord.com/api/webhooks/0123456789/0a1B2c3D4e5F6g7H8i9J",  # Discord Webhook URL
            events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, Events.BET_LOSE],       # Only these events will be sent to the chat
        )
    ),
    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 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.LTE,            # 'by' must be [GT, LT, GTE, LTE] than value
                value=800
            )
        )
    )
)

# 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.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
    followers_order=FollowersOrder.ASC  # Sort the followers list by follow date. ASC or DESC
)

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

from TwitchChannelPointsMiner import TwitchChannelPointsMiner
from TwitchChannelPointsMiner.classes.Settings import FollowersOrder
twitch_miner = TwitchChannelPointsMiner("your-twitch-username")
twitch_miner.mine(["streamer1", "streamer2"])                                                       # Array of streamers OR
twitch_miner.mine(followers=True, followers_order=FollowersOrder.ASC)                               # Automatic use the followers list OR
twitch_miner.mine(["streamer1", "streamer2"], followers=True, followers_order=FollowersOrder.DESC)  # Mixed

If you follow so many streamers on Twitch, but you don't want to mine points for all of them, you can blacklist the users with the blacklist keyword. #94

from TwitchChannelPointsMiner import TwitchChannelPointsMiner
twitch_miner = TwitchChannelPointsMiner("your-twitch-username")
twitch_miner.mine(followers=True, blacklist=["user1", "user2"])  # Blacklist example

By cloning the repository

  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 . If you have problems with requirements, make sure to have at least Python3.6. You could also try to create a virtualenv and then install all the requirements
pip install virtualenv
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt

Start mining! python run.py 🥳

pip

Install the package via pip, you will find a stable version - maybe a different version from the master branch.

  • pip install Twitch-Channel-Points-Miner-v2
  • Exceute the run.py file python run.py 🥳

Docker

The following file is mounted :

  • run.py : this is your starter script with your configuration

These folders are mounted :

  • analytics : to save the analytics data
  • cookies : to provide login information
  • logs : to keep logs outside of container

Example using docker-compose:

version: "3.9"

services:
  miner:
    image: tkdalex/twitch-channel-points-miner-v2
    stdin_open: true
    tty: true
    environment:
      - TERM=xterm-256color
    volumes:
      - ./analytics:/usr/src/app/analytics
      - ./cookies:/usr/src/app/cookies
      - ./logs:/usr/src/app/logs
      - ./run.py:/usr/src/app/run.py:ro
    ports:
      - "5000:5000"

Example with docker run:

docker run \
    -v $(pwd)/analytics:/usr/src/app/analytics \
    -v $(pwd)/cookies:/usr/src/app/cookies \
    -v $(pwd)/logs:/usr/src/app/logs \
    -v $(pwd)/run.py:/usr/src/app/run.py:ro \
    -p 5000:5000 \
    tkdalex/twitch-channel-points-miner-v2

$(pwd) Could not work on Windows (cmd), please use the absolute path instead, like: /path/of/your/cookies:/usr/src/app/cookies. If you don't mount the volume for the analytics (or cookies or logs) folder, the folder will be automatically created on the Docker container, and you will lose all the data when it is stopped. If you don't have a cookie or It's your first time running the script, you will need to login to Twitch and start the container with -it args. If you need to run multiple containers you can bind different ports (only if you need also the analytics) and mount dirrent run.py file, like

docker run --name user1-v $(pwd)/user1.py:/usr/src/app/run.py:ro -p 5001:5000 tkdalex/twitch-channel-points-miner-v2
docker run --name user2-v $(pwd)/user2.py:/usr/src/app/run.py:ro -p 5002:5000 tkdalex/twitch-channel-points-miner-v2

About the Docker version; the community has always shown great interest in the Docker version of the project. Especially @SethFalco (#79), @KamushekDev (#300), @au-ee (#223) they showed their ideas. I've decided to merge the PR from @RakSrinaNa (#343) because is one of the most active user of the project and the PR was the only one with a Continuous Integration (CI).

Limits

Twitch has a limit - you can't watch more than two 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 you can choose to download the followers sorted by follow date (ASC or DESC).

Settings

Most of the settings are self-explained and are commented on in the example. You can watch only two streamers per time. With priority settings, you can select which streamers watch by use priority. You can use an array of priority or single item. I suggest using at least one priority from ORDER, POINTS_ASCENDING, POINTS_DESCEDING because, for example, If you set only STREAK after catch all watch streak, the script will stop to watch streamers. Available values are the following:

  • STREAK - Catch the watch streak from all streamers
  • DROPS - Claim all drops from streamers with drops tags enabled
  • SUBSCRIBED - Prioritize streamers you're subscribed to (higher subscription tiers are mined first)
  • ORDER - Following the order of the list
  • POINTS_ASCENDING - On top the streamers with the lowest points
  • POINTS_DESCEDING - On top the streamers with the highest points

You can combine all priority but keep in mind that use ORDER and POINTS_ASCENDING in the same settings doesn't make sense.

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 printing emoji. Set to false if you have a problem
colored bool True If you want to print colored text #45 #82
auto_clear bool True Create a file rotation handler with interval = 1D and backupCount = 7 #215
color_palette ColorPalette All messages are Fore.RESET except WIN and LOSE bet (GREEN and RED) Create your custom color palette. Read more above.
telegram Telegram None (Optional) Receive Telegram updates for multiple events list #233
discord Discord None (Optional) Receive Discord updates for multiple events list #320

Color Palette

Now you can customize the color of the terminal message. We have created a default ColorPalette that provide all the message with DEFAULT (RESET) color and the BET_WIN and BET_LOSE message GREEN and RED respectively. You can change the colors of all Events enum class. The colors allowed are all the Fore color from Colorama: BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, RESET. The script was developed to handle all the human error, lower-case upper case and more, but I want to suggest using the following code-style

from colorama import Fore
ColorPalette(
    STREAMER_ONLINE = Fore.GREEN,
    STREAMER_OFFLINE = Fore.RED,
    GAIN_FOR_RAID = Fore.YELLOW,
    GAIN_FOR_CLAIM = Fore.YELLOW,
    GAIN_FOR_WATCH = Fore.YELLOW,
    GAIN_FOR_WATCH_STREAK = Fore.YELLOW,
    BET_WIN = Fore.GREEN,
    BET_LOSE = Fore.RED,
    BET_REFUND = Fore.RESET,
    BET_FILTERS = Fore.MAGENTA,
    BET_GENERAL = Fore.BLUE,
    BET_FAILED = Fore.RED,
)

Telegram

If you want to receive logs update on Telegram initiate a new Telegram class, else leave omit this parameter or set as None.

  1. Create a bot with BotFather
  2. Get you chat_id with GiveChatId
Key Type Default Description
chat_id int Chat ID to send messages @GiveChatId
token string Telegram API token @BotFather
events list Only these events will be sent to the chat. Array of Event. or str
disable_notification bool false Revoke the notification (sound/vibration)
Telegram(
    chat_id=123456789,
    token="123456789:shfuihreuifheuifhiu34578347",
    events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, "BET_LOSE"],
    disable_notification=True,
)

Discord

If you want to receive log updates on Discord initialize a new Discord class, else leave omit this parameter or set it as None YT Video

  1. Go to the Server you want to receive updates
  2. Click "Edit Channel"
  3. Click "Integrations"
  4. Click "Webhooks"
  5. Click "New Webhook"
  6. Name it if you want
  7. Click on "Copy Webhook URL"
Key Type Default Description
webhook_api string Discord webhook URL
events list Only these events will be sent to the chat. Array of Event. or str
Discord(
   webhook_api="https://discord.com/api/webhooks/0123456789/0a1B2c3D4e5F6g7H8i9J",
   events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, Events.BET_LOSE],
)

Events

  • STREAMER_ONLINE
  • STREAMER_OFFLINE
  • GAIN_FOR_RAID
  • GAIN_FOR_CLAIM
  • GAIN_FOR_WATCH
  • BET_WIN
  • BET_LOSE
  • BET_REFUND
  • BET_FILTERS
  • BET_GENERAL
  • BET_FAILED
  • BET_START
  • BONUS_CLAIM
  • JOIN_RAID
  • DROP_CLAIM
  • DROP_STATUS

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 value is True, the script will increase the watch-time for the current game. With this, you can claim the drops from Twitch Inventory #21
watch_streak bool True Choose if you want to change a priority for these streamers and try to catch the Watch Streak event #11
bet BetSettings Rules to follow for the bet
chat ChatPresence ONLINE Join IRC-Chat to appear online in chat and attempt to get StreamElements channel points and increase view-time #47

Allowed values for chat are:

  • ALWAYS Join in IRC chat and never leave
  • NEVER Never join IRC chat
  • ONLINE Partecipate to IRC chat if the streamer is online (leave if offline)
  • OFFLINE Partecipate to IRC chat if the streamer is offline (leave if online)

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
delay_mode DelayMode FROM_END Define how is calculating the waiting time before placing a bet
delay float 6 Value to be used to calculate bet delay depending on delay_mode value

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 as select LOWEST_ODDS
  • SMART_MONEY: Select the option with the highest points placed. #331
  • SMART: If the majority in percent chose an option, then follow the other users, otherwise select 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 percentages are: 'over 7.5': 70% and 'under 7.5': 30%. If the difference between the two percentages is higher than 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 is 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 to 1.3 FilterCondition(by=OutcomeKeys.ODDS, where=Condition.GTE, value=1.3)
  • If you want to place the bet ONLY if the highest bet is lower than 2000 FilterCondition(by=OutcomeKeys.TOP_POINTS, where=Condition.LT, value=2000)

DelayMode

  • FROM_START: Will wait delay seconds from when the bet was opened
  • FROM_END: Will until there is delay seconds left to place the bet
  • PERCENTAGE: Will place the bet when delay percent of the set timer is elapsed

Here's a concrete example. Let's suppose we have a bet that is opened with a timer of 10 minutes:

  • FROM_START with delay=20: The bet will be placed 20s after the bet is opened
  • FROM_END with delay=20: The bet will be placed 20s before the end of the bet (so 9mins 40s after the bet is opened)
  • PERCENTAGE with delay=0.2: The bet will be placed when the timer went down by 20% (so 2mins after the bet is opened)

Analytics

We have recently introduced a little frontend where you can show with a chart you points trend. The script will spawn a Flask web-server on your machine where you can select binding address and port. The chart provides some annotation to handle the prediction and watch strike events. Usually annotation are used to notice big increase / decrease of points. If you want to can disable annotations. On each (x, y) points Its present a tooltip that show points, date time and reason of points gained / lost. This web page was just a funny idea, and it is not intended to use for a professional usage. If you want you can toggle the dark theme with the dedicated checkbox.

Light theme Dark theme
Light theme Dark theme

For use this feature just call the analytics method before start mining. Read more at: #96 The chart will be autofreshed each refresh minutes. If you want to connect from one to second machine that have that webpanel you have to use 0.0.0.0 instead of 127.0.0.1. With the days_ago arg you can select how many days you want to show by default in your analytics graph.

from TwitchChannelPointsMiner import TwitchChannelPointsMiner
twitch_miner = TwitchChannelPointsMiner("your-twitch-username")
twitch_miner.analytics(host="127.0.0.1", port=5000, refresh=5, days_ago=7)   # Analytics web-server
twitch_miner.mine(followers=True, blacklist=["user1", "user2"])

Migrating from an old repository (the original one):

If you already have a twitch-cookies.pkl and you don't want to log in 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 useful info can be founded here:

You can also follow this video tutorial.

Termux

Install the requirements

pkg install python git rust libjpeg-turbo libcrypt ndk-sysroot clang zlib`
LDFLAGS="-L${PREFIX}/lib/" CFLAGS="-I${PREFIX}/include/" pip install --upgrade wheel pillow

(1 way): Clone this repository git clone https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2

(2 way): Download sources from GitHub and put it into your Termux storage

Now you can enter the directory with our miner, type this command: cd Twitch-Channel-Points-Miner-v2

Configure your miner on your preferences by typing nano example.py

When you have configured it now we can rename it (optional): mv example.py run.py

We have to also install dependences required to run miner: pip install -r requirements.txt

(3 way): pip install Twitch-Channel-Points-Miner-v2

Now when we did everything we can run miner: python run.py

Read more at #92 #76

Disclaimer

This project comes with no guarantee 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.

twitch-channel-points-miner-v2's People

Contributors

1v avatar aaronwrice1 avatar anoviel avatar bpnordin avatar caterpyowo avatar colinshark avatar dennis-mulder avatar dependabot[bot] avatar dmunozv04 avatar egrorbs avatar element21 avatar eoleedi avatar gottagofaster236 avatar jonny-gm avatar kapdap avatar nashwik avatar njallam avatar prograstinator avatar prototypeactual avatar rakambda avatar raymondcc2tm avatar signko avatar tipicodev avatar tkd-alex avatar vil-s avatar zacholade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twitch-channel-points-miner-v2's Issues

better 'Watch Streak' strategy in priority system

I opened this suggestion in the original project, but didn't get a single comment.. so... here it goes...

Since a Watch Streak gives 450 points by viewing only (five?) minutes of a stream, I would modify the priority system to 'forget' priorities for a minute and switch to the newest live stream until collects the 450 points, then resume normally watching the top priority live stream.
I think it makes sense giving up just 10 points (5 minutes) of a top streamer in order to grab the 450 points of my 3rd or 4th ranked live stream.

I don't know much about coding... but there should be a variable that remembers if I recently got the 450 from that streamer.. if so, there will be no 'switch' to that new stream (maybe it's a streamer with bad connection or connects many times a day).. Also, if we switch to grab the 450... and after 5... 6 minutes nothing happens.... abort and go back to watch the highest priority. Sometimes that 450 bonus fails to be awarded for some reason..

thanks for reading !

AttributeError: 'FilterCondition' object has no attribute 'key'

Script didn't stop, but didn't complete successfully - which would have been correct given the condition.

07/02 14:12:32 - Place bet for EventPrediction: nimbleneuron (1.33k points) - Devil Fox TOP 2 IN OR TOP 2 OUT? owned by nimbleneuron (1.33k points)
07/02 14:12:32 - Filter applied on this bet. Current total_users is 1863, must be LTE 10
07/02 14:12:32 - Skip betting for the event EventPrediction: nimbleneuron (1.33k points) - Devil Fox TOP 2 IN OR TOP 2 OUT?
Exception in thread Thread-6:
Traceback (most recent call last):
  File "<removed>\Python39\lib\threading.py", line 950, in _bootstrap_inner
    self.run()
  File "<removed>\Python39\lib\threading.py", line 1262, in run
    self.function(*self.args, **self.kwargs)
  File "<removed>\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\TwitchBrowser.py", line 317, in place_bet
    logger.info(f"Skip settings {event.bet.settings.filter_condition}")
  File "<removed>\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\entities\Bet.py", line 49, in __repr__
    return f"FilterCondition(By={self.key}, Where={self.condition}, Value={self.value})"
AttributeError: 'FilterCondition' object has no attribute 'key'
07/02 14:13:10 - +10 --> brbteabreak (17.14k points) - Reason: WATCH.

Fillable box not available

Printing an error with; Fillable box not available

I set show browser to true, to see what it is doing. It is opening the bet menu correctly and does click the custom amount button and you can fill in a custom amount. But it does throw the error.

Include filter settings with closing BetSettings report

Current example...
BetSettings(Strategy=SMART, Percentage=5, PercentageGap=20, MaxPoints=50000, StealthMode=True)

Would be nice etc...
BetSettings(Strategy=SMART, Percentage=5, PercentageGap=20, MaxPoints=50000, StealthMode=True, Filter=(type,value)

prediction errors if viewer is a channel 'mod'

basically, predictions aren't enabled for channel moderators. so the script currently tries to cast prediction anyways and breaks in errors.
there should be a simple way to check if we're a 'mod' on that channel and avoid predictions.

;o)

Predictions: 'Stealth Mode' betting

Would be nice to have:

An option to bet 1 point less than the current highest bet. I'll explain:

The prediction box, shows the username of the highest bet from OptionA and OptionB. So, in a small channel, where sometimes everyone knows each other.. If we show up as the highest bet all the time... and don't even talk.. we would raise suspicion. Plus, since we don't show up in the user-list.. they would freak out even more..!

So my suggestion is.. that at the moment we're about to place our bet to Option2 for example.... check the amount of the highest bet from Option2 and place the bet just 1 point less of it.. and continue to be 'hidden' from chat.

Of course, that value will continue to obey and be within: bet_settings=BetSettings(percentage=5,max_points=50000)
if it's an option in run.py .. .we could call it stealth_mode=True

;o)

Originally posted by @testdev123456 in #29 (comment)

Better PREDICTION sum in report

It would be cool if the PREDICTION report can be a bit more "accurate". By that I mean that the current amount it returns is the sum of the predictions we won, but it doesn't take into account the amount we placed.

For example:

31/01 09:57:06 - 🤖  Streamer(...), Total Points Gained (after farming - before farming): 3219  
31/01 09:57:06 - 💰  WATCH(121 times, 1.210 gained), CLAIM(41 times, 2.050 gained), WATCH_STREAK(1 times, 350 gained), PREDICTION(10 times, 6.823 gained), REFUND(3 times, 1.516 gained)

I'd expect that the total points gained is the sum of the different things below (WATCH + CLAIM + WATCH_STREAM + PREDICTION + REFUND). Though it isn't the case and the predictions probably made me lose points. From my point of view it'd more logical if the prediction showed something like PREDICTION(10 times, -2.000 gained) (I put a random value just for the example).

Personally I see 2 ways it could be improved:

  • Make it so that prediction is the sum of the results (a win is positive, a loss is 0) and substract the amount placed.
    This would be the one that sums up nicely the end result. If a sum is negative then we know we actually lost points in predictions.
    There would be an edge case though when a prediction is cancelled. We'd get -X points in the PREDICTION and +X points in the REFUND. But personally I think it's still better than seeing just the +X in the REFUND.
  • Split the PREDICTION into several components, like PREDICTION_PLACED, PREDICTION_WON, REFUND. This could be a bit long to read though and would confuse a bit more people I think.

I personally think a solution like the first one is easier to understand especially that we have the prediction summary above if we want more details on what happened.

'Follow'ing updates

Currently if followers=True then your follows are loaded at start-up only.

A custom (run.py setting) hourly value allowing periodically checking would be helpful.
So you can make changes to followers without restarting the script, if remotely located for example.

Syntax Error - "Username = str"

Hi there,

I am probably doing something really stupid, but I keep getting a syntax error as shown in screenshot.

Any help would be great,

Thanks,
Screenshot 2021-02-05 at 17 22 37

Dedicated settings for each streamer

Hi Guys 😸

What do you think to create a dedicated setting for each streamer?
Something like

miner.run([
    Streamer("username1", predictions=True,  raid=True,  drops=True,  watch_streak=True,  bet_settings=BetSettings(strategy=Strategy.SMART,      percentage=2,  percentage_gap=20, max_points=50000 )),
    Streamer("username2", predictions=False, raid=True,  drops=True,  watch_streak=True,  bet_settings=BetSettings(strategy=Strategy.PERCENTAGE, percentage=1,  percentage_gap=20, max_points=500   )),
    Streamer("username3", predictions=True,  raid=False, drops=True,  watch_streak=True,  bet_settings=BetSettings(strategy=Strategy.ODS,        percentage=22, percentage_gap=20, max_points=700   )),
    Streamer("username4", predictions=True,  raid=True,  drops=False, watch_streak=False, bet_settings=BetSettings(strategy=Strategy.SMART,      percentage=5,  percentage_gap=20, max_points=213   ))
])

What do you think about this? Please share your opinion. If for the community It's a good idea I can work also on this or if someone wants to make a PR ❤️

Messages file

I would like to see an file with all messages so we can customize them.

Log title

Currently the log filename is xxxxx.ddmmyyyy-hhmmss.log. I find it personally hard to navigate through several files named like that is it is first sorted by day, then month, then year, ...

I'd find it better if it was named xxxxx.yyyymmdd-hhmmss.log. Like that sorting by filename will also sort by date which is quite easier to navigate through when tabbing in a shell.

Error with example settings

If the example per streamer settings are used they produce an error as Strategy has no method ODDS "Strategy.ODDS"
Line 53 example.py

Queued betting

Currently you can not bet on a second bet until the initial closes/completes.

Is it possible to put all betting opportunities into a holding list.
Stay focused on one bet until the bet is made ~90 seconds (then hand it off for another process to deal with completion).
Take the next oldest betting opportunity from the holding list and check if it's newer than 90seconds (current bet wait time)
If newer than 90s then wait for prediction time to pass to 90s and place bet, else drop bet as missed.
(repeat until list empty)

This would mean splitting the information collection of finished bets to a separate check/thread (if it isn't already)
No interaction is required this is for user feedback report only.

Limit betting by participation

Would like to see an option to limit betting on votes with a small amount of participants.

So we could choose not to bet on votes involving less than 20 people for example.

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.

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).

Drop collection on start-up not working

Started collecting a timed viewing drop tonight (no script was watching manual) without noticing they activated again.
When I started the script to see if it would collect the reward, it didn't.

Not sure what helpful info to include for this one as nothing happened. https://prnt.sc/xxrhqx

Lost [PONG] causing INFO output to hang

INFO output stopped for ~20 minutes, Drops were still been collected (checked twitch), subsequent log shows channel points were still being collected.
I pressed CTRL+C (at 02/02/21 15:38:10) to close the script and the log screen suddenly updated with log from (02/02/21 15:24:41) the last ~20 minutes of information.

Could it be the CTRL-C killed the process waiting for a lost PONG that was holding everything else up?

02/02/21 15:08:31 - INFO - [on_message]: +10 --> Streamer(username=brbteabreak, channel_id=36023487, channel_points=13.14k) - Reason: WATCH.
02/02/21 15:24:41 - INFO - [run]: The last pong was received more than 15 minutes ago. Reconnect the WebSocket
02/02/21 15:38:10 - INFO - [handle_websocket_reconnection]: Reconnecting to Twitch PubSub server in 60 seconds
02/02/21 15:38:11 - INFO - [on_message]: +10 --> Streamer(username=defnotoran, channel_id=245185578, channel_points=5k) - Reason: WATCH.
02/02/21 15:38:11 - INFO - [claim_bonus]: Claiming the bonus for Streamer(username=defnotoran, channel_id=245185578, channel_points=5k)!
02/02/21 15:38:11 - INFO - [on_message]: +10 --> Streamer(username=brbteabreak, channel_id=36023487, channel_points=13.15k) - Reason: WATCH.
02/02/21 15:38:11 - INFO - [on_message]: +10 --> Streamer(username=defnotoran, channel_id=245185578, channel_points=5.01k) - Reason: WATCH.
02/02/21 15:38:11 - INFO - [on_message]: Drop event 25% for Streamer(username=brbteabreak, channel_id=36023487, channel_points=13.15k)!
02/02/21 15:38:11 - INFO - [on_message]: +10 --> Streamer(username=brbteabreak, channel_id=36023487, channel_points=13.16k) - Reason: WATCH.
02/02/21 15:38:11 - INFO - [claim_bonus]: Claiming the bonus for Streamer(username=brbteabreak, channel_id=36023487, channel_points=13.16k)!
02/02/21 15:38:11 - INFO - [on_message]: +10 --> Streamer(username=defnotoran, channel_id=245185578, channel_points=5.02k) - Reason: WATCH.
02/02/21 15:38:11 - INFO - [on_message]: +10 --> Streamer(username=brbteabreak, channel_id=36023487, channel_points=13.17k) - Reason: WATCH.
02/02/21 15:38:11 - INFO - [on_message]: +10 --> Streamer(username=defnotoran, channel_id=245185578, channel_points=5.03k) - Reason: WATCH.
02/02/21 15:38:11 - INFO - [on_message]: +10 --> Streamer(username=brbteabreak, channel_id=36023487, channel_points=13.18k) - Reason: WATCH.
02/02/21 15:38:11 - INFO - [on_message]: +10 --> Streamer(username=defnotoran, channel_id=245185578, channel_points=5.04k) - Reason: WATCH.
02/02/21 15:38:11 - INFO - [on_message]: Drop event 50% for Streamer(username=brbteabreak, channel_id=36023487, channel_points=13.18k)!

Exception raised with: button[data-a-target="consent-banner-accept"]

20/01/21 15:15:22 - ERROR - [__click_when_exist]: Exception raised with: button[data-a-target="consent-banner-accept"]
Traceback (most recent call last):
File "/home/vadrozh/Twitch/TwitchChannelPointsMiner/classes/TwitchBrowser.py", line 284, in __click_when_exist
expected_conditions.element_to_be_clickable((by, selector))
File "/home/vadrozh/.local/lib/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:

OutcomeKeys.DECISION_USERS not as expected

OutcomeKeys.DECISION_USERS should equal the amount of people participating in a vote?
Currently running with GT 10 filter and script voted on a bet with 7 users participating.

            filter_condition=FilterCondition(
                by=OutcomeKeys.DECISION_USERS,    # Where apply the filter. Allowed [PERCENTAGE_USERS, ODDS_PERCENTAGE, ODDS, TOP_POINTS, TOTAL_USERS, TOTAL_POINTS]
                where=Condition.GT,           # The key must be [GT, LT, GTE, LTE] than value
                value=10
            )

My default setting, applied to followers=True

There appears to be no debug output re filter settings passing or failing

Typo when Ctrl+C

On Ctrl+C...
INFO - [end]: CTRL+C Detected! Please wait just a moment!s

Not all websockets are checked if alive

Describe the bug

I may have had a problem similar to #39 but not sure. Was running it in debug without any breakpoints, and at some point checked what happened and saw no logs for around an hour. Played a bit with the debugger to see where it was hanging and then the logs all reappeared (compared to .

Though were I managed to pause it, there may be a problem. It was there:

It may not be the same issue but I think that if you subscribe to more than 50 topics (and so have more than one connection), this part of the code only checks if the last opened connection is alive.

Here the ws is rewritten at each opened connection:

Same probably happens here (and everywhere that pool.ws is used), the end method will only close the last opened socket:

def end(self):
self.ws.keep_running = False
self.ws.close()

To Reproduce
Steps to reproduce the behavior:

  1. Probably run the script with enough users that it creates at least 2 connections ?

Expected behavior
Handling an array of opened ws would probably be better.

  • End method could iterate through them and close them all
  • When subscribing to topics we could iterate through them, subscribe to topics if there some space left in them (topics < 50), or add a new one to the array if needed and subscribe
  • When we check pings, iterate through all ws and check all pings

If multiple connection isn't a good idea, maybe limiting the number of users that can be added in the config could be another idea.

Desktop (please complete the following information):

  • OS: Windows
  • Browser /
  • Python version 3.9

2FA enabled login not fully working

When running initial setup with a 2FA enabled account, the twitch login backup code is unable to read required "persistent" field information to bypass robot protection from host browser cookies.

Tested with Chrome and Firefox latest builds, Win10, Python 3.9

Tested if other cookie fields were available for output but appears no information is been read from host browser twitch cookie. Will do further testing and post traceback output shortly.

MakePrediction transactionID

I was bored and wanted to make my own predictions bot without selenium, and I ran into the same problem with the transactionID.

I finished a prototype, and found that just generating a random 32 length hex string as the transactionID works, and lets the bet go through. Thought you might find this useful and would be cool if the program could be updated to not use selenium.

terminal log - minor fixes & improvements

  • if emoji=False there's still a \u2192 ( → ) print on most lines. that should be gone.
  • the entire line print of "claiming the bonus for..." is redundant and unnecessary. we already see the +50 claim line.
  • the " Streamer: " is also redundant as well, as they're all streamers.
  • prediction lines should mention streamer's name, or at least on the first line "Start betting for.."
  • I think total channel_points is important to add. it doesn't take much space.
    like: time - +50 - username - total - reason

;o)

Command line colors for easy distinction

After a few days using this program, I have realized that it is not easy to distinguish some things and I thought it would be easier if some parts were colored.

For example, in the bets several messages are shown but it is not easy to read the streamer who you are betting on.

I imagine something similar to this but with colors:

Start betting for EventPrediction: Please star this repo owned by streamer-username (xxx points)
+12 → streamer-username (xxx points) - Reason: WATCH.

The bold text would be in random color, the same for the percentages in the bets.

Thanks for your work!

Discussions & PRs

This isn't an issue for the bot itself but for the repo.

I have 2 suggestions:

  • It'd be cool to enable the Discussion tab in the repo. Just like you did for the issues at the beginning, you could enable the discussions so that people that just have little questions or other discussions that are not issues can exchange about the topic.
  • Would be nice if PRs are used a bit more. Maybe even make it a workflow by always attaching a PR to an issue.
    Currently there's a lot of branches and it's a bit hard to track a bit all that's going around.
    Having PR would allow you to link the PR to the issue so the changes for an issue are somehow "logged" and can be found at a later date a bit more easily.
    Also people that reported issues could subscribe to the PR and get notifications when changes are made.
    Finally it would be easier to suggest changes. I did it a few times directly in the commits but it's not really that visible to others that could also have suggestions.

headless problem

Bug
I cannot get the software to run on an operating system without a desktop environment. I think I have configured everything correctly, any idea what it might be?

To Reproduce
In order to reproduce the behavior you just need to run the software on an operating system without a desktop enviroment with the default configuration.

Useful informations

  • OS: Ubuntu server 20.04
  • Browser: Chrome
  • Python version: 3.x

Screen Error
error github

Something went wrong unable to continue with betting - Fillable box not avaible

Getting this error on the bets currently, watching forsen.

18/01/21 21:12:06 - ERROR - [__execute_script]: Failed to execute: document.querySelector("button[data-test-selector="prediction-checkout-active-footer__input-type-toggle"]").click();
Traceback (most recent call last):
File "D:\bets\TwitchChannelPointsMiner\classes\TwitchBrowser.py", line 150, in __execute_script
self.browser.execute_script(javascript_code)
File "C:\Users\Stephan\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 634, in execute_script
return self.execute(command, {
File "C:\Users\Stephan\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Stephan\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: javascript error: missing ) after argument list
(Session info: headless chrome=87.0.4280.141)

Yes I am on the latest commit

Errors and problems with strategies

Good evening, first of all, I have to say that I have no idea about programming, just enough to make it work. I tried with all the possible strategies and always the program bet on the one that has less percentage of winning.

Also I receive this type of errors constantly:

--- Logging error --- Traceback (most recent call last): File "C:\Python\lib\logging\__init__.py", line 1084, in emit stream.write(msg + self.terminator) File "C:\Python\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f527' in position 95: character maps to <undefined> Call stack: File "C:\Python\lib\threading.py", line 890, in _bootstrap self._bootstrap_inner() File "C:\Python\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Python\lib\threading.py", line 1254, in run self.function(*self.args, **self.kwargs) File "C:\notra\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\TwitchBrowser.py", line 320, in place_bet -- Logging error --- Traceback (most recent call last): File "C:\Python\lib\logging\__init__.py", line 1084, in emit stream.write(msg + self.terminator) File "C:\Python\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f680' in position 97: character maps to <undefined> Call stack: File "C:\Python\lib\threading.py", line 890, in _bootstrap self._bootstrap_inner() File "C:\Python\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Python\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "C:\notra\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\WebSocketsPool.py", line 60, in <lambda> self.thread_ws = threading.Thread(target=lambda: self.ws.run_forever()) File "C:\Python\lib\site-packages\websocket\_app.py", line 306, in run_forever dispatcher.read(self.sock.sock, read, check) File "C:\Python\lib\site-packages\websocket\_app.py", line 66, in read if not read_callback(): File "C:\Python\lib\site-packages\websocket\_app.py", line 290, in read self._callback(self.on_message, data) File "C:\Python\lib\site-packages\websocket\_app.py", line 346, in _callback callback(self, *args) File "C:\notra\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\WebSocketsPool.py", line 147, in on_message

Thank you for the effort you are putting into this utility.

Strategy option to go with the most % voted.

Describe the solution you'd like
Strategy option to go with the most % voted.

Additional context
In most of the streams I watch/bet almost always the highest % wins and not where most people voted in.
image

Duplicate drop progress reported

Progress/check event appears to be firing/reporting twice at different times. eg. "Drop event 25%"

01/02/21 10:21:37 - INFO - [set_online]: Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.230) is Online!
01/02/21 10:24:01 - INFO - [on_message]: +10 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.240) - Reason: WATCH.
01/02/21 10:24:01 - INFO - [claim_bonus]: Claiming the bonus for Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.240)!
01/02/21 10:24:02 - INFO - [on_message]: +50 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.290) - Reason: CLAIM.
01/02/21 10:29:01 - INFO - [on_message]: +10 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.300) - Reason: WATCH.
01/02/21 10:30:51 - INFO - [claim_drop]: Claiming the drop for Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.300)!
01/02/21 10:34:03 - INFO - [on_message]: +10 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.310) - Reason: WATCH.
01/02/21 10:39:02 - INFO - [on_message]: +10 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.320) - Reason: WATCH.
01/02/21 10:39:02 - INFO - [claim_bonus]: Claiming the bonus for Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.320)!
01/02/21 10:39:02 - INFO - [on_message]: +50 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.370) - Reason: CLAIM.
01/02/21 10:44:00 - INFO - [on_message]: +10 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.380) - Reason: WATCH.
01/02/21 10:46:02 - INFO - [on_message]: Drop event 25% for Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.380)!
01/02/21 10:46:50 - INFO - [on_message]: Drop event 25% for Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.380)!
01/02/21 10:49:01 - INFO - [on_message]: +10 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.390) - Reason: WATCH.
01/02/21 10:54:02 - INFO - [on_message]: +10 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.400) - Reason: WATCH.
01/02/21 10:54:02 - INFO - [claim_bonus]: Claiming the bonus for Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.400)!
01/02/21 10:54:02 - INFO - [on_message]: +50 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.450) - Reason: CLAIM.
01/02/21 10:59:01 - INFO - [on_message]: +10 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.460) - Reason: WATCH.
01/02/21 11:01:02 - INFO - [on_message]: Drop event 50% for Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.460)!
01/02/21 11:01:51 - INFO - [on_message]: Drop event 50% for Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.460)!
01/02/21 11:04:01 - INFO - [on_message]: +10 --> Streamer(username=iheartpiegaming, channel_id=42826140, channel_points=2.470) - Reason: WATCH.

Less text in terminal

There should be an option in run.py that would simplify the displayed text in the terminal. I think I already saw something commented in some file that just said "xx channel points for yy". Why not have that for everything that can happen? So for example:

21/01/21 23:33:19 - INFO - [on_message]: +10 → Streamer(username=streamer_username, channel_id=x, channel_points=y) - Reason: WATCH.
would just be
21/01/21 23:33:19 - +10 cp for streamer_username

or

21/01/21 23:45:44 - INFO - [on_message]: +50 → Streamer(username=streamer_username, channel_id=x, channel_points=y) - Reason: CLAIM.
would just be
21/01/21 23:33:19 - +50 cp for streamer_username.

Especially bets fill up the screen really quick. So they could just be "streamer_username has started a bet called name_of_bet" and "Placing a bet for streamer_username for name_of_bet_" and at the end just "Won/Lost bet for x cp on name_of_bet of streamer_username" or whatever.

I like having it on the second monitor but I don't like that its filling up the screen if a lot of nonsense to me.

Use comma instead of period for delimeter

Twitch says I have 5.7k points (5,700), but the script says 5.700 points. I think this is why millify doesn't work. We just have to replace the period with a coma or remove the formatting that uses a period.

Extra priority for streamers with drops active

Currently if a streamer with Drops enabled is in your list but late getting loaded as 'online' drops collection will not happen.

Would like to see streams with Drops enabled receive extra priority over other online streams so they always make it to the top of the online list, Drops > Channel Points.

Outcome options missing

DECISION_USERS is not documented in the example.py but is listed on the github params page (and would be my preferred filter option)

Traceback (most recent call last):
  File "<removed>\Twitch-Channel-Points-Miner-v2\twitch.py", line 37, in <module>
    by=OutcomeKeys.DECISION_USERS,    # Where apply the filter. Allowed [PERCENTAGE_USERS, ODDS_PERCENTAGE, ODDS, TOP_POINTS, TOTAL_USERS, TOTAL_POINTS]
AttributeError: type object 'OutcomeKeys' has no attribute 'DECISION_USERS'

Prediction: bet amount with decimals error

just a simple error to fix. self-explanatory

06/02 22:19:03 - Going to write: 298.8 channel points on input B
06/02 22:19:04 - Exception raised with: (//div[@id='channel-points-reward-center-body']//div[contains(@class,'custom-prediction-button')]//input)[2]
Traceback (most recent call last):
  File "C:\Users\default\TwitchChannelPointsMiner\classes\TwitchBrowser.py", line 265, in __send_text
    ActionChains(self.browser).move_to_element(element).click().send_keys(
  File "C:\Users\default\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\action_chains.py", line 335, in send_keys
    typing = keys_to_typing(keys_to_send)
  File "C:\Users\default\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\utils.py", line 150, in keys_to_typing
    for i in range(len(val)):
TypeError: object of type 'float' has no len()

basically we should always round down the bet amount to the close integer. ( and I say 'round down' instead of 'round up' to make sure it has no conflicts with stealth_mode=True )

Available/Finished INFO messages for when drops start/end

"INFO - [claim_drop]: Claiming the drop for Streamer..."

When you see this message you know a drop has been collected, and SO the next one must have started at 0%...

If the script is running and drops become available (switch on at a time) no notification is shown that your collecting until 25%.
"INFO - Drops available from streamer X"
"INFO - Drops collecting currently at 13%"

Also if drops finish (no more available for that campaign/time) you might not know, INFO message saying "All collected" would be great.
"INFO - Drops finished/unavailable"

Idea for the betting by the script

I have an idea. For me auto betting is not cool. Can you make the script which will login in the accoun. And then we can choose the variant RED/BLU to make bet by the letters or numbers. ?
For exemple log of the srcipt))
Succesfully logged in the twich tlalala
Streamer ..... online.
(If we can make a bet write) "You can make the bet"
(If no just wait for the prediction)

"Choose the amount of coins (all for the all coins and side Red - 1 Blue 2
user input (for exemple) ALL 2, 300 1

That will be very usefull for me who need to make bets in the multiple accounts. Thanks)
If will do that can you make that we can login by the twich cookies from the gottagofaster236/Twitch-Channel-Points-Miner.
Thanks for attention)
I am looking forward to hearing from you

Martingale betting system

In roulette, starting with a fixed amount of money and progressively betting that amount you can win money, if you lose then double that bet amount to recover what you have lost.

The point is that it could be implemented in some way to bet on this program, to try to maintain a betting logic that generally works quite well.

My english is fairly limited and maybe someone has more knowledge to explain what I am trying to do. In roulette there are three options to bet and two of those options return 50% of what you bet, so maybe you have to do something else because of the variable percentages of the twitch bets.

Running on ARM8 / Raspberry Pi 3

Dear channel points miners,
i am kind of hooked by this project, because it works very well on my desktop machine for several hours.
So i decided to launch it on my raspberry pi 3 b+ model.

But there are some challenges to make it work.
First of all, when you are using Raspbian, your latest available firefox-esr version will be 52.9.0
Check it out using firefox-esr -version
That means you have to use geckodriver v0.18.0 ( thanks to MJ Richardson on stackoverflow)

I didn't change my selenium version: 3.141.0
I update my python to verion: 3.9.1

To fix the geckodriver error Error: GDK_BACKEND does not match available displays i had to add 3 lines of code into the TwitchBrowser class and remove self.browser.set_window_size(450, 800) call, because of an WebDriverException: Message: setWindowRect exception.

from pyvirtualdisplay import Display

def init(self):
        display = Display(visible=0, size=(450, 800)) # initialize a virtual display
        display.start()
       # ...
        if self.browser is not None:
            # self.browser.set_window_size(450, 800)
            self.browser.implicitly_wait(self.settings.implicitly_wait)
       # ...

The twitch channel points miner starts now as expected, but it can't find DOM Elements for placing a bet.

Claiming channelpints by watching seems to work fine.

Maybe because I removed the window size?
Did someone else got this program running on a raspberry pi with all of it's funtions?

When betting, script cannot input into channel-points-reward-center-body; "Failed to execute: document.getElementById("channel-points-reward-center-body").getElementsByTagName("input")[1].value = 80;"

19/01/21 20:09:05 - INFO - [place_bet]: 🔧  Going to complete bet for event EventPrediction(event_id=ecd2f6e9-3f50-4de1-9e16-ad60bd5d4f64, title=Does miz reset before he kills first bowser). Current url page: https://www.twitch.tv/popout/mizkif/chat?popout=
19/01/21 20:09:05 - INFO - [place_bet]: 🔧  Going to write: 80 on input B: {'id': '644a030e-c7d5-4120-8beb-1af316000045', 'color': 'PINK', 'title': 'No', 'total_points': 6470450, 'total_users': 801, 'percentage_users': 41.7, 'odds': 2.76}
19/01/21 20:09:16 - ERROR - [__send_text]: Exception raised with: (//div[@id='channel-points-reward-center-body']//div[contains(@class,'custom-prediction-button')]//input)[2]
Traceback (most recent call last):
  File "/home/aiden/Twitch-Channel-Points-Miner-v2/TwitchChannelPointsMiner/classes/TwitchBrowser.py", line 294, in __send_text
    element = WebDriverWait(self.browser, self.settings.timeout).until(
  File "/home/aiden/.local/lib/python3.9/site-packages/selenium/webdriver/support/wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: 

19/01/21 20:09:16 - ERROR - [__execute_script]: Failed to execute: document.getElementById("channel-points-reward-center-body").getElementsByTagName("input")[1].value = 80;
Traceback (most recent call last):
  File "/home/aiden/Twitch-Channel-Points-Miner-v2/TwitchChannelPointsMiner/classes/TwitchBrowser.py", line 150, in __execute_script
    self.browser.execute_script(javascript_code)
  File "/home/aiden/.local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 634, in execute_script
    return self.execute(command, {
  File "/home/aiden/.local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/home/aiden/.local/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: TypeError: document.getElementById(...) is null

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.