README.md in saber-0.0.7 vs README.md in saber-1.0.0

- old
+ new

@@ -1,99 +1,239 @@ -Saber, a complete solution for PT users. -======================================== +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 | +| | | |----------------|-----------------------------------------| +| 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 | -### Is It Good? +**Features:** -Yes. +* 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. -### Is It "Production Ready™"? +you can find more tools at [here](https://github.com/GutenYe/saber/wiki/Tools). -No. +Getting Started +---------------- -What saber can do for you? +Create ~/.saberrc configuration file from [template](https://github.com/GutenYe/saber/blob/master/templates/_saberrc). More detail will be explained below. -* addtorrent: send torrent file to rutorrent in a PT website directly. -* download: - 1. manually download a file to home laptop in rutorrent web ui. - 2. automatically downlad files to home laptop when files are completed in seedbox. -* task: - 1. cleanup files not in rtorrent. +### Add Torrent -Usage ------ +See [saber-addtorrent](https://github.com/GutenYe/saber-addtorrent) project. -### addtorrent +### Upload -see https://github.com/Gutenye/saber-addtorrent +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 -### download +Configure ~/.saberrc - # server side - # start rtorrent - $ /etc/rc.d/saber-server start # start saber server daemon. + p: + watch = Pa("~/bt/watch") + remote_watch = Pa("bt/watch") - # client side - $ ~/etc/rc.d/aria2 start # start aria2 daemon. - $ ~/etc/rc.d/saber-client start # start saber client daemon. + username = "foo" + bib: + username = "bar" + announce_url = "x" + + server: + user = "x" + host = "y" + +Fill \<info-data>.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 \<info-data>.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 + +And ~/.netrc, for ftp authenticate. + + machine seedbox + login x + password y + +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 + +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. - # manually download - right click 'Saber Download' in rutorrent web ui, then it adds to aria2. +For ArchLinux, you can install `saber-server-daemon`, `user-saber-client-daemon`, `user-aria2-daemon` packages. - # automatically download - when a file is finished download in rutorrent with label 'saber', then it adds to aria2. +#### 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 send hello.epub bt + > rsync -Phr hello.epub user@host:bt + +#### Clean + +Configure ~/.saberrc -### task + p: + download = Pa("~/bt") -clean up undownload files, all files remains in disk, but don't in rtorrent client. +Clean up unseeded files in rtorrent. - # server side $ saber clean +use `saber help` to list all tasks. + Install --------- +------- -### download +_Main article_: [Install Saber](https://github.com/GutenYe/saber/wiki/Install) - # server side - $ gem install saber - $ pacaur -S rutorrent-saber-git saber-server-daemon - - # client side - $ gem install saber - $ pacaur -S user-aria2-daemon user-saber-client-daemon + $ [sudo] gem install 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 ------------- -* Feel free to join the project and make contributions (by submitting a pull request) -* Submit any bugs/features/ideas to issue tracker -* Coding Style Guide: https://gist.github.com/1105334 +* Submit any bugs/features/ideas to github issue tracker. -Credits --------- +Pull requests are very welcome! Please try to follow these simple rules if applicable: -* [Contributors](https://github.com/GutenYe/saber/contributors) +* 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 -Resources ---------- +Contributors +------------ -* [pacaur](https://github.com/Spyhawk/pacaur): An AUR installer for ArchLinux. -* [TheBear](http://sourceforge.net/projects/thebear/): a web front end to aria2. +[https://github.com/GutenYe/saber/contributors](https://github.com/GutenYe/saber/contributors) Copyright --------- (the MIT License) -Copyright (c) 2011 Guten +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.