rdavydov / Twitch-Channel-Points-Miner-v2

A simple script that will watch a stream for you and earn the channel points.
GNU General Public License v3.0
1.1k stars 326 forks source link

Fix regex to extract the client version #525

Closed hingston closed 2 weeks ago

hingston commented 1 month ago

Description

Updates the regex to work with the current client version.

Fixes #524

The original pattern r"window\.__twilightBuildID=\"([0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12})\";" didn't match because it strictly expected an exact format, including specific UUID segments and a trailing semicolon. The adjusted pattern r'window\.__twilightBuildID\s*=\s*"([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})"' is more flexible, allowing for optional whitespace around the equal sign and matching any valid UUID.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

I've ran it locally.

Checklist: