Compare commits

...

17 Commits

Author SHA1 Message Date
Vxrtrauter 3960612f94 fix settings icon not showing up 2025-10-18 23:47:54 +02:00
KeksNino a37a47b65b add update checker file for windows 2025-10-18 22:40:25 +02:00
KeksNino 76b26664f2 add updater for windows (experimental) 2025-10-18 22:37:05 +02:00
KeksNino c8a1e72107 remove test.txt 2025-10-18 22:09:22 +02:00
KeksNino 7c505f1402 this is a test 2025-10-18 16:45:09 +02:00
KeksNino 55e4f86a39 update workflows 2025-10-18 15:59:50 +02:00
KeksNino bd71b0e645 update workflows 2025-10-18 15:55:48 +02:00
KeksNino 2a86e4b774 update workflows 2025-10-18 15:50:16 +02:00
shayaa d17b4bd44a add & impl. m0nkrus scraperM 2025-10-18 02:32:33 +02:00
Vxrtrauter 10c935e852 fix tracker.py to handle m0nkrus scraper for downloads 2025-10-18 02:31:00 +02:00
Vxrtrauter bd8320a26c improve monkrus scraper for more results 2025-10-18 02:25:15 +02:00
Vxrtrauter c99ce339e0 fully impl. monkrus scraper (+ add search logic to scraper) 2025-10-18 01:49:00 +02:00
Vxrtrauter 1822a150d7 finnish monkrus scraper (probably) 2025-10-18 01:33:12 +02:00
Vxrtrauter 7e5e3033e6 add scraping logic 2025-10-18 01:22:11 +02:00
Vxrtrauter 1cab671a13 add more testing stuff 2025-10-18 01:08:36 +02:00
Vxrtrauter 5637e80657 added some more testing stuff 2025-10-17 21:23:17 +02:00
Vxrtrauter 2f78b812ba add besic scraping with message retrieving logic; still featuring full testing & debug outpus 2025-10-17 20:23:44 +02:00
10 changed files with 196 additions and 40 deletions
+15 -16
View File
@@ -25,14 +25,14 @@ jobs:
matrix:
include:
- os: ubuntu-latest
artifact_name: SoftwareManager-dev-${{ github.sha }}-linux
asset_name: SoftwareManager-dev-${{ github.sha }}-linux
artifact_name: SoftwareManager-dev-linux
asset_name: SoftwareManager-dev-linux
- os: windows-latest
artifact_name: SoftwareManager-dev-${{ github.sha }}-windows.exe
asset_name: SoftwareManager-dev-${{ github.sha }}-windows.exe
artifact_name: SoftwareManager-dev-windows.exe
asset_name: SoftwareManager-dev-windows.exe
- os: macos-latest
artifact_name: SoftwareManager-dev-${{ github.sha }}-macos
asset_name: SoftwareManager-dev-${{ github.sha }}-macos
artifact_name: SoftwareManager-dev-macos
asset_name: SoftwareManager-dev-macos
runs-on: ${{ matrix.os }}
@@ -121,23 +121,22 @@ jobs:
- name: Prepare release files
run: |
mkdir -p release
SHORT_SHA="${{ steps.version.outputs.short_sha }}"
cp artifacts/ubuntu-latest-build/SoftwareManager-dev-*-linux release/SoftwareManager-dev-${SHORT_SHA}-linux
cp artifacts/windows-latest-build/SoftwareManager-dev-*-windows.exe release/SoftwareManager-dev-${SHORT_SHA}-windows.exe
cp artifacts/macos-latest-build/SoftwareManager-dev-*-macos release/SoftwareManager-dev-${SHORT_SHA}-macos
chmod +x release/SoftwareManager-dev-*-linux release/SoftwareManager-dev-*-macos
cp artifacts/ubuntu-latest-build/SoftwareManager-dev-linux release/SoftwareManager-dev-linux
cp artifacts/windows-latest-build/SoftwareManager-dev-windows.exe release/SoftwareManager-dev-windows.exe
cp artifacts/macos-latest-build/SoftwareManager-dev-macos release/SoftwareManager-dev-macos
chmod +x release/SoftwareManager-dev-linux release/SoftwareManager-dev-macos
ls -la release/
- name: Create Prerelease (Public)
- name: Create Release (Public)
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}
draft: false
prerelease: true
prerelease: false
files: |
release/SoftwareManager-dev-${{ steps.version.outputs.short_sha }}-linux
release/SoftwareManager-dev-${{ steps.version.outputs.short_sha }}-windows.exe
release/SoftwareManager-dev-${{ steps.version.outputs.short_sha }}-macos
release/SoftwareManager-dev-linux
release/SoftwareManager-dev-windows.exe
release/SoftwareManager-dev-macos
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+41
View File
@@ -0,0 +1,41 @@
from bs4 import BeautifulSoup
import requests
def scrape_monkrus_telegram(query):
post = 100
max_posts = 250
posts: list[dict] = []
added = set()
while post <= max_posts:
url = f"https://t.me/s/real_monkrus/{post}"
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
bubbles = soup.find_all("div", class_="tgme_widget_message_bubble")
if not bubbles:
break
for bubble in bubbles:
post_txt = bubble.find("div", class_="tgme_widget_message_text js-message_text")
if not post_txt or not post_txt.b:
continue
title = post_txt.b.text
link = bubble.find("a", href=lambda x: x and x.startswith("https://uztracker.net"))
if query.lower() in title.lower() and link:
post_url = link["href"]
if post_url not in added:
added.add(post_url)
posts.append(dict(
author="m0nkrus",
id=len(posts) + 1,
title=title,
url=post_url
))
post += 22
posts.reverse()
return(posts)
+44 -4
View File
@@ -14,26 +14,67 @@ from PySide6.QtWidgets import (
QTabWidget,
QProgressBar,
QHeaderView,
QMessageBox,
)
from PySide6.QtGui import QIcon, QAction, QCloseEvent
import darkdetect
import threading
import platform
import requests as r
import os
import subprocess
import time
import sys
from core.utils.config.settings import save_settings
from core.utils.general.wrappers import run_thread
from core.utils.data.state import state
from core.utils.network.download import download_selected
from core.utils.network.update_checker import check_for_updates
from core.utils.general.shutdown import closehelper
from core.interface.utils.tabhelper import create_tab
from core.interface.utils.searchhelper import return_pressed
from core.interface.dialogs.settings import settings_dialog
from core.network.aria2_integration import dlprogress
def download_update(latest_version):
filename = "SoftwareManager-dev-windows.exe"
url = "https://github.com/KeksPirates/SoftwareManager/releases/latest/download/SoftwareManager-dev-windows.exe"
print("Downloading update...")
if os.path.exists(filename):
os.remove(filename)
response = r.get(url, allow_redirects=True)
with open(filename, "wb") as f:
f.write(response.content)
if not os.path.exists(filename):
raise FileNotFoundError(f"Executable not found")
subprocess.Popen([filename], shell=True)
time.sleep(0.5)
save_settings(version=latest_version)
sys.exit(0)
class MainWindow(QtWidgets.QMainWindow, QWidget):
def __init__(self):
super().__init__()
searchresults = []
# Check for updates on Windows
if platform.system() == "Windows":
result = check_for_updates()
assets, latest_version = result
if assets:
msg = QMessageBox()
msg.setIcon(QMessageBox.Information)
msg.setWindowTitle("Update Available")
msg.setText(f"A new version is available.")
msg.setInformativeText("Please visit the GitHub releases page to download the latest version.")
msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Ignore)
response = msg.exec_()
if response == QMessageBox.Ok:
download_update(latest_version)
self.setWindowTitle("Software Manager")
self.setGeometry(100, 100, 800, 600)
@@ -139,14 +180,13 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
toolbar.setLayoutDirection(Qt.RightToLeft)
self.tracker_list = QComboBox()
self.tracker_list.addItems(["rutracker", "uztracker"])
self.tracker_list.addItems(["rutracker", "uztracker", "m0nkrus"])
self.tracker_list.activated.connect(self.set_tracker)
if darkdetect.isDark():
settings_action = QAction(QIcon("core/interface/assets/settings_dark.png"), "Settings", self)
settings_action = QAction(QIcon("core/interface/assets/settings_white.png"), "Settings", self)
else:
settings_action = QAction(QIcon("core/interface/assets/settings.png"), "Settings", self)
settings_action = QAction(QIcon("core/interface/assets/settings_black.png"), "Settings", self)
settings_action.triggered.connect(lambda: settings_dialog(self))
toolbar.addAction(settings_action)
+18 -2
View File
@@ -1,6 +1,6 @@
import asyncio
from core.data.scrapers.uztracker import scrape_uztracker
from core.data.scrapers.rutracker import scrape_rutracker
from core.data.scrapers.monkrus import scrape_monkrus_telegram
from core.utils.network.jsonhandler import split_data, format_data
from core.utils.data.state import state
@@ -55,4 +55,20 @@ def return_pressed(self):
if state.debug:
print(f"No response from rutracker")
self.softwareList.clear()
self.show_empty_results(True)
self.show_empty_results(True)
elif state.tracker == "m0nkrus":
state.posts = scrape_monkrus_telegram(search_text)
if state.posts == []:
if state.debug:
print(f"No Results for {search_text}")
self.softwareList.clear()
self.show_empty_results(True)
else:
state.post_titles, _, state.post_author = format_data(state.posts)
self.show_empty_results(False)
self.post_author_list.clear()
self.post_author_list.addItems(state.post_author)
self.softwareList.clear()
self.softwareList.addItems(state.post_titles)
+3 -3
View File
@@ -3,11 +3,11 @@ import platform
import configparser
from core.utils.data.state import state
def create_config():
config = configparser.ConfigParser()
config["General"] = {"debug": True, "api_url": f"{state.api_url}", "aria2_threads": f"{state.aria2_threads}", "download_path": f"{state.download_path}", f"speed_limit": f"{state.speed_limit}"}
config["General"] = {"debug": True, "api_url": f"{state.api_url}", "aria2_threads": f"{state.aria2_threads}", "download_path": f"{state.download_path}", f"speed_limit": f"{state.speed_limit}",
"version": f"{state.version}"}
if platform.system() == "Windows":
config_dir = os.environ.get("APPDATA", os.path.expanduser("~\\AppData\\Roaming"))
@@ -42,4 +42,4 @@ def read_config():
state.aria2_threads = config.getint("General", "aria2_threads")
state.download_path = config.get("General", "download_path")
state.speed_limit = config.getint("General", "speed_limit")
state.version = config.get("General", "version")
+38 -11
View File
@@ -5,18 +5,45 @@ def restart_aria2c():
import main # had to do this because of circle import :(
import signal
import atexit
main.kill_aria2server()
state.aria2process.wait()
state.aria2process = main.run_aria2server()
signal.signal(signal.SIGINT, main.keyboardinterrupthandler)
atexit.unregister(main.kill_aria2server)
atexit.register(main.kill_aria2server)
import time
def save_settings(thread_count, close, apiurl, download_path, speed_limit):
state.aria2_threads = thread_count
state.api_url = apiurl
state.download_path = download_path
state.speed_limit = speed_limit
try:
main.kill_aria2server()
except Exception as e:
print(f"Warning: aria2server kill failed: {e}")
try:
if state.aria2process:
state.aria2process.wait(timeout=3)
except Exception as e:
print(f"Warning: aria2process wait failed: {e}")
time.sleep(0.5)
try:
state.aria2process = main.run_aria2server()
except Exception as e:
print(f"Error: failed to restart aria2server: {e}")
return
try:
signal.signal(signal.SIGINT, main.keyboardinterrupthandler)
atexit.unregister(main.kill_aria2server)
atexit.register(main.kill_aria2server)
except Exception as e:
print(f"Warning: signal/atexit setup failed: {e}")
def save_settings(thread_count=None, close=lambda: None, apiurl=None, download_path=None, speed_limit=None, version=None):
if thread_count is not None:
state.aria2_threads = thread_count
if apiurl is not None:
state.api_url = apiurl
if download_path is not None:
state.download_path = download_path
if speed_limit is not None:
state.speed_limit = speed_limit
if version is not None:
state.version = version
create_config()
restart_aria2c()
+2 -1
View File
@@ -9,6 +9,7 @@ class AppState:
post_urls: List[str]
post_author: List[str]
downloads: List[str]
version: str
debug: bool = False
tracker: str = "rutracker"
api_url: str = "https://api.michijackson.xyz"
@@ -19,4 +20,4 @@ class AppState:
aria2p: Any = None
aria2_threads: int = 4
state = AppState(posts=[], post_titles=[], post_urls=[], post_author=[], downloads=[], download_path="")
state = AppState(posts=[], post_titles=[], post_urls=[], post_author=[], downloads=[], download_path="", version="")
+6
View File
@@ -19,6 +19,12 @@ def get_item_url(item, posts, post_titles): # softwarelist currentitem, post lis
if state.debug:
print("Found post URL: ", post_links[0])
return post_links[0]
if state.tracker == "m0nkrus":
item_dict = posts[post_index]
_, post_links, _ = format_data([item_dict])
if state.debug:
print("Found post URL: ", post_links[0])
return post_links[0]
return None
+28
View File
@@ -0,0 +1,28 @@
import requests
from core.utils.data.state import state
def check_for_updates():
url = f"https://api.github.com/repos/KeksPirates/SoftwareManager/releases"
response = requests.get(url)
if response.status_code != 200:
print(f"Failed to fetch releases: {response.status_code}")
exit(1)
releases = response.json()
releases.sort(key=lambda r: r["published_at"], reverse=True)
latest_release = releases[0]
latest_version = latest_release["name"]
assets = latest_release["assets"]
if latest_version != state.version:
print(f"New release available: {latest_version}")
if assets:
print("Assets:")
for asset in assets:
print(f" - {asset['name']}: {asset['browser_download_url']}")
return assets, latest_version
else:
print("Already up-to-date.")
return None, None
+1 -3
View File
@@ -2,7 +2,7 @@ from core.interface.gui import MainWindow
from core.utils.data.state import state
from core.network.aria2_integration import aria2server
from core.network.aria2_integration import send_notification
from core.utils.general.shutdown import kill_aria2server, closehelper, shutdown_event
from core.utils.general.shutdown import closehelper, shutdown_event
from core.utils.general.wrappers import run_thread
from core.utils.config.config import read_config
from PySide6 import QtWidgets
@@ -14,12 +14,10 @@ import argparse
import sys
parser = argparse.ArgumentParser()
parser.add_argument("--debug", action="store_true")
args = parser.parse_args()
def run_gui():
app = QtWidgets.QApplication([])
if darkdetect.isDark: