RSS for transmission

Status
Not open for further replies.

FlyingPersian

Patron
Joined
Jan 27, 2014
Messages
237
Hi
Is there a possibility of getting RSS for the Transmission plugin? I have found a php installer, but it doesn't seem to work with the newest FreeNAS as the shell doesn't know the php command (see link below)

http://code.google.com/p/freenas-rss-extension/

Kind regards
 

mpfusion

Contributor
Joined
Jan 6, 2014
Messages
198
The mentioned plugin is for FreeNAS 0.7 and I'm not sure what it takes to port it to a current version. Depending on your needs a simple shell script might be sufficient if you just want to download the enclosures of some torrent feeds. This is the one I use:


Code:
#!/bin/sh
 
WGET='/usr/local/bin/wget --quiet --timeout=30 --timestamping'
FEEDLIST='/home/rss/download-rss/feeds/feeds'
OUTPUTDIR='/home/rss/download-rss/watch'
MAXFILES=5
 
# exit if not online
nc -z -w 5 google.com 80 2>/dev/null || exit 0
 
[ -r "$FEEDLIST"  ] || exit 1
[ -w "$OUTPUTDIR" ] || exit 2
 
while IFS='\n' read line ; do
  $WGET --output-document=- "$line" |
    sed -n  -e 's/.*url="\([^"]*\)\.torrent".*$/\1.torrent/p' 2>/dev/null |
      head -"$MAXFILES" |
        xargs $WGET --directory-prefix="$OUTPUTDIR"
done < "$FEEDLIST"
 
exit $?


It's located inside a standard jail. The file “feeds” contains the RSS feeds, one feed per line. It is a user dataset, mounted into the users home directory for simple adding/removal of feeds. The script downloads the XML and uses a very simple parser to filter out the torrent enclosure (that's sufficient for my use case). The torrent file is then placed into transmission's watch directory. The script is called by cron once per hour.
 

mpfusion

Contributor
Joined
Jan 6, 2014
Messages
198
How can I specify what to download and what not? Is that in the feed file?


The feeds file only contains the feeds, e.g.

Code:
http://www.jupiterbroadcasting.com/feeds/TechSNAPTorrent.xml
http://bitlove.org/jupiterbroadcasting/bsdnowhd/feed


Downloaded are the last “MAXFILES” (here set to five) enclosures (“sed” is used to parse for the tag “url”) where the file names end in “.torrent”. If the file names of your feeds are different, you have to adjust the sed regex according to your needs. I'm not using an XML parser, just a simple hackish solution. If you have more complex requirements this might not be sufficient for you.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
what are you trying to download by RSS?

subsonic can download podcast from an rss feed and serve them to clients. it doesn't do torrent feeds though.

owncloud has an RSS plugin to grab news articles
 
Status
Not open for further replies.
Top