rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.07k stars 408 forks source link

Move if completed and delete data after delete torrent not working #1050

Open Sveeeeeen opened 3 years ago

Sveeeeeen commented 3 years ago

Hello, Is the wiki not up to date? https://github.com/rakshasa/rtorrent/wiki/Common-Tasks-in-rTorrent#move-completed-torrents-to-a-fixed-location

I want to move my torrents when finished to a different dir.

method.insert = cfg.download,           private|const|string, (cat,(cfg.basedir),"download/")
method.insert = cfg.download_complete,  private|const|string, (cat,(cfg.basedir),"complete/")

Downloads should go do download/ and after finished to complete/.

method.insert = d.get_finished_dir, simple, "cat=$cfg.download_complete,$d.custom1="
method.insert = d.get_data_full_path, simple, "branch=((d.is_multi_file)),((cat,(d.directory))),((cat,(d.directory),/,(d.name)))"
method.insert = d.move_to_complete, simple, "d.directory.set=$argument.1=; execute=mkdir,-p,$argument.1=; execute=mv,-f,$argument.0=,$argument.1=; d.save_full_session="
method.set_key = event.download.finished,move_complete,"d.move_to_complete=$d.data_path=,$d.get_finished_dir="

This should work right? I just replaced my path in the first line.

But rtorrent is not moving my files. I am doing something wrong?

Even when delte the torrent using ruTorrent the files are stil existing and are not deleted. method.set_key = event.download.erased,delete_erased,"execute=rm,-rf,--,$d.data_path="

I guess I am doing something terrible wrong. Please help me :D

pyroscope commented 3 years ago

$cfg.download_complete=, or use ().

Sveeeeeen commented 3 years ago

$cfg.download_complete=, or use ().

Thanks.

But it still does not work. rtorrent still not moving my files. Changed this line:

method.insert = d.get_finished_dir, simple, "cat=$cfg.download_complete=,$d.custom1="

Sveeeeeen commented 3 years ago

Ok for some reasons it is working now.

Just one problem. rTorrent is replacing slashes to "%2F". Example: download/LABEL/LABEL/MY_SHOW after download completed it look like this completed/LABEL%2FLABEL/MY_SHOW

Do I need to escape the slashes somehow?

pyroscope commented 3 years ago

no, rt does not, rut does. they are just stored that way (for no good reason).

Sveeeeeen commented 3 years ago

no, rt does not, rut does. they are just stored that way (for no good reason).

But the destination is correct and rt does move the folder. Why it should be the problem of rut?

topjes commented 2 years ago

Hi,

I had the same problem with "%2F" instead of subfolders. And I solved the problem.

I get out of the "autotools section" in rtorrent.rc completely So I commented with "#" all these lines

# method.insert = ... # method.insert = ... # method.insert = ... # method.set_key = ...

Then I used the rutorrent GUI Autotools plugin. And I configured there the watch directory and all the rest.

And NO MORE "%2F". Now everything works properly. Files are moved to proper subdirectories.

ahaghgoo commented 2 years ago

Hi, I'm also getting the "%2F" when files are moved from 'temp' download folder to 'completed' download folder. Is there a way to fix this without the use of AutoTools? Thanks!

kannibalox commented 2 years ago

rTorrent has nothing to do with %2F getting inserted, check your ruTorrent configuration and get support through their channels.

ahaghgoo commented 2 years ago

Are you sure about that? ruTorrent's AutoTools creates hard-linked files properly. I'm having trouble with the way rTorrent is moving completed files. Others have indicated that they experience the same thing. Why are you so sure that it's not the case?

Afshin Haghgoo @.***

On May 28, 2022, at 20:13, kannibalox @.***> wrote:

rTorrent has nothing to do with %2F getting inserted, check your ruTorrent configuration and get support through their channels.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

kannibalox commented 2 years ago

I am very sure about it, the root of the problem is that a URL-encoded value is getting stored in one of the custom variables, and then later move-on-completion scripts don't un-encode it. Custom values take whatever value is being sent, there's no way for rTorrent to silently URL encode it or anything.

$ rtxmlrpc d.custom1 4A1B0461E42B8BEF716EF869847259CEFD1B0FD1

$ rtxmlrpc d.custom1.set 4A1B0461E42B8BEF716EF869847259CEFD1B0FD1 "/tmp/test/path"
$ rtxmlrpc d.custom1 4A1B0461E42B8BEF716EF869847259CEFD1B0FD1
/tmp/test/path
$ rtxmlrpc d.custom1.set 4A1B0461E42B8BEF716EF869847259CEFD1B0FD1 "/tmp%2Ftest%2Fpath"
$ rtxmlrpc d.custom1 4A1B0461E42B8BEF716EF869847259CEFD1B0FD1
/tmp%2Ftest%2Fpath

So far everyone experiencing this issue has indicated they are using ruTorrent, and there are even several tickets about this issue in their tracker:

If you can provide steps to reproduce this issue with a new torrent on vanilla rTorrent (i.e. without ruTorrent installed), I'd be more than happy to test it out myself.

ahaghgoo commented 2 years ago

Ok this makes sense now. I'm using AutoTools' 'watch' folder to import torrents, and then using rtorrents' file management to move files upon completion. Thanks for clarifying this! -A

On May 29, 2022, at 5:10, kannibalox @.***> wrote:

I am very sure about it, the root of the problem is that a URL-encoded value is getting stored in one of the custom variables, and then later move-on-completion scripts don't un-encode it. Custom values take whatever value is being sent, there's no way for rTorrent to silently URL encode it or anything.

$ rtxmlrpc d.custom1 6A1B0461E42B8BEF716EF869844259CEFD1B0FD1

$ rtxmlrpc d.custom1.set 4A1B0461E42B8BEF716EF869847259CEFD1B0FD1 "/tmp/test/path"

$ rtxmlrpc d.custom1 4A1B0461E42B8BEF716EF869847259CEFD1B0FD1 /tmp/test/path

$ rtxmlrpc d.custom1.set 4A1B0461E42B8BEF716EF869847259CEFD1B0FD1 "/tmp%2Ftest%2Fpath"

$ rtxmlrpc d.custom1 4A1B0461E42B8BEF716EF869847259CEFD1B0FD1 /tmp%2Ftest%2Fpath So far everyone experiencing this issue has indicated they are using ruTorrent, and there are even several tickets about this issue in their tracker:

• Novik/ruTorrent#1439 • Novik/ruTorrent#913 If you can provide steps to reproduce this issue with a new torrent on vanilla rTorrent (i.e. without ruTorrent installed), I'd be more than happy to test it out myself.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

Jolly-Pirate commented 2 years ago

Fix for the problem https://github.com/Jolly-Pirate/rtorrent-snippets/tree/master/fix-urlencoded-label