mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
refactor: get_magnet to get_download_link
Rename scraper method get_magnet -> get_download_link in monkrus, rutracker and uztracker. Update downloader code to call .get_download_link and use the .is_magnet flag on tracker objects (replace dict access). Switch direct_download package imports to absolute paths and perform a small import reorder in direct_download/utils.py. These changes unify the download API and adapt call sites to the new tracker interface.
This commit is contained in:
@@ -31,9 +31,9 @@ def download_selected(items: list[QTableWidgetItem]):
|
||||
run_thread(threading.Thread(target=run_download, args=(post,)))
|
||||
|
||||
def run_download(post, headers: Optional[dict] = None):
|
||||
linkfunc = state.trackers[state.currenttracker]["linkFunc"]
|
||||
ismagnet = state.trackers[state.currenttracker]["isMagnet"]
|
||||
result = linkfunc(post)
|
||||
link_method = state.trackers[state.currenttracker].get_download_link
|
||||
ismagnet = state.trackers[state.currenttracker].is_magnet
|
||||
result = link_method(post)
|
||||
|
||||
if ismagnet:
|
||||
link = result
|
||||
|
||||
Reference in New Issue
Block a user