Skip to content

Commit aa581fb

Browse files
committed
more attempts
1 parent 8981e90 commit aa581fb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/download_byond_builds.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def create_chrome_browser(tmpdirname=None):
3232
"--no-sandbox",
3333
"--agressive-cache-discard",
3434
"--remote-debugging-port=9222",
35+
"user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0 SS13 BYOND Mirror/1.0"
3536
]
3637
for option in options:
3738
chrome_options.add_argument(option)
@@ -75,16 +76,25 @@ def get_available_builds(version, manual_pause=False):
7576
# Wait for anchors to appear
7677
WebDriverWait(browser, 15).until(EC.presence_of_element_located((By.TAG_NAME, "a")))
7778
links = browser.find_elements(By.TAG_NAME, "a")
79+
logger.info(f"Found {len(links)} anchor tags on the page for version {version}")
7880
files = []
7981
for link in links:
8082
file_name = link.text.strip()
83+
logger.debug(f"Anchor text: '{file_name}'")
8184
# Only match the specific file types we want: .exe, byond.zip, and byond_linux.zip
8285
if (file_name.endswith('_byond.exe') or
8386
file_name.endswith('_byond.zip') or
8487
file_name.endswith('_byond_linux.zip')):
8588
if re.search(f"{version}\\.\\d+_", file_name): # Verify it's the right version
89+
logger.info(f"Matched build file: {file_name}")
8690
files.append(file_name)
91+
else:
92+
logger.info(f"Skipped file (wrong version pattern): {file_name}")
93+
else:
94+
if file_name:
95+
logger.debug(f"Skipped anchor (not a build file): {file_name}")
8796
browser.quit()
97+
logger.info(f"Returning {len(files)} build files for version {version}: {files}")
8898
return files
8999
except Exception as e:
90100
logger.error(f"Error fetching build list for version {version}: {str(e)}")

0 commit comments

Comments
 (0)