No description
Find a file
2013-11-03 12:44:11 +01:00
bin LSD - lets share data daemon 2013-11-03 12:44:11 +01:00
lsd LSD - lets share data daemon 2013-11-03 12:44:11 +01:00
.gitignore LSD - lets share data daemon 2013-11-03 12:44:11 +01:00
LICENSE LSD - lets share data daemon 2013-11-03 12:44:11 +01:00
README LSD - lets share data daemon 2013-11-03 12:44:11 +01:00
setup.py LSD - lets share data daemon 2013-11-03 12:44:11 +01:00

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)