mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
fixed error messages spamming in console + added debug messages
This commit is contained in:
@@ -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="")
|
||||
|
||||
@@ -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:'))
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user