Refactor: steamrip scraper & update menu labels

Simplify SteamripScraper link/name extraction by using BeautifulSoup results directly (append absolute URLs and use link.get_text()) and avoid fragile regex; adjust scrape_steamrip_game_downloads to accept a full URL argument. Update context menu text: replace "Copy Magnet URI" with "Copy Download Link" in two places and rename "Download Item" to "Download" for clearer UI wording.
This commit is contained in:
Vxrtrauter
2026-04-09 23:56:14 +02:00
parent eb9d5d60d1
commit 4f943759f4
2 changed files with 8 additions and 10 deletions
+5 -7
View File
@@ -37,13 +37,12 @@ class SteamripScraper:
links = []
names = []
for gamehtml in games:
link = gamehtml.find("a", href=lambda x: x and x.startswith("/"))
links += re.findall(r'(?<=href=")[^"]*', link.__str__())
name = gamehtml.find("a", href=lambda x: x and x.startswith("/"))
names += re.findall(r'(?<=\/">)[^<]*', name.__str__())
# construct the list[dict[str,str]]
if link:
links.append("https://steamrip.com" + link["href"])
names.append(link.get_text())
ret = []
@@ -52,8 +51,7 @@ class SteamripScraper:
return ret
def scrape_steamrip_game_downloads(self, gamelink):
url = "https://steamrip.com" + gamelink
def scrape_steamrip_game_downloads(self, url):
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
download_link_elements = soup.find_all("a",class_="shortc-button")