Fixed issue with x/y numbers

This commit is contained in:
FrederikBaerentsen 2025-01-20 23:08:17 +01:00
parent a882dfc743
commit 60a61cf6ad

View File

@ -29,11 +29,13 @@ def get_instruction_links(set_id):
v29_links = [] v29_links = []
for alt_text, href in found_tags: for alt_text, href in found_tags:
if "V29" in alt_text or "V 29" in alt_text: if "V29" in alt_text or "V 29" in alt_text:
print(alt_text)
# Check for x/y format or assign sequential numbers if missing # Check for x/y format or assign sequential numbers if missing
if '/' in alt_text: if '/' in alt_text:
parts = alt_text.split('/')[0] parts = alt_text.split('/')
try: try:
numbers = [int(num) for num in parts.replace("-", " ").split() if num.isdigit()] numbers = [int(parts[0][-1]),int(parts[1][0])] #[int(num) for num in parts.replace("-", " ").split() if num.isdigit()]
if len(numbers) == 2: if len(numbers) == 2:
x, y = numbers x, y = numbers
if x <= 10 and y <= 10: # Only consider valid x/y pairs if x <= 10 and y <= 10: # Only consider valid x/y pairs