From 361ddb60a332cfc4e62f81464c8496390426bfd2 Mon Sep 17 00:00:00 2001 From: KeksNino Date: Wed, 25 Jun 2025 16:59:13 +0200 Subject: [PATCH] fixed viewtopic filter --- core/uztracker_scraper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/uztracker_scraper.py b/core/uztracker_scraper.py index befb53a..3c604d4 100644 --- a/core/uztracker_scraper.py +++ b/core/uztracker_scraper.py @@ -12,7 +12,6 @@ def scrape_uztracker(): print(search_url) try: response = requests.get(search_url) - response.raise_for_status() soup = BeautifulSoup(response.text, 'html.parser') links = soup.find_all('a') found_links = False @@ -20,7 +19,8 @@ def scrape_uztracker(): if link.has_attr('href'): href = link['href'] post_url = f"https:{href}" if isinstance(href, str) and href.startswith("//") else href - if isinstance(post_url, str) and post_url.startswith("https://uztracker.net/viewtopic.php?t="): # please figure out why this .startswith filter is not working + if isinstance(post_url, str) and post_url.startswith("./viewtopic.php?t="): # please figure out why this .startswith filter is not working + post_url = f"https://uztracker.net{post_url[1:]}" print(f"Found post link: {post_url}") found_links = True if not found_links: