Merge pull request #50 from Tkd-Alex/off-selenium
Place the bet without Selenium
This commit is contained in:
58
README.md
58
README.md
@@ -1,6 +1,4 @@
|
||||
# Twitch Channel Points Miner - v2
|
||||
|
||||

|
||||

|
||||
<p align="center">
|
||||
<a href="https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/github/license/Tkd-Alex/Twitch-Channel-Points-Miner-v2"></a>
|
||||
<a href="https://www.python.org/download/releases/3.0/"><img alt="Python3" src="https://img.shields.io/badge/built%20with-Python3-red.svg?style=flat"></a>
|
||||
@@ -12,7 +10,7 @@
|
||||
|
||||
**Credits**
|
||||
- Main idea: https://github.com/gottagofaster236/Twitch-Channel-Points-Miner
|
||||
- Bet system (Selenium): https://github.com/ClementRoyer/TwitchAutoCollect-AutoBet
|
||||
- ~~Bet system (Selenium): https://github.com/ClementRoyer/TwitchAutoCollect-AutoBet~~
|
||||
|
||||
> A simple script that will watch a stream for you and earn the channel points.
|
||||
|
||||
@@ -28,9 +26,8 @@ Read more about channels point [here](https://help.twitch.tv/s/article/channel-p
|
||||
- Automatic download the followers list and use as input
|
||||
- Better 'Watch Streak' strategy in priority system [#11](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/11)
|
||||
- Auto claim game drops from Twitch inventory [#21](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/21) Read more about game drops [here](https://help.twitch.tv/s/article/mission-based-drops)
|
||||
- Place the bet / make prediction and won or lose (good luck) your channel points! **(CURRENTLY IN BETA)**
|
||||
|
||||
For the bet system the script use Selenium. Could be usefull understand how to MakePrediction usign a [POST] request. I've also write a [poc](/TwitchChannelPointsMiner/classes/Twitch.py#L160) but I don't know how to calculate/create the transactionID. Any helps are welcome
|
||||
- Place the bet / make prediction and won or lose (🍀) your channel points!
|
||||
No browser needed. [#41](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/41) ([@lay295](https://github.com/lay295))
|
||||
|
||||
### Full logs
|
||||
```
|
||||
@@ -47,10 +44,8 @@ For the bet system the script use Selenium. Could be usefull understand how to M
|
||||
%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 - [place_bet]: 🔧 Going to complete bet 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 - [place_bet]: 🔧 Decision: YES (PINK), Points: 156k, Users: 46 (61.33%), Odds: 1.57 (63.69%)
|
||||
%d/%m/%y %H:%M:%S - INFO - [place_bet]: 🔧 Going to write: 4296 channel points on input B
|
||||
%d/%m/%y %H:%M:%S - INFO - [place_bet]: 🔧 Going to place the bet for EventPrediction(event_id=xxxx-xxxx-xxxx-xxxx, title=Please star this repo)
|
||||
%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.
|
||||
@@ -80,10 +75,8 @@ For the bet system the script use Selenium. Could be usefull understand how to M
|
||||
%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 - 🔧 Decision: YES (PINK), Points: 156k, Users: 46 (61.33%), Odds: 1.57 (63.69%)
|
||||
%d/%m %H:%M:%S - 🔧 Going to write: 4296 channel points on input B
|
||||
%d/%m %H:%M:%S - 🔧 Going to place the bet for EventPrediction: Please star this repo
|
||||
%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.
|
||||
@@ -149,7 +142,6 @@ from TwitchChannelPointsMiner import TwitchChannelPointsMiner
|
||||
from TwitchChannelPointsMiner.logger import LoggerSettings
|
||||
from TwitchChannelPointsMiner.classes.entities.Bet import Strategy, BetSettings, Condition, OutcomeKeys, FilterCondition
|
||||
from TwitchChannelPointsMiner.classes.entities.Streamer import Streamer, StreamerSettings
|
||||
from TwitchChannelPointsMiner.classes.TwitchBrowser import Browser, BrowserSettings
|
||||
|
||||
twitch_miner = TwitchChannelPointsMiner(
|
||||
username="your-twitch-username",
|
||||
@@ -161,11 +153,6 @@ twitch_miner = TwitchChannelPointsMiner(
|
||||
emoji=True, # On Windows we have a problem to print emoji. Set to false if you have a problem
|
||||
less=False # If you think that the logs are too much verborse set this to True
|
||||
),
|
||||
browser_settings=BrowserSettings(
|
||||
browser=Browser.FIREFOX, # Choose if you want to use Chrome or Firefox as browser
|
||||
show=False, # Show the browser during bet else headless mode
|
||||
do_screenshot=False, # Do screenshot during the bet
|
||||
),
|
||||
streamer_settings=StreamerSettings(
|
||||
make_predictions=True, # If you want to Bet / Make prediction
|
||||
follow_raid=True, # Follow raid to obtain more points
|
||||
@@ -226,8 +213,6 @@ twitch_miner.mine(["streamer1", "streamer2"], followers=True) # Mixed
|
||||
|
||||
Make sure to write the streamers array in order of priority from left to right. If you use `followers=True` Twitch return the streamers order by followed_at. So your last follow have the highest priority.
|
||||
|
||||
If the browser are currently betting or wait for more data It's impossible to interact with another event prediction from another streamer.
|
||||
|
||||
## Settings
|
||||
|
||||
### LoggerSettings
|
||||
@@ -238,17 +223,6 @@ If the browser are currently betting or wait for more data It's impossible to in
|
||||
| `console_level` | level | logging.INFO | Level of logs in terminal - Use logging.DEBUG for more helpful messages. |
|
||||
| `file_level` | level | logging.DEBUG | Level of logs in file save - If you think the log file it's too big use logging.INFO |
|
||||
| `emoji` | bool | For Windows is False else True | On Windows we have a problem to print emoji. Set to false if you have a problem |
|
||||
### BrowserSettings
|
||||
| Key | Type | Default | Description |
|
||||
|------------------- |--------- |--------- |------------------------------------------------------------------------------------------------- |
|
||||
| `timeout` | float | 10 | If no element was found by Selenium raise exception after timeouts. Increase on slow connection |
|
||||
| `implicitly_wait` | int | 5 | Wait x seconds after continue Selenium execution |
|
||||
| `max_attempts` | int | 3 | Number of max attempt for place bet |
|
||||
| `do_screenshot` | bool | False | Save screenshot before/after do some Selenium action - Help debug |
|
||||
| `save_html` | bool | False | Save html content before/after do some Selenium action - Help debug |
|
||||
| `show` | bool | True | Choose if you want to see or not the browser - Help debug |
|
||||
| `browser` | Browser | FIREFOX | Choose your favourite browser |
|
||||
| `driver_path` | str | None | Write the path of chromedriver or geckodriver |
|
||||
### StreamerSettings
|
||||
| Key | Type | Default | Description |
|
||||
|-------------------- |------------- |-------------------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
@@ -323,30 +297,14 @@ If you already have a `twitch-cookies.pkl` and you don't want to login again ple
|
||||
Other users have find multiple problems on Windows my suggestion are:
|
||||
- Stop use Windows :stuck_out_tongue_closed_eyes:
|
||||
- Suppress the emoji in logs with `logger_settings=LoggerSettings(emoji=False)`
|
||||
- Download the geckodriver from here: https://github.com/mozilla/geckodriver/releases/ and extract in the same folder of this project. For other issue with geckodriver just googling: https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path
|
||||
|
||||
Other usefully infos can be founded here: https://github.com/gottagofaster236/Twitch-Channel-Points-Miner/issues/31
|
||||
|
||||
## Use Chrome instead Firefox
|
||||
If you prefer Chrome instead Firefox please download the WebDriver matching with your Chrome version and OS from this link: https://chromedriver.chromium.org/downloads.
|
||||
Extract the archivie, copy the chromedriver file in this project folder.
|
||||
Edit your run.py file and the browser_settings should something like this:
|
||||
```python
|
||||
browser_settings=BrowserSettings(
|
||||
browser=Browser.CHROME,
|
||||
driver_path="/path/of/your/chromedriver" # If no path was provided the script will try to search automatically
|
||||
),
|
||||
```
|
||||
|
||||
## Issue / Debug
|
||||
When you open a new issue please use the correct template.
|
||||
Please provide at least the following information/files:
|
||||
- Browser (if you have the prediction feature enabled)
|
||||
- Operation System
|
||||
- Python Version
|
||||
- logs/ `LoggerSettings(file_level=logging.DEBUG)`
|
||||
- htmls/ `BrowserSettings(save_html=True)`
|
||||
- screenshots/ `BrowserSettings(do_screenshot=True)`
|
||||
|
||||
Make sure also to have the latest commit.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user