Ubuntu – How to download multiple torrent links using transmission-daemon

bittorrentcommand lineservertransmission

I am using transmission-daemon on my server with the WEB GUI.
I was wondering if instead of each time clicking add torrent then paste the magnet link, I could instead call it in the terminal (SSH) with a command with a file (like for example with wget) then it will download the torrents which links are in the file.

Best Answer

This will do the job.

For .torrent files:

First, you need to upload the .torrent files to a directory on your server. Then, please follow the steps below:

  • Open a terminal and make sure you cd to the directory containing the .torrent files.

  • To add a single .torrent file to transmission-daemon, please run the following command in the terminal:

transmission-remote -n 'transmission:transmission' -a torrent_file_name.torrent
  • To add all .torrent files in the directory to transmission-daemon, please run the following command in the terminal:
find . -maxdepth 1 -type f -name '*.torrent' -exec transmission-remote -n 'transmission:transmission' -a {} \;

For magnet URLs:

  • Create a file and name it magnet.links and add the magnet URLs one per line to the file. Please avoid crating any blank lines. Add the first link in the first line and then press Enter then add the second link in the second line and so on. Do not press Enter after the last line, just save the file and exit.

  • Open a terminal and cd to the directory that contains the magnet.links file.

  • Copy and paste the following code in the terminal and press Enter:

file="magnet.links"
while IFS= read -r line
do
transmission-remote -n 'transmission:transmission' -a $line
done <"$file"
Related Question