Move completed torrents in rTorrent according to label

1,823

Solution 1

The ruT label is in custom1 if I remember right, just use $d.custom1= at the proper place in the completion event handler.

And BTW, move_complete is a mere identifier, event.download.finished is what you'll find in the source.

Solution 2

The following is a quote from this blog:

# Add new method to get finished dir
system.method.insert = d.get_finished_dir,simple,"cat=[folder]/finished/,$d.get_custom1="
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_finished_dir=;execute=mkdir,-p,$d.get_finished_dir=;execute=mv,-u,$d.get_base_path=,$d.get_finished_dir="`

The first line, the system.method.insert thing, basically says that each torrent should be able to return a string which is the concatenation of [folder]/finished/ and the torrent's label. So a torrent with the label tvshows will return [folder]/finished/tvshows. Change the first part to whatever you want your base "finished torrents" directory to be. I haven't tried this with any directories containing spaces, but I’m guessing escaping would be the way to go.

The second line basically says that the torrent should set its internally defined directory to whatever get_finished_dir returns, then create the directory if it doesn’t already exist, and finally move the torrent to the same directory.

Torrents without labels will be placed in the base dir.

Torrents with labels corresponding to already existing folders will be moved to those folders.

Torrents with labels corresponding to folders that don’t already exist will have the folder created for them, then they’ll be moved to that folder.

I'd like to point out that it is crucial to DISABLE Autotools AutoMove feature while using this technique. If you do not disable AutoMove, it will cause an error "Download registered as completed, but hash check returned unfinished chunks.", you will in fact be having two copies of your file (non-deterministic, just a logic link to a file can be created) in [folder]/finished/LABEL_NAME and in wherever you set in AutoMove. This will also cause rTorrent not to be able to seed those files and torrents will be marked as stopped/paused and if you resume the download it will be downloaded all over AGAIN to [folder]/finished/LABEL_NAME directory.

Share:
1,823

Related videos on Youtube

paullb
Author by

paullb

Updated on September 18, 2022

Comments

  • paullb
    paullb almost 2 years

    What tool (Windows or Mac) do you like for making web sitemaps (something along the lines of this - without the colours) http://www.avermedia.com/AVerTV/Upload/SpecialPagePic/sitemap.gif)

    • Asmor
      Asmor about 10 years
      I've even checked out the source for rTorrent and libtorrent and grepped for "move_complete", and found nothing. What the heck?
    • Anthon
      Anthon about 10 years
      If it is not in the source, you could put it in, or write a script that observes (new) files to appear in the output directory and move them according to the label information (which you might e.g. get from the torrent log file if not part of the filename).
  • Csharpz
    Csharpz over 9 years
    Could you describe the "use $d.custom1= at the proper place in the completion event handler" process more?