diff --git a/core/downloading/aria2p_server.py b/core/downloading/aria2p_server.py new file mode 100644 index 0000000..01b513c --- /dev/null +++ b/core/downloading/aria2p_server.py @@ -0,0 +1,21 @@ +import aria2p +import os +import subprocess + + +def run_aria2p(): + + aria2 = aria2p.API( + aria2p.Client( + host="http://localhost", + port=6800, + secret="" + ) + ) + + + downloads_dir = os.path.join(os.path.expanduser("~"), "Downloads") + subprocess.Popen(["aria2c", "--enable-rpc", "--rpc-listen-all=true", f"--dir={downloads_dir}"]) + + + return aria2 \ No newline at end of file diff --git a/core/downloading/download.py b/core/downloading/download.py new file mode 100644 index 0000000..0e9bdc2 --- /dev/null +++ b/core/downloading/download.py @@ -0,0 +1,19 @@ +from .aria2p_server import run_aria2p +import aria2p +import subprocess +import os +# from .scraper import uri +def start_client(): + global aria2 + aria2 = run_aria2p() + +def add_magnet(uri): + aria2.add_magnet(uri) + + +def terminate(): + return + + + +