Minor Fix

Signed-off-by: anas <e.anastayyar@gmail.com>
This commit is contained in:
anas 2021-08-28 19:01:22 +03:00
parent eb518d40c5
commit 8c87fa1999
4 changed files with 11 additions and 6 deletions

View File

@ -43,8 +43,8 @@ load_dotenv('config.env')
alive = subprocess.Popen(["python3", "alive.py"])
subprocess.run(["mkdir", "-p", "./.config/qBittorrent"])
subprocess.run(["cp", "qBittorrent.conf", "./.config/qBittorrent/qBittorrent.conf"])
subprocess.run(["mkdir", "-p", ".config/qBittorrent"])
subprocess.run(["cp", "qBittorrent.conf", ".config/qBittorrent/qBittorrent.conf"])
subprocess.run(["qbittorrent-nox", "-d"])
Interval = []

View File

@ -90,9 +90,8 @@ class qbittorrent:
try:
tor_info = tor_info[0]
if tor_info.state == "metaDL" or tor_info.state == "checkingResumeData":
time.sleep(0.5)
time.sleep(1)
else:
time.sleep(2)
deleteMessage(listener.bot, meta)
break
except:
@ -140,6 +139,7 @@ class qbittorrent:
self.stalled_time = time.time()
if time.time() - self.meta_time >= 999999999: # timeout while downloading metadata
self.client.torrents_pause(torrent_hashes=self.ext_hash)
time.sleep(0.3)
self.listener.onDownloadError("Dead Torrent!")
self.client.torrents_delete(torrent_hashes=self.ext_hash)
self.client.auth_log_out()
@ -159,6 +159,7 @@ class qbittorrent:
self.checked = True
if result:
self.client.torrents_pause(torrent_hashes=self.ext_hash)
time.sleep(0.3)
self.listener.onDownloadError(f"{mssg}.\nYour File/Folder size is {get_readable_file_size(size)}")
self.client.torrents_delete(torrent_hashes=self.ext_hash)
self.client.auth_log_out()
@ -167,6 +168,7 @@ class qbittorrent:
elif tor_info.state == "stalledDL":
if time.time() - self.stalled_time >= 999999999: # timeout after downloading metadata
self.client.torrents_pause(torrent_hashes=self.ext_hash)
time.sleep(0.3)
self.listener.onDownloadError("Dead Torrent!")
self.client.torrents_delete(torrent_hashes=self.ext_hash)
self.client.auth_log_out()
@ -174,7 +176,8 @@ class qbittorrent:
return
elif tor_info.state == "error":
self.client.torrents_pause(torrent_hashes=self.ext_hash)
self.listener.onDownloadError("Error. IDK why, report in @SlamBugReport")
time.sleep(0.3)
self.listener.onDownloadError("No enough space for this torrent on device")
self.client.torrents_delete(torrent_hashes=self.ext_hash)
self.client.auth_log_out()
self.updater.cancel()

View File

@ -5,6 +5,7 @@
from bot import DOWNLOAD_DIR, LOGGER, get_client
from bot.helper.ext_utils.bot_utils import MirrorStatus, get_readable_file_size, get_readable_time
from .status import Status
from time import sleep
class QbDownloadStatus(Status):
@ -78,5 +79,6 @@ class QbDownloadStatus(Status):
def cancel_download(self):
LOGGER.info(f"Cancelling Download: {self.name()}")
self.client.torrents_pause(torrent_hashes=self.__hash)
sleep(0.3)
self.listener.onDownloadError('Download stopped by user!')
self.client.torrents_delete(torrent_hashes=self.__hash)

View File

@ -41,7 +41,7 @@ Downloads\UseIncompleteExtension=true
Queueing\IgnoreSlowTorrents=true
Queueing\MaxActiveDownloads=50
Queueing\MaxActiveTorrents=100
Queueing\QueueingEnabled=true
Queueing\QueueingEnabled=false
WebUI\CSRFProtection=true
WebUI\ClickjackingProtection=true
WebUI\HTTPS\Enabled=false