Skip to content

Instantly share code, notes, and snippets.

@sohooo
Created January 18, 2014 16:54
Show Gist options
  • Save sohooo/8493102 to your computer and use it in GitHub Desktop.
Save sohooo/8493102 to your computer and use it in GitHub Desktop.
The Sickbeard API[1] offers no interface to trigger the post-processing of downloaded episodes. This simple script uses Mechanize in order to start the process via the web app. [1] http://sickbeard.com/api/
require "rubygems"
require "mechanize"
site = 'http://pi:9094/home/postprocess/'
user = 'xbian'
pass = 'raspberry'
downloads = '/home/xbian/downloads/tv'
agent = Mechanize.new
agent.add_auth(site, user, pass)
agent.get(site) do |page|
processed = page.form_with(:name => 'processForm') do |processing|
processing.dir = downloads
end.submit
puts processed.search("#content")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment