erengy / taiga

A lightweight anime tracker for Windows
https://taiga.moe
GNU General Public License v3.0
2.08k stars 222 forks source link

Torrent download via deluge console can't push to a NAS file path #709

Open Suddow opened 5 years ago

Suddow commented 5 years ago

I don't know how to troubleshoot it, but all I can say is that the torrent is not being generated on the deluge host on my NAS. It's a synology. Deluge ui/client is connected to the daemon on the NAS properly.

I think it must have something to do with the deluge-console.exe, and maybe it's unable to point to the real deluge client running on the NAS? I don't know if there's a different way to set this up, or even troubleshoot what's going wrong. I was hoping to have taiga point to the deluge app running on the NAS and download directly on the NAS, only using taiga and the deluge UI as a front-end on my PC.

Taiga properly detects files in NAS directories, but just can't download to them.

erengy commented 5 years ago

Let's try this:

  1. Run Taiga in debug mode.
  2. Reproduce the issue.
  3. Close Taiga and check out the Taiga.log file.

Near the end of the file, there should be a line that says Aggregator::HandleFeedDownloadOpen. The following lines will tell you about the application path and command-line parameters Taiga used to open the .torrent file. If they're correct, then the problem is with Deluge rather than Taiga.

Also see the previous issues for Deluge.

Suddow commented 5 years ago

Here's what I got

2018-10-08 17:37:14 [Debug] feed_aggregator.cpp:397 Aggregator::HandleFeedDownloadOpen | >>
Application: C:\Program Files (x86)\Deluge\deluge-console.exe
Parameters: add -p \"/downloads/downloading\Golden Kamuy\" \"C:\Users\directoryname\AppData\Roaming\Taiga\data\feed\bnlhYS5zaQ==\[HorribleSubs] Golden Kamuy - 13 [720p].mkv.torrent\"
2018-10-08 17:37:14 [Debug] http.cpp:461 taiga::HttpManager::FreeConnection | Connections for hostname is now 0: nyaa.si
2018-10-08 17:37:28 [Debug] timer.cpp:60 taiga::Timer::OnTimeout | ID: 1, Interval: 60
2018-10-08 17:38:28 [Debug] timer.cpp:60 taiga::Timer::OnTimeout | ID: 1, Interval: 60
2018-10-08 17:39:05 [Debug] action.cpp:51 ExecuteAction | Exit()
2018-10-08 17:39:05 [Debug] file_monitor.cpp:184 DirectoryMonitor::MonitorProc | Stopped monitoring.

I tried forward and backslash just in case

2018-10-08 17:41:53 [Debug] feed_aggregator.cpp:397 Aggregator::HandleFeedDownloadOpen | >>
Application: C:\Program Files (x86)\Deluge\deluge-console.exe
Parameters: add -p \"\downloads\downloading\Golden Kamuy\" 
\"C:\Users\directory\AppData\Roaming\Taiga\data\feed\bnlhYS5zaQ==\[HorribleSubs] Golden Kamuy - 13 [720p].mkv.torrent\"
2018-10-08 17:41:53 [Debug] http.cpp:461 taiga::HttpManager::FreeConnection | Connections for hostname is now 0: nyaa.si
2018-10-08 17:41:56 [Debug] action.cpp:51 ExecuteAction | Exit()
2018-10-08 17:41:56 [Debug] file_monitor.cpp:184 DirectoryMonitor::MonitorProc | Stopped monitoring.
2018-10-08 17:43:14 [Informational] taiga.cpp:75 taiga::App::InitInstance | Version 1.3.1 (2018-08-05)

