Giter VIP home page Giter VIP logo

spritzle's Introduction

Spritzle

Spritzle is a lightweight bittorrent client built around libtorrent. It aims to provide a simple REST interface to libtorrent. Any additional functionality should be provided by a hook extending spritzle.

Interface

A command-line client is included as the spritzle command.

Authors

spritzle's People

Contributors

aresch avatar damoxc avatar gazpachoking avatar johnnyg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gazpachoking

spritzle's Issues

Add filters for GET /torrent

  • Regex matching for string fields

  • Something for number fields where we can specify ><=, etc.. example: upload_rate>10

Add /log endpoint

The /log endpoint will allow clients to pull logs from the running spritzled for informational or debugging purposes.

  • Add ability to configure log level in spritzle config on-the-fly

  • Write logs to an in-memory buffer so that they can be served in /log

  • Add config option to limit number of logs to be stored in-memory

  • Add filters (query string?) to GET /log based on log level, regex matching of string, time and limit number of results

Form vs JSON encoded request bodies

It would be nice to be able to send all request bodies to the server in JSON format from clients. It is also nice to send certain requests via curl with form encoding. I suggest making a helper that can read either a JSON body, or a form encoded body (based on the request content_type) and return a common dictionary format. For file fields, the JSON format can accept base64 encoded data. We can use this helper for any endpoints that it would be nice to accept both formats.
Current endpoints accepting only form encoded bodies:

  • POST /torrent
  • POST /auth

Current endpoints accepting only JSON bodies:

  • PUT/PATCH /config
  • PUT /session/settings

Should all of these accept both? Some of them? Is it a terrible idea?

Add way to generate token from spritzled

Add a command line option for spritzled to generate a token. There should be an option to set the expiration time so that people can generate long-term tokens if they wish. These long-term tokens can be useful for scripts/hooks that need access to the spritzled.

We may want to consider the use of click for spritzled as we use it in spritzle-cli.

  • Add command-line option to generate token.
  • Add option to set an expiry time for the token.
  • Update documentation by writing a section on Authentication and updating all examples to include the use of auth tokens. Including how to generate a token and use it with spritzle-cli.

Libtorrent add torrent flags

Using libtorrent flags when adding torrents sorta sucks. The client needs to be aware of the numeric values, and OR them together before sending the request, e.g. {"flags": 16} needs to be sent as args to the /torrent POST to use the 'paused' flag.

One possible way to make this nicer would be to allow the flags to be specified as a list of flag names. e.g. {"flags": ["paused", "auto_managed"]} Spritzle could detect if we get a list or int for this option (or just make the list the canonical way,) and override in the case of an list before sending on to libtorrent.

Improve documentation

  • Improve the README to include a better description of spritzle, installation instructions, brief usage guide, links to more indepth documentation (interface, hooks)

  • Maybe add animated screen capture of spritzle + spritzle-cli basic usage

  • More hook examples

Save extra data to resume files

Currently, spritzle specific torrent data, core.torrent_data, (i.e. tags) are saved in to the resume file. The resume file is only updated automatically when torrent_handle.need_save_resume_data is True. Changes to spritzle specific data therefore can be missed by the save process.

TODO: Fix the problem somehow. Perhaps detect changes in core.torrent_data, and force a resume save. (Maybe there are also other situations which should cause a resume data update?)

Fix vext.libtorrent to work with pipenv

Can't run pipenv lock with vext.libtorrent installed. Without this package working we will have to resort to using --system-packages option which isn't ideal.

$ pipenv lock --verbose
Locking [dev-packages] dependencies…

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/pipenv/resolver.py", line 85, in <module>
    main()
  File "/usr/lib/python3.6/site-packages/pipenv/resolver.py", line 37, in main
    import pipenv.core
  File "/home/aresch/.local/share/virtualenvs/spritzle-WJROkGy7/lib/python3.6/site-packages/vext/gatekeeper/__init__.py", line 204, in load_module
    raise ImportError("No module named %s" % modulename)
ImportError: No module named pipenv

Friendly resume data names

In #16, resume data save files were changed to be info hash rather than torrent name for technical reasons. This however isn't very friendly for users. This could be improved by maintaining symlinks to the resume files with the friendly torrent names.

Potential issues (similar to the problems which caused the switch to infohash):

  • Name collisions
  • If the libtorrent name is changed, how does the symlink get cleaned up?

Tests are failing sometimes due to segfault

Intermittent issue maybe caused to not properly shutting down the Core after each test.

============================= test session starts ==============================
platform linux -- Python 3.6.5, pytest-3.5.1, py-1.5.3, pluggy-0.6.0
rootdir: /home/circleci/project, inifile:
collected 53 items

spritzle/tests/test_alert.py ... [ 5%]
spritzle/tests/test_common.py .. [ 9%]
spritzle/tests/test_config.py ........... [ 30%]
spritzle/tests/test_core.py .. [ 33%]
spritzle/tests/test_hooks.py ... [ 39%]
spritzle/tests/test_resume_data.py ..Received 'segmentation fault' signal

Remove allow_hosts auth mechanism

It was only added to aid development before the spritzle-cli had an easy way to generate and use auth tokens.

It should be removed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.