diff --git a/src/data/sources/steamrip.py b/src/data/sources/steamrip.py index 71de40e..596688e 100644 --- a/src/data/sources/steamrip.py +++ b/src/data/sources/steamrip.py @@ -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") diff --git a/src/interface/dialogs/contextmenu.py b/src/interface/dialogs/contextmenu.py index c575623..08ed1f0 100644 --- a/src/interface/dialogs/contextmenu.py +++ b/src/interface/dialogs/contextmenu.py @@ -32,7 +32,7 @@ class ContextMenu_Downloads: self.main_window = main_window self.context_menu = QtWidgets.QMenu(main_window) self.context_menu.addAction("Open Containing Folder", self.openFolderAction) - self.context_menu.addAction("Copy Magnet URI", self.copyMagnetURIAction) + self.context_menu.addAction("Copy Download Link", self.copyMagnetURIAction) self.context_menu.addAction("Remove from list", self.cancelDownloadAction) self.context_menu.addAction("Delete File", self.deleteFileAction) @@ -205,9 +205,9 @@ class ContextMenu_TrackerTable: def __init__(self, main_window): self.main_window = main_window self.context_menu = QtWidgets.QMenu(main_window) - self.context_menu.addAction("Copy Magnet URI", self.copyMagnetURIAction) + self.context_menu.addAction("Copy Download Link", self.copyMagnetURIAction) self.context_menu.addAction("Open in Browser", self.openInBrowserAction) - self.context_menu.addAction("Download Item", self.downloadItemAction) + self.context_menu.addAction("Download", self.downloadItemAction) state.trackertable.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) state.trackertable.customContextMenuRequested.connect(self._show_context_menu)