From 60a61cf6ad44fa2e710fc8c67cbc8a4e8f71137d Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Mon, 20 Jan 2025 23:08:17 +0100 Subject: [PATCH] Fixed issue with x/y numbers --- instDownloader.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/instDownloader.py b/instDownloader.py index 044d265..fa44bb8 100644 --- a/instDownloader.py +++ b/instDownloader.py @@ -29,11 +29,13 @@ def get_instruction_links(set_id): v29_links = [] for alt_text, href in found_tags: 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 if '/' in alt_text: - parts = alt_text.split('/')[0] + parts = alt_text.split('/') + 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: x, y = numbers if x <= 10 and y <= 10: # Only consider valid x/y pairs