Saber, a complete solution for PT users. [![Build Status](https://secure.travis-ci.org/GutenYe/saber.png)](http://travis-ci.org/GutenYe/saber) ========================================== | | | |----------------|-----------------------------------------| | Homepage: | https://github.com/GutenYe/saber | | Author: | Guten | | License: | MIT-LICENSE | | Documentation: | https://github.com/GutenYe/saber/wiki | | Issue Tracker: | https://github.com/GutenYe/saber/issues | **Features:** * Add Torrent: send a torrent file from website to rutorrent. * Upload: upload a torrent file from command line to the site. * Fetch: automatically/manually fetch files from seedbox to home-laptop. * Other Tasks: - Make: make a torrent file and copy it to local and remote watch directory. - Send: send files from home-laptop to seedbox. - Clean: remove files which are not seeded in rtorrent. you can find more tools at [here](https://github.com/GutenYe/saber/wiki/Tools). Getting Started ---------------- Create ~/.saberrc configuration file from [template](https://github.com/GutenYe/saber/blob/master/templates/_saberrc). More detail will be explained below. ### Add Torrent See [saber-addtorrent](https://github.com/GutenYe/saber-addtorrent) project. ### Upload Because of lacking APIs in major PT sites, so I write this small script to help uploading a torrent from cmdline. Good news is BTN v2.0 will include API. And BTN already has an official autobot which grabs scene releases. :) > Support sites: BIB Configure ~/.saberrc p: watch = Pa("~/bt/watch") remote_watch = Pa("bt/watch") username = "foo" bib: username = "bar" announce_url = "x" server: user = "x" host = "y" Fill \.yml file and upload it. $ saber.bib g magazine hello.pdf > create hello.pdf.yml $ vim hello.pdf.yml type: magazines Title: Hello Description: Hello World ... $ saber.bib upload hello.pdf.torrent > Upload Complete $ saber.bib upload hello.pdf # short cut > make hello.pdf.torrent > Upload Complete Auto fill \.yml file from isbn. $ saber.bib g ebook hello.epub 1781100055 > create hello.epub.yml ### Fetch #### AutoFetch Configure ~/.saberrc p: fetcher_download = Pa("~/download") server: ftp = "ftp://seedbox/bt" xmpp: jid = "x1@gmail.com" # need register a gtalk account. password = "y1" host = nil port = nil client: xmpp: jid = "x2@gmail.com" password = "y2" host = nil port = nil Start saber-server at server side. # ~/.rtorrent.rc method.set_key = event.download.finished, saber-fetch, "execute= saber-drb_add, (d.get_hash), (d.get_custom1)" $ saber server -V Start saber-client at client side. $ aria2c --enable-rpc --save-session session.lock -i session.lock $ saber client -V Test if it works (server) $ saber drb_add saber (client) > aria2 should begin download file from ftp://seedbox/bt/ Automatically fetch: when a file is finished download in rutorrent with label 'saber', then it'll add to aria2. Manually fetch: right click 'Saber Fetch' in rutorrent web ui, then it'll add to aria2. Or from command line, send a download file to client: `saber drb_add saber`, sometime the client need a long time(2 minutes) to recive the file list sent by server. For ArchLinux, you can install `saber-server-daemon`, `user-saber-client-daemon`, `user-aria2-daemon` packages. #### ManualFetch Configure ~/.saberrc p: fetcher_download = Pa("~/download") remote_download = Pa("~/bt") server: user = "x" host = "seedbox" ftp = "ftp://seedbox/bt" Begin fetch a file from seedbox $ saber fetch foo > download ftp://seedbox/bt/foo/a.epub > download ftp://seedbox/bt/foo/b.epub ### Tasks #### Make Configure ~/.saberrc p: watch = Pa("~/bt/watch") remote_watch = Pa("bt/watch") bib: announce_url = "x" server: user = "x" host = "y" Make a torrent $ saber make hello.epub > mktorrent -p -a x hello.epub > cp hello.epub.torrent ~/bt/watch > rsync -Phr hello.epub.torrent user@host:bt/watch #### Send Configure ~/.saberrc server: user = "x" host = "y" Send files to seedbox $ saber send1 hello.epub bt > rsync -Phr hello.epub user@host:bt #### Clean Configure ~/.saberrc p: download = Pa("~/bt") Clean up unseeded files in rtorrent. $ saber clean use `saber help` to list all tasks. Install ------- _Main article_: [Install Saber](https://github.com/GutenYe/saber/wiki/Install) $ gem install saber $ install it's dependencies Archlinux: pacaur -S saber Resources --------- * [Archlinux](http://www.archlinux.org): A simple, lightweight linux distribution. * [pacaur](https://github.com/Spyhawk/pacaur): An AUR helper for ArchLinux. * [YAAW](https://github.com/binux/yaaw): Yet Another Aria2 Web Frontend in pure HTML/CSS/Javascirpt. Development [![Dependency Status](https://gemnasium.com/GutenYe/saber.png?branch=master)](https://gemnasium.com/GutenYe/saber) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/GutenYe/saber) =========== Contributing ------------- * Submit any bugs/features/ideas to github issue tracker. Pull requests are very welcome! Please try to follow these simple rules if applicable: * Please create a topic branch for every separate change you make. * Make sure your patches are well tested. * Coding Style Guide: https://gist.github.com/1105334 Contributors ------------ [https://github.com/GutenYe/saber/contributors](https://github.com/GutenYe/saber/contributors) Copyright --------- (the MIT License) Copyright (c) 2011-2012 Guten Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.