mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
installed fuzzyfinder, scraped the links, started UI
This commit is contained in:
@@ -9,3 +9,4 @@ plyer==2.1.0
|
|||||||
psutil==7.1.0
|
psutil==7.1.0
|
||||||
libtorrent==2.0.11
|
libtorrent==2.0.11
|
||||||
libtorrent-windows-dll==0.0.3
|
libtorrent-windows-dll==0.0.3
|
||||||
|
fuzzyfinder==2.3.0
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
from bs4 import BeautifulSoup
|
||||||
|
import requests
|
||||||
|
import re
|
||||||
|
#from core.utils.general.logs import consoleLog
|
||||||
|
|
||||||
|
def scrape_steamrip_links():
|
||||||
|
url = f"https://steamrip.com/games-list-page/"
|
||||||
|
response = requests.get(url)
|
||||||
|
soup = BeautifulSoup(response.text, "html.parser")
|
||||||
|
games = soup.find_all("li", class_="az-list-item")
|
||||||
|
|
||||||
|
if len(games) == 0:
|
||||||
|
return []
|
||||||
|
|
||||||
|
links = []
|
||||||
|
for gamehtml in games:
|
||||||
|
link = gamehtml.find("a", href=lambda x: x and x.startswith("/"))
|
||||||
|
links += re.findall('(?<=href=")[^"]*', link.__str__())
|
||||||
|
|
||||||
|
return links
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print(scrape_steamrip_links())
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import fuzzyfinder
|
||||||
|
from PySide6 import QtCore, QtWidgets, QtGui
|
||||||
|
|
||||||
|
class FuzzySearchWindow(QtWidgets.QWidget):
|
||||||
|
"""
|
||||||
|
The dict should contain a:
|
||||||
|
name : str
|
||||||
|
THIS IS REQUIRED
|
||||||
|
|
||||||
|
all other things will be displayed alphabetically after it.
|
||||||
|
All elements should have the same Keys, eg when one element has "sources" : "buzzheavier" all other elements should as well have a key called "sources", though the value can be "MegaDB"
|
||||||
|
|
||||||
|
All elements are strings, e.g. "count" : "1"
|
||||||
|
|
||||||
|
The key will be at the Top of the Table
|
||||||
|
The value will be listed for each element
|
||||||
|
"""
|
||||||
|
def __init__(self, options: list[dict[str, str]]):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
self.opts: list[dict[str, str]] = options
|
||||||
|
|
||||||
|
self.searchbox = QtWidgets.QTextEdit()
|
||||||
|
self.searchbox.placeholderText = "Search for a game"
|
||||||
|
|
||||||
|
self.table = QtWidgets.QTableWidget()
|
||||||
|
self.table.setHorizontalHeader(self.opts[0].keys())
|
||||||
|
|
||||||
Reference in New Issue
Block a user