Skip to content

Commit

Permalink
Merge branch 'DevilXD:master' into feat/priority-by-time
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcat authored May 22, 2024
2 parents 8444e25 + 27dcc9c commit 65c8976
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up variables
id: vars
Expand All @@ -32,7 +32,7 @@ jobs:
# Ensure Python version
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}

Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
Compress-Archive -Path $FolderName -DestinationPath Twitch.Drops.Miner.Windows.zip
- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: Twitch.Drops.Miner.Windows
Expand All @@ -77,7 +77,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up variables
id: vars
Expand All @@ -90,7 +90,7 @@ jobs:
# NOTE: We're only use a custom version of Python here because truststore requires at least Python 3.10, but Ubuntu 20.04 has Python 3.8.
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}

Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
7z a Twitch.Drops.Miner.Linux.PyInstaller.zip "${folder}"
- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: Twitch.Drops.Miner.Linux.PyInstaller
Expand All @@ -148,7 +148,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up variables
id: vars
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
7z a Twitch.Drops.Miner.Linux.AppImage.zip "${folder}"
- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: Twitch.Drops.Miner.Linux.AppImage
Expand All @@ -210,7 +210,7 @@ jobs:
echo "date_now=$(date --rfc-3339=seconds)" >> "${GITHUB_OUTPUT}"
- name: Download build artifacts from previous jobs
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts

Expand Down
10 changes: 5 additions & 5 deletions channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,21 +223,21 @@ async def get_spade_url(self) -> URLType:
For mobile view, spade_url is available immediately from the page, skipping step #2.
"""
SETTINGS_PATTERN: str = (
r'src="(https://static\.twitchcdn\.net/config/settings\.[0-9a-f]{32}\.js)"'
r'src="(https://[\w.]+/config/settings\.[0-9a-f]{32}\.js)"'
)
SPADE_PATTERN: str = (
r'"spade_?url": ?"(https://video-edge-[.\w\-/]+\.ts(?:\?allow_stream=true)?)"'
)
async with self._twitch.request("GET", self.url) as response:
streamer_html: str = await response.text(encoding="utf8")
async with self._twitch.request("GET", self.url) as response1:
streamer_html: str = await response1.text(encoding="utf8")
match = re.search(SPADE_PATTERN, streamer_html, re.I)
if not match:
match = re.search(SETTINGS_PATTERN, streamer_html, re.I)
if not match:
raise MinerException("Error while spade_url extraction: step #1")
streamer_settings = match.group(1)
async with self._twitch.request("GET", streamer_settings) as response:
settings_js: str = await response.text(encoding="utf8")
async with self._twitch.request("GET", streamer_settings) as response2:
settings_js: str = await response2.text(encoding="utf8")
match = re.search(SPADE_PATTERN, settings_js, re.I)
if not match:
raise MinerException("Error while spade_url extraction: step #2")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
aiohttp>=3.9,<4.0
Pillow
pystray
PyGObject; sys_platform == "linux" # required for better system tray support on Linux
PyGObject<3.47; sys_platform == "linux" # required for better system tray support on Linux

# environment-dependent dependencies
pywin32; sys_platform == "win32"
Expand Down

0 comments on commit 65c8976

Please sign in to comment.