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
Problem with mass adding my torrents in Deluge
-
- New User
- Posts: 6
- Joined: Fri Sep 20, 2019 8:12 pm
Re: Problem with mass adding my torrents in Deluge
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
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 "{}")\" \"{}\""' \;
-
- New User
- Posts: 6
- Joined: Fri Sep 20, 2019 8:12 pm
Re: Problem with mass adding my torrents in Deluge
is not workingmhertz 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 "{}")\" \"{}\""' \;
Re: Problem with mass adding my torrents in Deluge
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:
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.)
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.)