fixed error messages spamming in console + added debug messages

This commit is contained in:
Vxrtrauter
2025-10-11 20:35:21 +02:00
parent e4c50e20df
commit a9450435d7
5 changed files with 13 additions and 9 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Optional, Any, List, Dict
from pathlib import Path
@@ -14,7 +14,7 @@ class AppState:
download_path: str = str(Path.home() / "Downloads")
speed_limit: int = 0
aria2process: Optional[Any] = None
aria2: Optional[Any] = None
aria2: list[Any] = field(default_factory=list)
aria2_threads: int = 4
state = AppState(posts=[], post_titles=[], post_urls=[], post_author=[], download_path="")
+1 -1
View File
@@ -21,7 +21,7 @@ def get_item_url(item, posts, post_titles): # oftwarelist currentitem, post list
def get_magnet_link(post_url):
try:
response = requests.get(post_url)
response = requests.get(post_url) # eventually impl. cloudscraper
response.raise_for_status()
soup = BeautifulSoup(response.text, 'html.parser')
magnet_link = soup.find('a', href=lambda x: x and x.startswith('magnet:'))
+2 -1
View File
@@ -7,8 +7,9 @@ def split_data(data):
posts = p_json["data"]
query = p_json["query"]
success = p_json["success"]
cached = p_json["cached"]
return count, posts, query, success
return count, posts, query, success, cached
def format_data(data):
post_author = [post["author"] for post in data]