refactor: remove duplicate stripping

This commit is contained in:
Vxrtrauter
2026-03-04 21:00:37 +01:00
parent 8fb1bb9e8d
commit a7c71b37f5
+2 -5
View File
@@ -10,15 +10,12 @@ def scrape_uztracker(query):
posts = []
try:
response = requests.get(
f"{search_url.rstrip('/')}/tracker.php",
params={'nm': query},
)
response = requests.get(search_url)
response.raise_for_status()
soup = BeautifulSoup(response.text, 'html.parser')
links = soup.find_all('tr', class_="tCenter hl-tr", id=lambda x: x and x.startswith('tor_'))
for link in links:
theme_link = link.find('a', class_="genmed tLink", href=lambda x: x and x.startswith('./viewtopic'))
url = urljoin(base_url, theme_link['href'])
title = theme_link.b.text