Merge pull request #80 from kelukelol/master

Biggest fix of punctuation, grammar, and typos yet.
This commit is contained in:
Alessandro Maggio
2021-02-18 15:25:34 +01:00
committed by GitHub
6 changed files with 62 additions and 61 deletions

View File

@@ -14,13 +14,13 @@ Please delete options that are not relevant.
# How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
# Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have commented on my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation (README.md)
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been updated in requirements.txt

View File

@@ -22,12 +22,12 @@ Fork with [GitHub Codespaces](https://github.com/features/codespaces):
- [Fork, edit, and preview](https://docs.github.com/en/free-pro-team@latest/github/developing-online-with-codespaces/creating-a-codespace) using [GitHub Codespaces](https://github.com/features/codespaces) without having to install and run the project locally.
### Open a pull request
When you're done making changes and you'd like to propose them for review, use the [pull request template](#pull-request-template) to open your PR (pull request).
When you're done making changes, and you'd like to propose them for review, use the [pull request template](#pull-request-template) to open your PR (pull request).
### Submit your PR & get it reviewed
- Once you submit your PR, others users from the community will review it with you. The first thing you're going to want to do is a [self review](#self-review).
- After that, we may have questions, check back on your PR to keep up with the conversation.
- Did you have an issue, like a merge conflict? Check out our [git tutorial](https://lab.github.com/githubtraining/managing-merge-conflicts) on how to resolve merge conflicts and other issues.
- Once you submit your PR, other users from the community will review it with you. The first thing you're going to want to do is a [self review](#self-review).
- After that, we may have questions. Check back on your PR to keep up with the conversation.
- Did you have an issue, like a merge conflict? Check out our [git tutorial](https://lab.github.com/githubtraining/managing-merge-conflicts) on resolving merge conflicts and other issues.
### Your PR is merged!
Congratulations! The whole GitHub community thanks you. :sparkles:
@@ -53,10 +53,10 @@ Now that you're a part of the GitHub Docs community, you can keep participating
- [Suggested changes](#suggested-changes)
## Types of contributions :memo:
You can contribute to the Twitch-Channel-Points-Miner-v2 in several ways. Bug reporting, pull request, propose new features, fork, donate and much more :muscle: .
You can contribute to the Twitch-Channel-Points-Miner-v2 in several ways. Bug reporting, pull request, propose new features, fork, donate, and much more :muscle: .
### :beetle: Issues
[Issues](https://docs.github.com/en/github/managing-your-work-on-github/about-issues) are used to report a bug, propose new features or ask for help. When you open a issue please use the appropriate template and lable.
[Issues](https://docs.github.com/en/github/managing-your-work-on-github/about-issues) are used to report a bug, propose new features, or ask for help. When you open an issue, please use the appropriate template and label.
### :hammer_and_wrench: Pull requests
A [pull request](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) is a way to suggest changes in our repository.
@@ -68,18 +68,18 @@ You can browse existing issues to find something that needs help!
### Labels
Labels can help you find an issue you'd like to help with.
- The `bug` label if used when omething isn't working
- The `documentation` label if used when you suggest improvements or additions to documentation (README.md update)
- The `duplicate` label if used when this issue or pull request already exists
- The `enhancement` label if used when you ask for / or propose new feature or request
- The `help wanted` if used when label when you need help for something
- The `improvements` label if used when you would suggest improvements on already existing features
- The `invalid` label if used for non-valid issue
- The `question` label if used for further information is requested
- The `wontfix` label if used if we will not work on it
- The `bug` label is used when something isn't working
- The `documentation` label is used when you suggest improvements or additions to documentation (README.md update)
- The `duplicate` label is used when this issue or pull request already exists
- The `enhancement` label is used when you ask for / or propose a new feature or request
- The `help wanted` is used when labeling when you need help with something
- The `improvements` label is used when you would suggest improvements on already existing features
- The `invalid` label is used for a non-valid issue
- The `question` label, is used for further information is requested
- The `wontfix` label is used if we will not work on it
## Opening a pull request
You can use the GitHub user interface :pencil2: for some small changes, like fixing a typo or updating a readme. You can also fork the repo and then clone it locally, to view changes and run your tests on your machine.
You can use the GitHub user interface :pencil2: for some small changes, like fixing a typo or updating a readme. You can also fork the repo and then clone it locally to view changes and run your tests on your machine.
### Self review
You should always review your own PR first.
@@ -97,7 +97,7 @@ For content changes, make sure that you:
When you open a pull request, you must fill out the "Ready for review" template before we can review your PR. This template helps reviewers understand your changes and the purpose of your pull request.
### Python Styleguide
All Python code is linted with [Black](https://github.com/psf/black) using the default settings. Your code will not be accepted if it is not blackened.
All Python code is formatted with [Black](https://github.com/psf/black) using the default settings. Your code will not be accepted if it is not blackened.
You can use the pre-commit hook.
```
pip install pre-commit

View File

@@ -40,25 +40,25 @@ Read more about channels point [here](https://help.twitch.tv/s/article/channel-p
## Community
If you have any type of issue, you need help, or you just want to suggest a new feature please open a GitHub Issue. Don't write me on [Instagram](https://www.instagram.com/tkd_alex/), [Telegram](https://t.me/TkdAlex), [Discord](https://discordapp.com/users/641397388132483121), [Twitter](https://twitter.com/TkdAxel) (but you can follow me 😆) or somewhere else. If you don't have an account on this platform you can create, It's free. I do not want to be rude, but if you have a problem, maybe another user can have also 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 have any type of issue, you need help, or you just want to suggest a new feature, please open a GitHub Issue. Don't write me on [Instagram](https://www.instagram.com/tkd_alex/), [Telegram](https://t.me/TkdAlex), [Discord](https://discordapp.com/users/641397388132483121), [Twitter](https://twitter.com/TkdAxel) (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 on this project please leave a star 🌟 and share with your friends! 😎
If you want to help on this project, please leave a star 🌟 and share it with your friends! 😎
A coffee is always a sign of LOVE ❤️
<a href="https://www.buymeacoffee.com/tkdalex" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/lato-yellow.png" alt="Buy Me A Coffee" height="41" width="174"></a>
If you have any issue, or you want to contribute you are welcome! But please before read the [CONTRIBUTING.md](/CONTRIBUTING.md)
If you have any issues or you want to contribute, you are welcome! But please before read the [CONTRIBUTING.md](/CONTRIBUTING.md)
## Main differences from the original repository:
- Improve the logging
- Final report with all the datas
- Final report with all the data
- Rewrite the entire code using classe instead of module with global variables
- Automatic download the followers list and use as input
- Automatic download the follower's list and use it 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 (🍀) your channel points!
- Place the bet / make a prediction and win 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))
## Logs feature
@@ -178,13 +178,13 @@ from TwitchChannelPointsMiner.classes.entities.Streamer import Streamer, Streame
twitch_miner = TwitchChannelPointsMiner(
username="your-twitch-username",
claim_drops_startup=False, # If you want to auto claim all drops from Twitch inventory on startup
claim_drops_startup=False, # If you want to auto claim all drops from Twitch inventory on the startup
logger_settings=LoggerSettings(
save=True, # If you want to save logs in file (suggested)
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 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
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
),
streamer_settings=StreamerSettings(
make_predictions=True, # If you want to Bet / Make prediction
@@ -206,12 +206,12 @@ twitch_miner = TwitchChannelPointsMiner(
)
)
# You can customize the settings for each streamer. If not settings was provided the script will use the streamer_settings from TwitchChannelPointsMiner.
# If no streamer_settings provided in TwitchChannelPointsMiner the script will use default settings.
# 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.
# 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(
@@ -244,7 +244,7 @@ twitch_miner.mine(["streamer1", "streamer2"], followers=True) # Mixed
### Limits
> Twitch has a limit - you can't watch more than 2 channels at one time. We take the first two streamers from the list as they have the highest priority.
Make sure to write the streamers array in order of priority from left to right. If you use `followers=True` Twitch return the streamers order by followed_at. So your last follow have the highest priority.
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 has the highest priority.
## Settings
@@ -254,15 +254,15 @@ Make sure to write the streamers array in order of priority from left to right.
| `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. |
| `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 |
| `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 |
### StreamerSettings
| Key | Type | Default | Description |
|-------------------- |------------- |-------------------------------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `make_predictions` | bool | True | Choose if you want to make predictions / bet or not |
| `follow_raid` | bool | True | Choose if you want to follow raid +250 points |
| `claim_drops` | bool | True | If this values is True the script will increase the watch-time for the current game. With this you are able to claim the drops from Twitch Inventory [#21](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/21) |
| `watch_streak` | bool | True | Choose if you want to change priority for this streamers and try to catch the Watch Streak event [#11](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/11) |
| `claim_drops` | bool | True | If this value is True, the script will increase the watch-time for the current game. With this, you are able to claim the drops from Twitch Inventory [#21](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/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](https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/issues/11) |
| `bet` | BetSettings | | Rules to follow for the bet |
### BetSettings
| Key | Type | Default | Description |
@@ -278,8 +278,8 @@ Make sure to write the streamers array in order of priority from left to right.
- **MOST_VOTED**: Select the option most voted based on users count
- **HIGH_ODDS**: Select the option with the highest odds
- **PERCENTAGE**: Select the option with the highest percentage based on odds (It's the same that show Twitch) - Should be the same of select LOWEST_ODDS
- **SMART**: If the majority in percent chose an option then follow the other users, otherwise choose the option with the highest odds
- **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**: If the majority in percent chose an option, then follow the other users, otherwise choose the option with the highest odds
![Screenshot](./assets/prediction.png)
@@ -289,6 +289,7 @@ Here a concrete example:
- **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 are 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 |
@@ -310,15 +311,15 @@ Allowed values for `by` are:
Allowed values for `where` are: `GT, LT, GTE, LTE`
#### Example
- If you want to place the bet ONLY if the total of users participants in the bet are greater than 200
- 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 1.3
- 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 highest bet is lower than 2000
- 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)`
## Migrating from old repository (the original one):
If you already have a `twitch-cookies.pkl` and you don't want to login again please create a `cookies/` folder in the current directory and then copy the .pkl file with a new name `your-twitch-username.pkl`
## Migrating from an old repository (the original one):
If you already have a `twitch-cookies.pkl` and you don't want to login again, please create a `cookies/` folder in the current directory and then copy the .pkl file with a new name `your-twitch-username.pkl`
```
.
+-- run.py
@@ -331,11 +332,11 @@ 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)`
Other usefully infos can be founded here:
Other useful info can be founded 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).
## Disclaimer
This project comes with no gurantee or warranty. You are responsible for whatever happens from using this project. It is possible to get soft or hard banned by using this project if you are not careful. This is a personal project and is in no way affiliated with Twitch.
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.

View File

@@ -66,7 +66,7 @@ class TwitchChannelPointsMiner:
):
self.username = username
# Set as globally config
# Set as global config
Settings.logger = logger_settings
# Init as default all the missing values
@@ -169,7 +169,7 @@ class TwitchChannelPointsMiner:
# Populate the streamers with default values.
# 1. Load channel points and auto-claim bonus
# 2. Check if streamers is online
# 2. Check if streamers are online
# 3. Check if the user is a Streamer. In thi case you can't do prediction
for streamer in self.streamers:
time.sleep(random.uniform(0.3, 0.7))
@@ -263,7 +263,7 @@ class TwitchChannelPointsMiner:
WebSocketsPool.handle_reconnection(self.ws_pool.ws[index])
def end(self, signum, frame):
logger.info("CTRL+C Detected! Please wait just a moments!")
logger.info("CTRL+C Detected! Please wait just a moment!")
self.running = self.twitch.running = False
self.ws_pool.end()

View File

@@ -32,7 +32,7 @@ class WebSocketsPool:
"""
API Limits
- Clients can listen on up to 50 topics per connection. Trying to listen on more topics will result in an error message.
- Clients can listen to up to 50 topics per connection. Trying to listen to more topics will result in an error message.
- We recommend that a single client IP address establishes no more than 10 simultaneous connections.
The two limits above are likely to be relaxed for approved third-party applications, as we start to better understand third-party requirements.
"""
@@ -124,7 +124,7 @@ class WebSocketsPool:
# Reconnect only if ws.forced_close is False (replace the keep_running)
# Set the current socket as reconnecting status
# So the exsternal ping check will be locked
# So the external ping check will be locked
ws.is_reconneting = True
if ws.forced_close is False:

View File

@@ -8,13 +8,13 @@ from TwitchChannelPointsMiner.classes.entities.Streamer import Streamer, Streame
twitch_miner = TwitchChannelPointsMiner(
username="your-twitch-username",
claim_drops_startup=False, # If you want to auto claim all drops from Twitch inventory on startup
claim_drops_startup=False, # If you want to auto claim all drops from Twitch inventory on the startup
logger_settings=LoggerSettings(
save=True, # If you want to save logs in file (suggested)
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 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
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
),
streamer_settings=StreamerSettings(
make_predictions=True, # If you want to Bet / Make prediction
@@ -29,19 +29,19 @@ twitch_miner = TwitchChannelPointsMiner(
stealth_mode=True, # If the calculated amount of channel points is GT the highest bet, place the highest value minus 1-2 points #33
filter_condition=FilterCondition(
by=OutcomeKeys.TOTAL_USERS, # Where apply the filter. Allowed [PERCENTAGE_USERS, ODDS_PERCENTAGE, ODDS, TOP_POINTS, TOTAL_USERS, TOTAL_POINTS]
where=Condition.LTE, # The key must be [GT, LT, GTE, LTE] than value
where=Condition.LTE, # 'by' must be [GT, LT, GTE, LTE] than value
value=800
)
)
)
)
# You can customize the settings for each streamer. If not settings was provided the script will use the streamer_settings from TwitchChannelPointsMiner.
# If no streamer_settings provided in TwitchChannelPointsMiner the script will use default settings.
# 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.
# 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(