Problem with mass adding my torrents in Deluge

General support for problems installing or using Deluge
Post Reply
death_is_invtbl
New User
New User
Posts: 6
Joined: Fri Sep 20, 2019 8:12 pm

Problem with mass adding my torrents in Deluge

Post 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:
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Problem with mass adding my torrents in Deluge

Post 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 "{}")" "{}"' \;
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Problem with mass adding my torrents in Deluge

Post 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 "{}")\" \"{}\""' \;
death_is_invtbl
New User
New User
Posts: 6
Joined: Fri Sep 20, 2019 8:12 pm

Re: Problem with mass adding my torrents in Deluge

Post 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 :(
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Problem with mass adding my torrents in Deluge

Post 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 1829 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.)
Post Reply