# Twitch Drops Miner

Automated Twitch Drops farming bot - Focus on collecting drops efficiently

๐Ÿ”— https://gitea.majjoduran.app/majjo/Twitch-Drops-Miner

**Forked From:** [Twitch-Channel-Points-Miner-v2](https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2) by rdavydov **Original Credits:** - Main idea: https://github.com/gottagofaster236/Twitch-Channel-Points-Miner - Based on: https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2 > **This fork focuses on Twitch Drops farming** - automatically watches streams to collect drops efficiently. Read more about Twitch Drops [here](https://help.twitch.tv/s/article/mission-based-drops). # README Contents 1. ๐Ÿค [Community](#community) 2. ๐Ÿš€ [Main differences from the original repository](#main-differences-from-the-original-repository) 3. ๐Ÿงพ [Logs feature](#logs-feature) - [Full logs](#full-logs) - [Less logs](#less-logs) - [Final report](#final-report) 4. ๐Ÿง [How to use](#how-to-use) - [Cloning](#by-cloning-the-repository) - [Docker](#docker) - [Docker Hub](#docker-hub) - [Portainer](#portainer) - [Limits](#limits) 5. ๐Ÿ”ง [Settings](#settings) - [LoggerSettings](#loggersettings) - [StreamerSettings](#streamersettings) 6. ๐Ÿช [Migrating from an old repository (the original one)](#migrating-from-an-old-repository-the-original-one) 7. ๐ŸชŸ [Windows](#windows) 8. ๐Ÿ“ฑ [Termux](#termux) 9. โš ๏ธ [Disclaimer](#disclaimer) ## Community If you want to help with this project, please leave a star ๐ŸŒŸ and share it with your friends! ๐Ÿ˜Ž If you have any issues or want to contribute, feel free to open an issue or pull request on the [Gitea repository](https://gitea.majjoduran.app/majjo/Twitch-Drops-Miner). **Support the Original Authors:** If you appreciate the original work this project is based on, consider supporting [rdavydov's original project](https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2). ## Main differences from the original repository: - Improved logging: emojis, colors, files and much more โœ”๏ธ - Final report with all the data โœ”๏ธ - Rewritten codebase now uses classes instead of modules with global variables โœ”๏ธ - Automatic downloading of the list of followers and using it as an input โœ”๏ธ - Better 'Watch Streak' strategy in the priority system [#11](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/11) โœ”๏ธ - Auto claiming [game drops](https://help.twitch.tv/s/article/mission-based-drops) from the Twitch inventory [#21](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/21) โœ”๏ธ - Switchable analytics chart that shows the progress of your points with various annotations [#96](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/96) โœ”๏ธ - Joining the IRC Chat to increase the watch time and get StreamElements points [#47](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/47) โœ”๏ธ - [Moments](https://help.twitch.tv/s/article/moments) claiming [#182](https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2/issues/182) โœ”๏ธ - Notifying on `@nickname` mention in the Twitch chat [#227](https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2/issues/227) โœ”๏ธ ## 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 - [on_message]: ๐Ÿš€ +12 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=61377) - Reason: WATCH. %d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€ +12 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=61389) - Reason: WATCH. %d/%m/%y %H:%M:%S - INFO - [on_message]: ๐Ÿš€ +12 โ†’ Streamer(username=streamer-username, channel_id=0000000, channel_points=61401) - 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 - +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 - ๐Ÿค– Streamer(username=streamer-username, channel_id=0000000, channel_points=67247), Total points gained (after farming - before farming): 1243 %d/%m/%y %H:%M:%S - ๐Ÿ’ฐ CLAIM(11 times, 550 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](https://gitea.majjoduran.app/majjo/Twitch-Drops-Miner/src/branch/main/example.py) and modify it according to your needs. ```python # -*- coding: utf-8 -*- import logging from colorama import Fore from TwitchChannelPointsMiner import TwitchChannelPointsMiner from TwitchChannelPointsMiner.logger import LoggerSettings, ColorPalette from TwitchChannelPointsMiner.classes.Chat import ChatPresence from TwitchChannelPointsMiner.classes.Discord import Discord from TwitchChannelPointsMiner.classes.Webhook import Webhook from TwitchChannelPointsMiner.classes.Telegram import Telegram from TwitchChannelPointsMiner.classes.Gotify import Gotify from TwitchChannelPointsMiner.classes.Settings import Priority, Events, FollowersOrder 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_DESCENDING) ], enable_analytics=False, # Disables Analytics if False. Disabling it significantly reduces memory consumption disable_ssl_cert_verification=False, # Set to True at your own risk and only to fix SSL: CERTIFICATE_VERIFY_FAILED error disable_at_in_nickname=False, # Set to True if you want to check for your nickname mentions in the chat even without @ sign logger_settings=LoggerSettings( save=True, # If you want to save logs in a file (suggested) console_level=logging.INFO, # Level of logs - use logging.DEBUG for more info console_username=False, # Adds a username to every console log line if True. Also adds it to Telegram, Discord, etc. Useful when you have several accounts auto_clear=True, # Create a file rotation handler with interval = 1D and backupCount = 7 if True (default) time_zone="", # Set a specific time zone for console and file loggers. Use tz database names. Example: "America/Denver" file_level=logging.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 set to None if you don't want to receive updates on Telegram chat_id=123456789, # Chat ID to send messages @getmyid_bot token="123456789:shfuihreuifheuifheuifhiu34578347", # Telegram API token @BotFather events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, Events.CHAT_MENTION], # 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.CHAT_MENTION], # Only these events will be sent to the chat ), webhook=Webhook( endpoint="https://example.com/webhook", # Webhook URL method="GET", # GET or POST events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, Events.CHAT_MENTION], # Only these events will be sent to the endpoint ), matrix=Matrix( username="twitch_miner", # Matrix username (without homeserver) password="...", # Matrix password homeserver="matrix.org", # Matrix homeserver room_id="...", # Room ID events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE], # Only these events will be sent ), pushover=Pushover( userkey="YOUR-ACCOUNT-TOKEN", # Login to https://pushover.net/, the user token is on the main page token="YOUR-APPLICATION-TOKEN", # Create a application on the website, and use the token shown in your application priority=0, # Read more about priority here: https://pushover.net/api#priority sound="pushover", # A list of sounds can be found here: https://pushover.net/api#sounds events=[Events.CHAT_MENTION, Events.DROP_CLAIM], # Only these events will be sent ), gotify=Gotify( endpoint="https://example.com/message?token=TOKEN", priority=8, events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, Events.CHAT_MENTION], ) ), streamer_settings=StreamerSettings( follow_raid=True, # Follow raid to obtain more points claim_drops=True, # We can't filter rewards base on stream. Set to False for skip viewing counter increase and you will never obtain a drop reward from this script. Issue #21 claim_moments=True, # If set to True, https://help.twitch.tv/s/article/moments will be claimed when available watch_streak=True, # If a streamer go online change the priority of streamers array and catch the watch screak. Issue #11 community_goals=False, # If True, contributes the max channel points per stream to the streamers' community challenge goals chat=ChatPresence.ONLINE, # Join irc chat to increase watch-time [ALWAYS, NEVER, ONLINE, OFFLINE] ) ) # 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 but you have set it on TwitchChannelPointsMiner instance, the script will take the value from here. # If you haven't set any value even in the instance the default one will be used #twitch_miner.analytics(host="127.0.0.1", port=5000, refresh=5, days_ago=7) # Start the Analytics web-server (replit: host="0.0.0.0") twitch_miner.mine( [ Streamer("streamer-username01", settings=StreamerSettings(follow_raid=False , claim_drops=True , watch_streak=True , community_goals=False )), Streamer("streamer-username02", settings=StreamerSettings(follow_raid=True , claim_drops=False )), Streamer("streamer-username03", settings=StreamerSettings(follow_raid=False , watch_streak=True , community_goals=True )), Streamer("streamer-username04", settings=StreamerSettings(follow_raid=True , watch_streak=True )), Streamer("streamer-username05", settings=StreamerSettings(follow_raid=True , claim_drops=True , watch_streak=True , community_goals=True )), 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: ```python 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](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/94) ```python 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://gitea.majjoduran.app/majjo/Twitch-Drops-Miner.git` 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 ```sh pip install virtualenv virtualenv -p python3 venv source venv/bin/activate pip install -r requirements.txt ``` Start mining! `python run.py` ๐Ÿฅณ ### Docker #### Docker Hub Official Docker images are on https://hub.docker.com/r/rdavidoff/twitch-channel-points-miner-v2 for `linux/amd64`, `linux/arm64` and `linux/arm/v7`. 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:** ```yml version: "3.9" services: miner: image: rdavidoff/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:** ```sh 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 \ rdavidoff/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`. The correct solution for Windows lies in the correct command line: `docker run -v C:\Absolute\Path\To\Twitch-Channel-Points-Miner-v2\run.py:/usr/src/app/run.py:ro rdavidoff/twitch-channel-points-miner-v2`. `run.py` MUST be mounted as a volume (`-v`). 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 ```sh docker run --name user1 -v $(pwd)/user1.py:/usr/src/app/run.py:ro -p 5001:5000 rdavidoff/twitch-channel-points-miner-v2 ``` ```sh docker run --name user2 -v $(pwd)/user2.py:/usr/src/app/run.py:ro -p 5002:5000 rdavidoff/twitch-channel-points-miner-v2 ``` #### Portainer [Link](https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2/wiki/Deploy-Docker-container-in-Portainer) to the illustrated guide on how to deploy a Docker container in Portainer. ### 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_DESCENDING` 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_DESCENDING` - 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](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/10) | | `console_level` | level | logging.INFO | Level of logs in terminal - Use logging.DEBUG for more helpful messages. | | `console_username`| bool | False | Adds a username to every log line in the console if True. [#602](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/602)| | `time_zone`| str | None | Set a specific time zone for console and file loggers. Use tz database names. Example: "America/Denver" https://github.com/rdavydov/Twitch-Channel-Points-Miner-v2/issues/205| | `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](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/45) [#82](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/82) | | `auto_clear` | bool | True | Create a file rotation handler with interval = 1D and backupCount = 7 [#215](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/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](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/233) | | `discord` | Discord | None | (Optional) Receive Discord updates for multiple events list [#320](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/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 ```python 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, ) ``` #### Telegram If you want to receive logs update on Telegram, initiate a new Telegram class, else omit this parameter or set as None. 1. Create a bot with [@BotFather](https://t.me/botfather) 2. Get you `chat_id` with [@getmyid_bot](https://t.me/getmyid_bot) | Key | Type | Default | Description | |----------------------- |----------------- |--------- |------------------------------------------------------------------- | | `chat_id` | int | | Chat ID to send messages @getmyid_bot | | `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) | ```python Telegram( chat_id=123456789, token="123456789:shfuihreuifheuifhiu34578347", events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, Events.CHAT_MENTION], 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](https://www.youtube.com/watch?v=fKksxz2Gdnc) 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 | ```python Discord( webhook_api="https://discord.com/api/webhooks/0123456789/0a1B2c3D4e5F6g7H8i9J", events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, Events.CHAT_MENTION], ) ``` #### Generic Webhook You can use generic webhook | Key | Type | Default | Description | |----------------------- |------------------|-----------|------------------------------------------------------------------- | | `endpoint` | string | | webhook url | | `method` | string | | `POST` or `GET` | | `events` | list | | Only these events will be sent to the endpoint. Array of Event. or str | ```python Webhook( endpoint="https://example.com/webhook", method="GET", events=[Events.STREAMER_ONLINE, Events.STREAMER_OFFLINE, Events.CHAT_MENTION], ) ``` #### Events - `STREAMER_ONLINE` - `STREAMER_OFFLINE` - `GAIN_FOR_RAID` - `GAIN_FOR_CLAIM` - `GAIN_FOR_WATCH` - `BONUS_CLAIM` - `MOMENT_CLAIM` - `JOIN_RAID` - `DROP_CLAIM` - `DROP_STATUS` - `CHAT_MENTION` ### StreamerSettings | Key | Type | Default | Description | |-------------------- |------------- |-------------------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `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](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/21) | | `claim_moments` | bool | True | If set to True, [moments](https://help.twitch.tv/s/article/moments) will be claimed when available | | `watch_streak` | bool | True | Choose if you want to change a priority for these streamers and try to catch the Watch Streak event [#11](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/11) | | `community_goals` | bool | False | If True, contributes the max channel points per stream to the streamers' community challenge goals | | `chat` | ChatPresence | ONLINE | Join IRC-Chat to appear online in chat and attempt to get StreamElements channel points and increase view-time [#47](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/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) ## 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. Suggestions are: - Stop using Windows :stuck_out_tongue_closed_eyes: - Suppress the emoji in logs with `logger_settings=LoggerSettings(emoji=False)` Other useful info can be found here: - https://github.com/gottagofaster236/Twitch-Channel-Points-Miner/issues/31 - https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/55 You can also follow this [video tutorial](https://www.youtube.com/watch?v=0VkM7NOZkuA). ## Termux **1. Upgrade packages** ``` pkg upgrade ``` **2. Install packages to Termux** ``` pkg install python git rust libjpeg-turbo libcrypt ndk-sysroot clang zlib binutils tur-repo python-cryptography LDFLAGS="-L${PREFIX}/lib/" CFLAGS="-I${PREFIX}/include/" pip install --upgrade wheel pillow ``` Note: `pkg install tur-repo` will basically enable the [user repository](https://github.com/termux-user-repository/tur) _(Very similar to Arch AUR)_ and `python-pandas` pre-compiled package comes exactly from this repository. **3. Install pandas** ``` pkg install python-pandas ``` **4. Clone this repository** `git clone https://gitea.majjoduran.app/majjo/Twitch-Drops-Miner.git` **5. Go to the miner's directory** `cd Twitch-Drops-Miner` **6. Configure your miner on your preferences by typing** `nano example.py` **7. Rename file name (optional)** `mv example.py run.py` **8. Install packages** ``` pip install -r requirements.txt ``` **9. Run the miner!** `python run.py` Read more at [#92](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/92) [#76](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/76) **Note** If you can't install `cryptography`, please try: `export RUSTFLAGS=" -C lto=no" && export CARGO_BUILD_TARGET="$(rustc -vV | sed -n 's|host: ||p')" && pip install cryptography` โš ๏ธ Installation of `pandas`, `maturin` and `cryptography` takes a long time. ## 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.