Page 1 of 1

Problem with mass adding my torrents in Deluge

Posted: Fri Sep 20, 2019 8:19 pm
by death_is_invtbl
hi guys,

I need to add ±10 000 000 000 torrents and:

1) I have .torrent files in folders and need to open it in deluge
2) after that I need to select the folder to download (this will be the file location folder)

I'm tryin to do it:

find /media/username/DISK02/folder1/ -type f -name "*.torrent" -exec bash -c 'deluge-console \'add -p \"$(dirname "{}")\" \""{}"\"\'' \;

but it is not workin', please, help :oops:

Re: Problem with mass adding my torrents in Deluge

Posted: Sat Sep 21, 2019 12:05 am
by mhertz
That's a lot of torrents there, lol! :) Anyway, the closest I've come is the following, but won't work if having spaces in the directory-names, because deluge-console, as far as I could test, doesn't support adding download-path with spaces from command-line(I tried without 'find' too and by itself in various quote/backslash variations):

Code: Select all

find /media/username/DISK02/folder1/ -type f -name "*.torrent" -exec bash -c 'deluge-console add --path "$(dirname "{}")" "{}"' \;

Re: Problem with mass adding my torrents in Deluge

Posted: Sat Sep 21, 2019 2:13 pm
by mhertz
Sorry, had another go at it and deluge-console does in fact support spaces, and I believe the following works now, as it did with a couple of tests I made with both dirs and torrents with and without spaces in there names:

Code: Select all

find /media/username/DISK02/folder1/ -type f -name "*.torrent" -exec bash -c 'deluge-console "add -p \"$(dirname "{}")\" \"{}\""' \;

Re: Problem with mass adding my torrents in Deluge

Posted: Sun Sep 22, 2019 6:55 pm
by death_is_invtbl
mhertz wrote:Sorry, had another go at it and deluge-console does in fact support spaces, and I believe the following works now, as it did with a couple of tests I made with both dirs and torrents with and without spaces in there names:

Code: Select all

find /media/username/DISK02/folder1/ -type f -name "*.torrent" -exec bash -c 'deluge-console "add -p \"$(dirname "{}")\" \"{}\""' \;


is not working :(

Re: Problem with mass adding my torrents in Deluge

Posted: Sun Sep 22, 2019 8:10 pm
by mhertz
What exactly is the error? I just tried it again where I made two dirs, one with a dirname with spaces and a torrent inside without spaces, and another dir without spaces and a torrent inside with spaces, to cover everything pretty much i'd presume, and here's a screenshot of it working:
screenshot.png
screenshot.png (196.84 KiB) Viewed 818 times

I renamed an arch and a debian iso torrent so that is why the downloaded content is named like that, and I only changed the source-dir for 'find' from yours to mine i.e. '~/Downloads'.

Also, the screenshot is in zsh shell, which shouldn't matter since using bash as shell for the 'find' command output, but I also rerun it in bash afterwards with same result.)