diff --git a/plugins/qbittorrent/conf/qb.conf b/plugins/qbittorrent/conf/qb.conf index 496d59f1d..65dd6dd0a 100755 --- a/plugins/qbittorrent/conf/qb.conf +++ b/plugins/qbittorrent/conf/qb.conf @@ -14,3 +14,9 @@ QB_PWD = adminadmin [file] FILE_TO=/www/tmp +FILE_OWN=www +FILE_GROUP=www + +[task] +TASK_RATE=4 +TASK_COMPLETED_RATE=10 \ No newline at end of file diff --git a/plugins/qbittorrent/workers/qbittorrent_worker.py b/plugins/qbittorrent/workers/qbittorrent_worker.py index ef2e24168..6a4d880d5 100755 --- a/plugins/qbittorrent/workers/qbittorrent_worker.py +++ b/plugins/qbittorrent/workers/qbittorrent_worker.py @@ -151,16 +151,20 @@ class downloadBT(Thread): def checkTask(self): while True: torrents = self.qb.torrents() - for torrent in torrents: - print torrent - print time.time(), "no task!" + tlen = len(torrents) + print "downloading torrents count:", tlen + if tlen > 0: + for torrent in torrents: + print torrent + else: + print time.time(), "no task!" time.sleep(10) def completed(self): while True: torrents = self.qb.torrents(filter='completed') tlen = len(torrents) - print "torrents count:", tlen + print "completed torrents count:", tlen if tlen > 0: for torrent in torrents: path = torrent['save_path'] + torrent['name'] @@ -183,8 +187,8 @@ if __name__ == "__main__": dl = downloadBT() import threading - # t = threading.Thread(target=dl.checkTask) - # t.start() + task = threading.Thread(target=dl.checkTask) + task.start() completed = threading.Thread(target=dl.completed) completed.start()