Sabnzbd¶ ↑
version 0.1.0 Daniël Zwijnenburg
This gem can be used to gather status and download information from your sabnzb instance.
Usage¶ ↑
You can use this gem by including it inside your Gemfile:
gem "sabnzbd"
If you have a running instance of sabnzbd somewhere you will need to get the API key (you can find the API key under config/general > API KEY) and url(defaults to localhost:8080).
Basic information¶ ↑
sab = Sabnzbd.new({api_key: "your_api_key_here"}) sab.base_uri => "localhost:8080" sab.paused? => false sab.slots => [#<Sabnzbd::Slot:0x007fb601049638 @time_left="0:00:00", @mb=23749.483629, @msgid="", @filename="a_big_legal_file", @mb_left=22061.784398] sab.slots.first.filename => "a_big_legal_file"
information about download slots¶ ↑
sab.slots => [#<Sabnzbd::Slot:0x007fa9498e0ce8 @filename="a_smaller_legal_file", @average_age="9h", @status="Queued", @category="tv", @files_missing=0, @position=0, @priority="High", @percentage_completed="0", @eta="unknown", @size="104 MB", @size_left="104 MB", @mb="103.92", @mb_left="103.92", @msgid="", @nzo_id="SABnzbd_nzo_xxxxa">, #<Sabnzbd::Slot:0x007fa9498e0a40 @filename="a_big_legal_file", @average_age="62d", @status="Queued", @category="*", @files_missing=0, @position=1, @priority="High", @percentage_completed="12", @eta="unknown", @size="14.8 GB", @size_left="12.9 GB", @mb="15136.44", @mb_left="13260.72", @msgid="", @nzo_id="SABnzbd_nzo_xxxxb">] sab.utils.slot_positions => {0=>"SABnzbd_nzo_xxxxa", 1=>"SABnzbd_nzo_xxxxb"}
switching download positions¶ ↑
sab.utils.switch(sab.slots.first, sab.slots.last) => "1 1\n" #meaning success, need to refactor. sab.utils.slot_positions => {0=>"SABnzbd_nzo_xxxxb", 1=>"SABnzbd_nzo_xxxxa"}
Contributing to sabnzbd¶ ↑
-
Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.
-
Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.
-
Fork the project.
-
Start a feature/bugfix branch.
-
Commit and push until you are happy with your contribution.
-
Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright¶ ↑
Copyright © 2012 Daniel Zwijnenburg. See LICENSE.txt for further details.