I used /downloads/downloading as my path because that is the mount path for deluge on my NAS (https://i.imgur.com/wpGwtGY.png).

Tried both ways, slightly different log errors but neither would add a torrent to deluge.

Tried under local client with a network path to the NAS though, and that works:

Parameters: add -p \"\\Tartarus\anime\test\Golden Kamuy\" \"C:\Users\directory\AppData\Roaming\Taiga\data\feed\bnlhYS5zaQ==\[HorribleSubs] Golden Kamuy - 13 [720p].mkv.torrent\"
2018-10-08 17:44:21 [Debug] http.cpp:461 taiga::HttpManager::FreeConnection | Connections for hostname is now 0: nyaa.si
2018-10-08 17:44:36 [Debug] http.cpp:392 taiga::HttpManager::AddToQueue | ID: taiga-http-0000000006
2018-10-08 17:44:36 [Debug] http.cpp:431 taiga::HttpManager::ProcessQueue | Connections for hostname is now 1: nyaa.si
2018-10-08 17:44:36 [Debug] http.cpp:367 taiga::HttpManager::GetClient | >>
Reusing client with the ID: taiga-http-0000000005
Client's new ID: taiga-http-0000000006
2018-10-08 17:44:36 [Debug] http_request.cpp:40 base::http::Client::MakeRequest | ID: taiga-http-0000000006
2018-10-08 17:44:36 [Debug] http_request.cpp:101 base::http::Client::SetRequestOptions | URL: https://nyaa.si/download/1082330.torrent
2018-10-08 17:44:36 [Debug] http_callback.cpp:126 base::http::Client::DebugHandler | Found bundle for host nyaa.si: 0x5348080 [can pipeline]
2018-10-08 17:44:36 [Debug] http_callback.cpp:126 base::http::Client::DebugHandler | Re-using existing connection! (#0) with host nyaa.si
2018-10-08 17:44:36 [Debug] http_callback.cpp:126 base::http::Client::DebugHandler | Connected to nyaa.si (192.124.249.158) port 443 (#0)
2018-10-08 17:44:36 [Debug] http_callback.cpp:126 base::http::Client::DebugHandler | >>
=> Request header | GET /download/1082330.torrent HTTP/1.1
Host: nyaa.si
User-Agent: Taiga/1.3
Accept: application/x-bittorrent, */*

Seems like on the NAS path it times out right away. I'm guessing deluge console always treats the file path like a local filepath, maybe? I figure I might just have to settle for running taiga downloads off my PC and using the network path to the NAS. It seems like its probably due to deluge more than taiga to be honest. I noticed even though it wasn't making torrents, it was still making a directory on my c drive (C:\downloads\downloading\Golden Kamuy), so it's probably just the way deluge-console works.

That said, looking at their wiki https://i.imgur.com/jeqtn6F.png at https://dev.deluge-torrent.org/wiki/UserGuide/ThinClient#Console), it seems it may be possible if deluge console were connecting to to the NAS daemon, I think the arguments would need to be accessible through Taiga for that to be possible though. That's just my laymans understanding, but if deluge-console were connecting to the daemon and adding the torrent that way, I think it should be possible to have the torrent start on the NAS while using the gtk UI on a PC to connect to it. I need to figure out how to actually do these commands first before I can try testing it myself though.

Suddow commented 5 years ago

Instead of editing I'll just add this separately. I got it working with the commands I mentioned at the end of my post: https://i.imgur.com/hLdiwYY.png. Double-checking on my NAS, it is also working there.

I tried to blur out my name and password though. I think at this point for this to be fully supported under taiga, there needs to be a section in the Torrents category where we can add the NAS connection info and so it can pass those arguments in the parameter. Based on the layout of the arguments I don't think it should be too difficult because it seems like the biggest difference would be adding the ip, port, username and password before the "add" arguments:

Parameters: add -p \"\downloads\downloading\Golden Kamuy\" \"C:\Users\user\AppData\Roaming\Taiga\data\feed\bnlhYS5zaQ==\[HorribleSubs] Golden Kamuy - 13 [720p].mkv.torrent\"

to

Parameters: connect IP:PORT USERNAME PASSWORD ; add -p \"\downloads\downloading\Golden Kamuy\" \"C:\Users\user\AppData\Roaming\Taiga\data\feed\bnlhYS5zaQ==\[HorribleSubs] Golden Kamuy - 13 [720p].mkv.torrent\"

I've been trying but I can't get it to work with the path command yet, unfortunately. It always thinks /downloads/downloading should be c:/downloads/downloading, not sure how to get around that yet.