Ability to put magnet link in file for watchdir

Feature requests not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Ability to put magnet link in file for watchdir

Post by killemov »

Please add the ability to use magnet links with the watchdir. I would like to put the fully qualified magnet link in a .magnet file as text and then have transmission read the file and use the magnet link inside. ( mylink.magnet -> mylink.magnet.added )
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Ability to put magnet link in file for watchdir

Post by rb07 »

killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Ability to put magnet link in file for watchdir

Post by killemov »

Hey rb07, your script:

Code: Select all

#!/bin/bash
#
# Read the last line of file, and try to add it to transmission-daemon
# Assume transmission-remote is in the PATH.

FILE=magnets.txt
TR_OPTIONS="192.168.100.3 -n admn:psswrd --downlimit 500 --uplimit 50"

# Exit if there is no file
[ ! -f "magnets.txt" ] && exit

cat $FILE |
while read m
do
  transmission-remote $TR_OPTIONS --add "$m"
done

# Remove the file
rm $FILE
... should be considered a very good workaround. It still requires users to do something extra to what I would consider base functionality. Not to mention having to open the rpc port when you might not want that.
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Ability to put magnet link in file for watchdir

Post by rb07 »

That script can be modified to look for .magnet files, one magnet URL per file. I think that would be an improvement, and easy to do.

About opening the RPC port, the script usually runs on the same machine as the daemon, so you can close the port on the firewall; or the easy way: you can whitelist only localhost (which is the default); you can even enable authentication, transmission-remote has no problem with that, doesn't even have to have the user/password on the script.
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Ability to put magnet link in file for watchdir

Post by rb07 »

Related to this is today's change (the code is not yet available) to automatic: DNS forum and Main Page.

This is for RSS feeds, which is not the same, but similar. The author just added:
Feeds with Magnet URIs now work correctly with Automatic
sthuck
Posts: 1
Joined: Mon Oct 13, 2014 7:38 pm

Re: Ability to put magnet link in file for watchdir

Post by sthuck »

Since the ticket is a 'wontfix', I hope here is a good enough place to post this, in the hopes that other users who were led here by google will find it :D

I did a very small and hack-ish patch (so it may cause other issues!) to add the ability to open magnet links if they are saved in a '.magnet' file, one link per file.
it's here - http://pastebin.com/Pf7GStJn, works with version 2.84 sources. run patch with -p1 .
cfpp2p
Posts: 290
Joined: Sat Aug 08, 2009 3:14 pm

Re: Ability to put magnet link in file for watchdir

Post by cfpp2p »

sthuck's patch works good. I don't see any problems with it.

Thanks sthuck :D
killemov
Posts: 535
Joined: Sat Jul 31, 2010 5:04 pm

Re: Ability to put magnet link in file for watchdir

Post by killemov »

sthuck wrote:Since the ticket is a 'wontfix'
There, right there is where the problem with the dev team (or trac moderator) is.

Thanks sthuck!
troubleshooter3d
Posts: 1
Joined: Tue Mar 08, 2016 6:22 am

Re: Ability to put magnet link in file for watchdir

Post by troubleshooter3d »

I have adapted sthuck's patch to work with sources version 2.92. Looks like it behaves just fine. Tested with Cygwin build only, though. :)

Grab the diff there: http://pastebin.com/WSCXdQEx

Note that most of the watchdir logic has been moved from daemon to libtransmission in 2.9x versions.
Post Reply