Showaddr – tool to add shows to rssdler

Howdy!
Made a set of php scripts to ease the use of adding of shows from an rss feed to get downloaded with rtorrent.

What now?
Let me explain.

Lets say we have an rss feed, for example, with different podcasts.
We want to download all new episods of a selected few of shows in said feed, and of course we want to do this in the background, automatic and with minimal tinkering 😉

My set up
An htpc with XBMC, rtorrent and rssdler:

Rssdler downloads torrent files from the rss feed and stores them in a watch folder.
Rtorrent monitor the watch folder for new torrent files.
Rtorrent downloads the torrent to a download dir, seeds it to ratio 1.1 and then removes the torrent.

XBMC scrapes the download dir for new files, adds it to its database and scrape info/pictues/etc making it ready to be watched.

So what we need is one place to store the watch dirs, and one place where the download is eventually stored.
This is a pain in the ass to add manually, you need to mkdir twince, add set of rules to rssdler config, and then add what folders to watch in the rtorrent config.

So you made a script eh?
Let me start off by saying that i can’t really code, so this script is REALLY crude, but it works unexpectedly good!
You need a working rtorrent and rssdler install, there are plenty of install howtos around, so i wont go into that here.

But sir! Can’t i have your configs?
Sure, here is my basic rssdler config

[global]
# download files to this directory. Defaults to the working directory.
downloadDir = /home/user/.rssdler/torrentfiles
workingDir = /home/user/.rssdler
minSize = 0
# maxSize = None

# write messages to a log file. 0 is off, 1 is just error messages,
# 3 tells you when yo download something, 5 is very, very wordy. (default = 0)
log = 5
logFile = downloads.log
# like log, only prints to the screen (errors to stderr, other to stdout)
# default 3
verbose = 3
# how long to wait between checking feeds (in minutes). Default 15.
scanMins = 8
# how long to wait between http requests (in seconds). Default 0
sleepTime = 0
# to exit after scanning all the feeds, or to keep looping. Default False.
runOnce = False
urllib = False
The script will add the filters to this file at the bottom.

Here is my .rtorrent.rc

# Maximum and minimum number of peers to connect to per torrent.
min_peers = 10
max_peers = 40
# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 50
# Maximum number of simultanious uploads per torrent.
max_uploads = 5
# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 8000
upload_rate = 800
# Default directory to save the downloaded torrents.
directory = /home/user/torrents/downloads
# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/user/torrents/sessions

# Watch dirs!
# Enter watch dirs here, you need to change the id
#NOTE, remove linebreaks, each show must on the same line
schedule = watch_directory_1,10,10,"load_start=/home/user/watch/show1/*.torrent,d.set_custom1=/home/user/data/show1/"
schedule = watch_directory_2,10,10,"load_start=/home/user/watch/show2/*.torrent,d.set_custom1=/home/user/data/show2/"
# ^ this is the id
#
# Add lines below

# On completion, move the torrent to the directory from custom1.
# This aswell, one line.
system.method.set_key =event.download.finished,move_complete,"d.set_directory=$d.get_custom1= ;execute=mv,-u,$d.get_base_path=,$d.get_custom1="

# Enable the default ratio group.
ratio.enable=

# Change the limits, the defaults should be sufficient.
ratio.min.set=50
ratio.max.set=110
ratio.upload.set=20M

# Changing the command triggered when the ratio is reached.
system.method.set = group.seeding.ratio.command, d.close=, d.erase=

# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=500M

# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
schedule = ratio,60,60,"stop_on_ratio=110,200M,120"

#bind = 127.0.0.1

# Port range to use for listening.
port_range = 6890-6999

# Start opening ports at a random position within the port range.
port_random = yes

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
#check_hash = no

# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
#encryption = require_RC4
encryption = allow_incoming,try_outgoing,enable_retry

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
dht = disable

# UDP port to use for DHT.
#
#dht_port = 6881

# Enable peer exchange (for torrents not marked private)
#
# peer_exchange = yes

#
# Do not modify the following parameters unless you know what you're doing.
#

# Hash read-ahead controls how many MB to request the kernel to read
# ahead. If the value is too low the disk may not be fully utilized,
# while if too high the kernel might not be able to keep the read
# pages in memory thus end up trashing.
#hash_read_ahead = 10

# Interval between attempts to check the hash, in milliseconds.
#hash_interval = 100

# Number of attempts to check the hash while using the mincore status,
# before forcing. Overworked systems might need lower values to get a
# decent hash checking rate.
#hash_max_tries = 10

You will need to change some paths and settings in those two files

Alright! Wheres the script!
The archive should be unpacked on an httpd server with php, preferably protected with an .htaccess file to prevent outside use.
The files you need to edit are done.php, editrssdler.php and editrtorrentrc.php

Since you are going to get the rssfile one time for each filter, i recommend that you add a crontab (wget the rss every 10 min or so) for the rss, and store it on your own httpd!

Showaddr-0.1.tar.gz

Don’t hesitate to leave an reply if you need help or if something is unclear!

EDIT: You also need to restart rtorrent to make the changes to rtorrent work, sorry about this.
I will release a new version when i solved it properly


Publicerat

i

av

Kommentarer

Lämna ett svar

Din e-postadress kommer inte publiceras. Obligatoriska fält är märkta *