Spaces:
Running
Running
Add v-league to LEAGUE_IDS (tid=27433)
Browse files- main_patch_vleague.py +23 -0
main_patch_vleague.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Patch to add v-league to LEAGUE_IDS in main.py.
|
| 2 |
+
Run this once to apply the fix, then delete."""
|
| 3 |
+
import re
|
| 4 |
+
|
| 5 |
+
# Read current main.py
|
| 6 |
+
with open("/app/main.py" if False else "main.py", "r") as f:
|
| 7 |
+
content = f.read()
|
| 8 |
+
|
| 9 |
+
# Replace LEAGUE_IDS line
|
| 10 |
+
old = 'LEAGUE_IDS = {"nha":27110,"laliga":27233,"seriea":27044,"bundesliga":26891,"ligue1":27212}'
|
| 11 |
+
new = 'LEAGUE_IDS = {"nha":27110,"laliga":27233,"seriea":27044,"bundesliga":26891,"ligue1":27212,"v-league":27433,"vleague":27433,"vietnam":27433}'
|
| 12 |
+
|
| 13 |
+
if old in content:
|
| 14 |
+
content = content.replace(old, new)
|
| 15 |
+
with open("main.py", "w") as f:
|
| 16 |
+
f.write(content)
|
| 17 |
+
print("Patched LEAGUE_IDS to include v-league=27433")
|
| 18 |
+
else:
|
| 19 |
+
print("Pattern not found, may already be patched")
|
| 20 |
+
# Check current state
|
| 21 |
+
match = re.search(r'LEAGUE_IDS\s*=\s*\{[^}]+\}', content)
|
| 22 |
+
if match:
|
| 23 |
+
print(f"Current: {match.group()}")
|