From 6bb1224aa782bc9d3dc07e75c6acf8fc5efaf462 Mon Sep 17 00:00:00 2001 From: jaskaranSM Date: Wed, 18 Sep 2019 11:48:19 -0400 Subject: [PATCH] Specify Download Dir with RPC --- .gitignore | 1 + aria.bat | 2 +- aria.sh | 3 +-- bot/helper/ariaTools.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 871c328..fb55e72 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.env config.ini +*conf.ini *auth_token.txt *.pyc downloads/* diff --git a/aria.bat b/aria.bat index bb11741..3880800 100644 --- a/aria.bat +++ b/aria.bat @@ -1 +1 @@ -aria2c --dir ./download --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --max-connection-per-server=10 --rpc-max-request-size=1024M --seed-time=0.01 --min-split-size=10M --follow-torrent=mem --split=10 --daemon=true --allow-overwrite=true +aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --max-connection-per-server=10 --rpc-max-request-size=1024M --seed-time=0.01 --min-split-size=10M --follow-torrent=mem --split=10 --daemon=true --allow-overwrite=true diff --git a/aria.sh b/aria.sh index 4a6b8eb..3880800 100644 --- a/aria.sh +++ b/aria.sh @@ -1,2 +1 @@ -export DOWNLOAD_DIR="./download" -aria2c --dir $DOWNLOAD_DIR --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --max-connection-per-server=10 --rpc-max-request-size=1024M --seed-time=0.01 --min-split-size=10M --follow-torrent=mem --split=10 --daemon=true --allow-overwrite=true +aria2c --enable-rpc --rpc-listen-all=false --rpc-listen-port 6800 --max-connection-per-server=10 --rpc-max-request-size=1024M --seed-time=0.01 --min-split-size=10M --follow-torrent=mem --split=10 --daemon=true --allow-overwrite=true diff --git a/bot/helper/ariaTools.py b/bot/helper/ariaTools.py index 224b50a..0209c64 100644 --- a/bot/helper/ariaTools.py +++ b/bot/helper/ariaTools.py @@ -1,7 +1,7 @@ import aria2p import os from time import sleep -from bot import LOGGER +from bot import LOGGER,DOWNLOAD_DIR EDIT_SLEEP_TIME_OUT = 5 @@ -29,12 +29,12 @@ def check_metadata(gid): def add_download(link,message): if "magnet" in link: - download = aria2.add_magnet(link) + download = aria2.add_magnet(link,{'dir':DOWNLOAD_DIR}) allDls[message[0]] = [download,message[1]] LOGGER.info("Adding: "+link) return download else: - download = aria2.add_uris([link]) + download = aria2.add_uris([link],{'dir':DOWNLOAD_DIR}) allDls[message[0]] = [download,message[1]] LOGGER.info("Adding: "+link) return download