Created
January 18, 2014 16:54
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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