Closed malef1k closed 3 years ago
Нужно отлаживать. Но есть подозрение, что не в том месте передаётся параметр savepath
: здесь https://github.com/idlesign/torrt/blob/master/torrt/rpc/qbittorrent.py#L180 он передаётся с блоке файлов, можно попробовать
заменить метод на
def method_add_torrent(self, torrent: TorrentData, download_to: str = None, params: dict = None) -> Any:
file_data = {'torrents': torrent.raw}
params = None
if download_to is not None:
params = {'data':{'savepath': download_to}}
return self.auth_query(self.build_params(action='add_torrent', params), file_data)
Заменил
Вот что получил в логах
Traceback (most recent call last):
File "/var/packages/py3k/target/usr/local/bin/torrt", line 8, in
Ошибка в последней строке. Пробуем:
return self.auth_query(self.build_params(action='add_torrent', params=params), file_data)
Спасибо, добавил торрент с параметром -d "путь". Никаких ошибой не вылезло. Посмотрим что будет при обновлении, но по идеет все должно быть ок.
Выпустил 0.16.3 с этим исправлением. Задачу закрываю.
Используется qbittorrent 4.3.3 docker. Торренты без параметра -d добавляются нормально, но при использовании параметра -d или при их обновлении возникает ошибка.
Вот логи. П.С. Если что-то сделал не так, прошу сильно не ругать, я тут новичек.
~# /var/packages/py3k/target/usr/local/bin/torrt walk --verbose DEBUG: Bootstrapping torrt environment ... DEBUG: Importing rpc ... DEBUG: Registering
deluge
from <class 'torrt.rpc.deluge.DelugeRPC'> ... DEBUG: Registeringqbittorrent
from <class 'torrt.rpc.qbittorrent.QBittorrentRPC'> ... DEBUG: Registeringtransmission
from <class 'torrt.rpc.transmission.TransmissionRPC'> ... DEBUG: Registeringutorrent
from <class 'torrt.rpc.utorrent.UTorrentRPC'> ... DEBUG: Importing trackers ... DEBUG: Registeringtr.anidub.com
from <class 'torrt.trackers.anidub.AniDUBTracker'> ... DEBUG: Registeringanilibria.tv
from <class 'torrt.trackers.anilibria.AnilibriaTracker'> ... DEBUG: Registeringcasstudio.tv
from <class 'torrt.trackers.casstudio.CasstudioTracker'> ... DEBUG: Registeringeniahd.com
from <class 'torrt.trackers.eniahd.EniaHDTracker'> ... DEBUG: Registeringkinozal.tv
from <class 'torrt.trackers.kinozal.KinozalTracker'> ... DEBUG: Registeringnnm-club.me
from <class 'torrt.trackers.nnmclub.NNMClubTracker'> ... DEBUG: Registeringrutor.org
from <class 'torrt.trackers.rutor.RutorTracker'> ... DEBUG: Registeringrutracker.org
from <class 'torrt.trackers.rutracker.RuTrackerTracker'> ... DEBUG: Importing notifiers ... DEBUG: Registeringemail
from <class 'torrt.notifiers.mail.EmailNotifier'> ... DEBUG: Registeringtelegram
from <class 'torrt.notifiers.telegram.TelegramNotifier'> ... DEBUG: Importing bots ... DEBUG: Registeringtelegram
from <class 'torrt.bots.telegram_bot.TelegramBot'> ... DEBUG: Initializing objects registries from configuration file ... DEBUG: Loading configuration file /root/.torrt/config.json ... DEBUG: SpawningQBittorrentRPC
object with the given settings ... DEBUG: Registeringqbittorrent
from qbittorrent ... DEBUG: SpawningEmailNotifier
object with the given settings ... DEBUG: Registeringemail
from email ... DEBUG: SpawningAnilibriaTracker
object with the given settings ... DEBUG: Registeringanilibria.tv
from anilibria.tv ... DEBUG: SpawningKinozalTracker
object with the given settings ... DEBUG: Registeringkinozal.tv
from kinozal.tv ... DEBUG: SpawningRutorTracker
object with the given settings ... DEBUG: Registeringrutor.org
from rutor.org ... DEBUG: SpawningRuTrackerTracker
object with the given settings ... DEBUG: Registeringrutracker.org
from rutracker.org ... INFO: Torrent walk is triggered DEBUG: Loading configuration file /root/.torrt/config.json ... INFO: Torrent walk is started INFO: Getting torrents fromqbittorrent
... DEBUG: QBittorrentRPC: RPC actionlogin
... DEBUG: Fetching http://127.0.0.1:8085/api/v2/auth/login ... DEBUG: Starting new HTTP connection (1): 127.0.0.1:8085 DEBUG: http://127.0.0.1:8085 "POST /api/v2/auth/login HTTP/1.1" 200 3 DEBUG: QBittorrentRPC: RPC actionget_torrents
... DEBUG: Fetching http://127.0.0.1:8085/api/v2/torrents/info ... DEBUG: http://127.0.0.1:8085 "GET /api/v2/torrents/info HTTP/1.1" 200 1529 DEBUG: QBittorrentRPC: RPC actionget_torrent
... DEBUG: Fetching http://127.0.0.1:8085/api/v2/torrents/properties ... DEBUG: http://127.0.0.1:8085 "POST /api/v2/torrents/properties HTTP/1.1" 200 795 INFO: ProcessingFoundation.S01.WEB-DL.720p.Rus.Eng
... DEBUG: Downloading torrent file fromhttps://rutracker.org/forum/viewtopic.php?t=6114289
... DEBUG: RuTrackerTracker: Picking a mirror ... DEBUG: RuTrackerTracker: Probing mirror:https://rutracker.org
... DEBUG: Fetching https://rutracker.org ... DEBUG: Starting new HTTPS connection (1): rutracker.org:443 DEBUG: https://rutracker.org:443 "GET / HTTP/1.1" 301 162 DEBUG: https://rutracker.org:443 "GET /forum/index.php HTTP/1.1" 200 None DEBUG: Fetching https://rutracker.org/forum/viewtopic.php?t=6114289 ... DEBUG: https://rutracker.org:443 "GET /forum/viewtopic.php?t=6114289 HTTP/1.1" 200 None DEBUG: RuTrackerTracker: Torrent download link found: https://rutracker.org/forum/dl.php?t=6114289 DEBUG: RuTrackerTracker: Downloading torrent file from https://rutracker.org/forum/dl.php?t=6114289 ... DEBUG: Fetching https://rutracker.org/forum/dl.php?t=6114289 ... DEBUG: https://rutracker.org:443 "GET /forum/dl.php?t=6114289 HTTP/1.1" 200 23209 DEBUG: Torrent was downloaded fromhttps://rutracker.org/forum/viewtopic.php?t=6114289
DEBUG: Update is available DEBUG: QBittorrentRPC: RPC actionadd_torrent
... DEBUG: Fetching http://127.0.0.1:8085/api/v2/torrents/add ... DEBUG: http://127.0.0.1:8085 "POST /api/v2/torrents/add HTTP/1.1" 415 46 ERROR: QBittorrentRPC: Failed to query RPChttp://127.0.0.1:8085/api/v2/torrents/add
: Error: 'savepath' is not a valid torrent file. ERROR: QBittorrentRPC: Failed to query RPCadd_torrent
: Error: 'savepath' is not a valid torrent file. ERROR: Unable to replace torrent: Error: 'savepath' is not a valid torrent file. DEBUG: Loading configuration file /root/.torrt/config.json ... DEBUG: Saving configuration file /root/.torrt/config.json ... INFO: Torrent walk is finished