Giter Club home page Giter Club logo

deluge-php's Introduction

deluge-php - Simple php wrapper for the deluge-web json api

The deluge documentation is a little scattered. This should help people get up and running with the json api. Includes the core methods, webui methods, and also the webapi plugin (see url below) Most functions are not tested, as they are automatically parsed from the following places:

Usage

include("deluge.class.php");
$deluge = new deluge("https://127.0.0.1:8112", "yourpassword");
$torrents = $deluge->getTorrents(null, null);
$status = $deluge->getTorrentStatus($torrents[0]->hash, array(), array());
$deluge->close() //Closes the cURL handle

Functions take a variety of arguments. Unused arguments are usually either null (equivalent to Python None) or array(). Experimentation may be necessary.

For debugging purposes, the header and body of the last request and response are stored in the public class property last_http_transaction (stdObj with obviously named properties)

Check the deluge-web log for details of failed requests. Failures throw php Exception's.

License

GPL v3.0: See LICENSE.md

deluge-php's People

Contributors

kaysond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

deluge-php's Issues

getting some errors

Hi

i get some errors that i dont understand whats wrong

this one of them
PHP Fatal error: Uncaught exception 'Exception' with message 'Response id did not match request id' in class.deluge.php:501

Uncaught Exceptions?

my code works when the values are correct but if it intentionally try with bad credentials I get uncaught exceptions:

try {
					
	$deluge = new deluge($GLOBALS['delugeURL'], decrypt($GLOBALS['delugePassword']));
	return $deluge->getTorrents(null, 'comment, download_payload_rate, eta, hash, is_finished, is_seed, message, name, paused, progress, queue, state, total_size, upload_payload_rate');
} catch (Excecption $e) {
	return $e->getMessage();
}

Errors:

<br />
<b>Fatal error</b>:  Uncaught Exception: Could not log in due to curl error (no. 7): Failed to connect to usenet.home.lab port 8113: Connection refused in C:\nginx\html\Organizr\api\functions\deluge.class.php:563
Stack trace:
#0 C:\nginx\html\Organizr\api\functions\deluge.class.php(30): deluge-&gt;makeRequest('auth.login', Array)
#1 C:\nginx\html\Organizr\api\functions\homepage-connect-functions.php(1775): deluge-&gt;__construct('http://usenet.h...', 'xxxxxxxxx')
#2 C:\nginx\html\Organizr\api\index.php(333): testAPIConnection(Array)
#3 {main}

Next Exception: Failed to initiate deluge api in C:\nginx\html\Organizr\api\functions\deluge.class.php:35
Stack trace:
#0 C:\nginx\html\Organizr\api\functions\homepage-connect-functions.php(1775): deluge-&gt;__construct('http://usenet.h...', 'xxxxxxxxx')
#1 C:\nginx\html\Organizr\api\index.php(333): testAPIConnection(Array)
#2 {main}
  thrown in <b>C:\nginx\html\Organizr\api\functions\deluge.class.php</b> on line <b>35</b><br />

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.