66 lines
1.8 KiB
Text
66 lines
1.8 KiB
Text
|
LSD - lets share data daemon
|
||
|
|
||
|
REQUIREMENTS
|
||
|
|
||
|
Python bindings for libtorrent-rasterbar (apt-get install python-libtorrent)
|
||
|
python-ox (easy_install ox)
|
||
|
|
||
|
CLIENT API USED BY SITE
|
||
|
|
||
|
lsd offers a json api that can be integrated on any site,
|
||
|
sites must provide the api outlined below for this to work.
|
||
|
|
||
|
config({username: '', password: '', url: ''})
|
||
|
sync({})
|
||
|
sync local folder with server
|
||
|
addRequests({ids: []})
|
||
|
download requested files and request seeder
|
||
|
|
||
|
//for debugging/stats:
|
||
|
status({})
|
||
|
status({id:})
|
||
|
seedRequests({})
|
||
|
|
||
|
possibly in the future:
|
||
|
// need to edit config for now
|
||
|
//setFolder({}, callback)
|
||
|
|
||
|
|
||
|
RESOURCE AVAILABLE TO SITE:
|
||
|
|
||
|
once available files can be accessed via:
|
||
|
http://127.0.0.1:15550/get/ID
|
||
|
|
||
|
|
||
|
SITE API USED BY CLIENT
|
||
|
|
||
|
sites must provide an api that allows clients to sync information
|
||
|
about available files. The api must be available at the url endpoint
|
||
|
set via config (defaults to site/api/)
|
||
|
|
||
|
sync({}) -> {ids: [id]}
|
||
|
sync({add: [id], remove: [id]}) -> {update: [id]}
|
||
|
sync({update: [metadata]}) -> {}
|
||
|
|
||
|
{} -> returns list of user ids know by server
|
||
|
{add: [], remove: []} -> add or remove files on sever
|
||
|
returns list of ids that need metadata {update: []}
|
||
|
{update: [{sha1:, info_hash:, extension:, ...}]} -> send metadata to server
|
||
|
|
||
|
addRequests({ids: [id]}) -> [metadata]
|
||
|
removeRequests({ids: [id]}) -> {}
|
||
|
getRequests({}) -> {ids: [id]}
|
||
|
|
||
|
//FIXME: use cookie or something like that instead
|
||
|
//if username/password is set via config your site must support this
|
||
|
signin({username: string, password: string}) -> {...}
|
||
|
|
||
|
|
||
|
IDENTIFIERS
|
||
|
|
||
|
id is assumed to be the sha1 of the file
|
||
|
|
||
|
sha1 and info_hash must be always in lower case hex form
|
||
|
(40 characters, lower case)
|
||
|
|