Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…Points-Miner-v2 into report
  • Loading branch information
Petrarka0 committed Apr 11, 2024
2 parents 0efd1aa + 136333f commit 7e9f48e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
uses: docker/setup-qemu-action@v3.0.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.1.0
uses: docker/setup-buildx-action@v3.3.0

- name: Login to DockerHub
uses: docker/login-action@v3.0.0
uses: docker/login-action@v3.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Build and push AMD64, ARM64, ARMv7
id: docker_build
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v5.3.0
with:
context: .
push: true
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ twitch_miner = TwitchChannelPointsMiner(
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)
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
Expand Down Expand Up @@ -421,14 +421,14 @@ Make sure to write the streamers array in order of priority from left to right.

## 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.
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_DESCEDING` - On top the streamers with the highest 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.

Expand Down
2 changes: 1 addition & 1 deletion TwitchChannelPointsMiner/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = "1.9.4"
__version__ = "1.9.5"
from .TwitchChannelPointsMiner import TwitchChannelPointsMiner

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion TwitchChannelPointsMiner/classes/Settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Priority(Enum):
DROPS = auto()
SUBSCRIBED = auto()
POINTS_ASCENDING = auto()
POINTS_DESCEDING = auto()
POINTS_DESCENDING = auto()


class FollowersOrder(Enum):
Expand Down
6 changes: 3 additions & 3 deletions TwitchChannelPointsMiner/classes/Twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_spade_url(self, streamer):
streamer.streamer_url, headers=headers)
response = main_page_request.text
# logger.info(response)
regex_settings = "(https://static.twitchcdn.net/config/settings.*?js)"
regex_settings = "(https://static.twitchcdn.net/config/settings.*?js|https://assets.twitch.tv/config/settings.*?.js)"
settings_url = re.search(regex_settings, response).group(1)

settings_request = requests.get(settings_url, headers=headers)
Expand Down Expand Up @@ -395,7 +395,7 @@ def send_minute_watched_events(self, streamers, priority, chunk_size=3):

elif (
prior in [Priority.POINTS_ASCENDING,
Priority.POINTS_DESCEDING]
Priority.POINTS_DESCENDING]
and len(streamers_watching) < 2
):
items = [
Expand All @@ -407,7 +407,7 @@ def send_minute_watched_events(self, streamers, priority, chunk_size=3):
items,
key=lambda x: x["points"],
reverse=(
True if prior == Priority.POINTS_DESCEDING else False
True if prior == Priority.POINTS_DESCENDING else False
),
)
streamers_watching += [item["index"]
Expand Down
2 changes: 1 addition & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
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)
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
Expand Down

0 comments on commit 7e9f48e

Please sign in to comment.