This is the cl-transmission Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:28:34 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-transmission
Thomas Schaper
MIT
* CL-Transmission
** Usage
*** Loading
Lets start by loading ~CL-TRANSMISSION~ and defining our connection. Connections
are thread-safe in the way that you can use a one or more connection in multiple
threads.
#+begin_src lisp :exports both
(ql:quickload :cl-transmission)
(defvar *conn* (make-instance ’cl-transmission:transmission-connection
:host "your.ip" ;; the host is "localhost" by default.
:credentials ’("libreman" "super-secret-password")))
#+end_src
#+RESULTS:
: *CONN*
Please note that this package is not (yet) in Quicklisp so you will have to add
it to your local projects to be able to load it. See the [[https://www.quicklisp.org/beta/faq.html][Quicklisp FAQ]] on how to
do this.
*** Searching
So lets get some torrents. First lets get all torrents and of every torrent get
the id, name and eta. This is done by using the
~CL-TRANSMISSION:TRANSMISSION-GET~ method.
#+begin_src lisp :exports both
(cl-transmission:transmission-get *conn* #(:name :id :eta) :strict t)
#+end_src
#+RESULTS:
#+begin_example
(#<HASH-TABLE :TEST EQUAL :COUNT 3 {1014218D23}>
#<HASH-TABLE :TEST EQUAL :COUNT 3 {10142193B3}>
#<HASH-TABLE :TEST EQUAL :COUNT 3 {1014241C83}>)
NIL
#+end_example
As shown for every live torrent a hash-table is returned. So lets see how it is
structured:
#+begin_src lisp :exports both
(alexandria:hash-table-plist
(elt (cl-transmission:transmission-get *conn* #(:name :id :eta) :strict t)
0))
#+end_src
#+RESULTS:
| :NAME | debian-8.7.1-amd64-DVD-1.iso | :ID | 72 | :ETA | 1368 |
So it simply contains the fields we specified. Searching is done by or passing a
id, if you know it this is the fastest way, or mapping over the return value.
*** Adding
Adding torrents is done by the ~CL-TRANSMISSION:TRANSMISSION-ADD~
function. It accepts a =:FILENAME= argument which should be a filename
to a torrent file or a magnet link, and =:METAINFO= which should be a
base64-encoded torrent file.
So lets say we want to add a nice debian torrent to seed:
#+begin_src lisp :exports both
(cl-transmission:transmission-add *conn* :filename "http://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/debian-8.7.1-amd64-DVD-2.iso.torrent")
#+end_src
#+RESULTS:
: #<HASH-TABLE :TEST EQUAL :COUNT 3 {10174B6333}>
: :TORRENT-ADDED
We get a hash-table of our new torrent with an ~ID~, ~NAME~ and ~HASH-STRING~,
and the second return value is indicating this is a new torrent. So if we would
add the same torrent again this would be ~:TORRENT-DUPLICATE~.
*** Others
At the moment the entire section 3 of the RPC spec is implemented. Simply see
the exported method and their docstrings. Development is active and section 4
will be implemented.
** Author
+ Thomas Schaper (Thomas@libremail.nl)
** Copyright
Copyright (c) 2017 Thomas Schaper (Thomas@libremail.nl)
0.1
rutils
(system).
drakma
(system).
named-readtables
(system).
cl-ppcre
(system).
uiop
(system).
jonathan
(system).
src
(module).
Modules are listed depth-first from the system components tree.
cl-transmission/src
cl-transmission
(system).
cl-transmission.lisp
(file).
constants.lisp
(file).
util.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-transmission/cl-transmission.asd
cl-transmission/src/cl-transmission.lisp
cl-transmission/src/constants.lisp
cl-transmission/src/util.lisp
cl-transmission/cl-transmission.asd
cl-transmission
(system).
cl-transmission/src/cl-transmission.lisp
util.lisp
(file).
constants.lisp
(file).
src
(module).
transmission-add
(generic function).
transmission-connection
(class).
transmission-error
(condition).
transmission-get
(generic function).
transmission-reannounce
(generic function).
transmission-remove
(generic function).
transmission-rename-path
(generic function).
transmission-set
(generic function).
transmission-set-location
(generic function).
transmission-start
(generic function).
transmission-start-now
(generic function).
transmission-stop
(generic function).
transmission-verify
(generic function).
%transmission-request
(function).
def-torrent-action-request
(macro).
def-torrent-request
(macro).
get-transmission-host
(function).
keyword-all-p
(function).
no-duplicates-p
(function).
port-number
(type).
transmission-error-response
(reader method).
transmission-request
(function).
update-session-id
(function).
valid-torrent-add-keys-p
(function).
valid-torrent-get-keys-p
(function).
cl-transmission/src/constants.lisp
util.lisp
(file).
src
(module).
+default-optimizations+
(constant).
+transmission-add-params+
(constant).
+transmission-get-params+
(constant).
+transmission-set-params+
(constant).
cl-transmission/src/util.lisp
src
(module).
contains-key
(function).
defclass-export
(macro).
defgeneric-export
(macro).
define-condition-export
(macro).
define-constant-export
(macro).
defmacro-export
(macro).
defun-export
(macro).
make-keyword
(function).
plist-to-hash-table
(function).
string->keyword
(function).
define-export-macro
(macro).
the-check
(macro).
Packages are listed by definition order.
cl-transmission.util
common-lisp
.
rutils.readtable
.
contains-key
(function).
defclass-export
(macro).
defgeneric-export
(macro).
define-condition-export
(macro).
define-constant-export
(macro).
defmacro-export
(macro).
defun-export
(macro).
make-keyword
(function).
plist-to-hash-table
(function).
string->keyword
(function).
define-export-macro
(macro).
the-check
(macro).
cl-transmission.constants
cl-transmission.util
.
common-lisp
.
+default-optimizations+
(constant).
+transmission-add-params+
(constant).
+transmission-get-params+
(constant).
+transmission-set-params+
(constant).
cl-transmission
cl-transmission.constants
.
cl-transmission.util
.
common-lisp
.
rutils.anaphora
.
rutils.readtable
.
transmission-add
(generic function).
transmission-connection
(class).
transmission-error
(condition).
transmission-get
(generic function).
transmission-reannounce
(generic function).
transmission-remove
(generic function).
transmission-rename-path
(generic function).
transmission-set
(generic function).
transmission-set-location
(generic function).
transmission-start
(generic function).
transmission-start-now
(generic function).
transmission-stop
(generic function).
transmission-verify
(generic function).
%transmission-request
(function).
def-torrent-action-request
(macro).
def-torrent-request
(macro).
get-transmission-host
(function).
keyword-all-p
(function).
no-duplicates-p
(function).
port-number
(type).
transmission-error-response
(generic reader).
transmission-request
(function).
update-session-id
(function).
valid-torrent-add-keys-p
(function).
valid-torrent-get-keys-p
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Add a new torrent specified the given fields.
The torrent is given in "METAINFO" or "FILENAME". "METAINFO" should be a
base64-encoded torrent file while "FILENAME" should be a filename of torrent
file or a magnet link. For the other options and more detailed descriptions see
the rpc specifications.
The first return value is a hash-table with fields for the id, ":ID", name, ":NAME" and hash string, ":HASH-STRING", of the added torrent. The second return value is ":TORRENT-ADDED" if a new torrent was added and ":TORRENT-DUPLICATE" if no new torrent was added.
transmission-connection
) &rest all-keys &key &allow-other-keys) ¶Get the fields specified in "FIELDS" for the given "IDS".
"IDS" should be a list of torrent designators, where a torrent designator is a
torrent-id or a torrent sha1 string, or it should be ":ALL" to set this value
for all the torrents on the server.
The specified fields should be a sequence of keywords, if "STRICT" is non NIL
we will check if it does not contain any illegal keywords. All legal keywords
are specified in "CL-TRANSMISSION.CONSTANTS:+TRANSMISSION-GET-PARAMS+"
The first return value is a list of active torrents. The second return value is a list of removed torrents. Torrents are represented by a hash-table containing the specified fiels normalized as keywords.
transmission-connection
) fields &key ids strict) ¶Ask the tracker for more peers for the given torrents.
The torrents are specified by "IDS", which should be a list of torrent
designators, a torrent designator is a torrent-id or a torrent sha1 string, or
it should be the string "recently-active" (case sensitive).
This function will return nothing of value.
transmission-connection
) ids) ¶Remove the torrents with the given "IDS" and maybe delete the local data.
"IDS" should be a list of torrent designators, where a torrent designator is a
torrent-id or a torrent sha1 string, or it should be the string
"recently-active" (case sensitive).
"DELETE-LOCAL-DATA" should parse to a json boolean. "NIL" will be converted
to ":FALSE" which will parse the false boolean in json.
This function does not return anything useful.
transmission-connection
) &key ids delete-local-data) ¶Rename the "PATH" of given torrent by "ID" to "NAME"
The "ID" should be a torrent id, sha1 hash string or the string
"recently-active" (case sensitive).
The torrents "PATH" will be renamed to "NAME", some examples (modified from
transmission.h):
Consider a torrent, with id 0, which has two files with the names
"frobnitz-linux/checksum" and "frobnitz-linux/frobnitz.iso".
If we would call "(TRANSMISSION-RENAME-PATH 0 "frobnitz-linux", "foo")" then
the "frobnitz-linux" folder will be renamed to "foo" in both torrents.
However if we would call "(TRANSMISSION-RENAME-PATH 0
"frobnitz-linux/checksum", "foo")" then only "frobnitz-linux/checksum"
will be renamed to "frobnitz-linux/foo" while
"frobnitz-linux/frobnitz.iso" will remain unchanged.
This value does not return anything value.
transmission-connection
) id path name) ¶Set the specified key to the given value for the given "IDS".
"IDS" should be a list of torrent designators, where a torrent designator is a
torrent-id or a torrent sha1 string, or it should be ":ALL" to set this value
for all the torrents on the server.
For the exact meaning of the keys see the rpc spec. Please note that leaving a
key unspecified is not the same as passing an empty array. Also note that
passing "NIL" will result in sending an empty array, not the boolean
"false". To send the boolean "false" pass ":FALSE" as keyword.
This function will return nothing of value.
transmission-connection
) ids &rest all-keys &key &allow-other-keys) ¶Move the "IDS" to the new "LOCATION" moving the old if "MOVE" is true.
"IDS" should be a list of torrent designators, where a torrent designator is a
torrent-id or a torrent sha1 string, or it should be the string
"recently-active" (case sensitive).
"LOCATION" is the new location of the specified torrents. It should parse to a
json string by jonathan.
"MOVE" should parse to a json boolean. "NIL" will be converted to ":FALSE"
which will parse the false boolean in json.
This function does not return anything of value.
transmission-connection
) ids location &optional move) ¶Start the given torrents by adding them to the appropriate queue.
The torrents are specified by "IDS", which should be a list of torrent
designators, a torrent designator is a torrent-id or a torrent sha1 string, or
it should be the string "recently-active" (case sensitive).
This function will return nothing of value.
transmission-connection
) ids) ¶Start the given torrents directly bypassing the queues.
The torrents are specified by "IDS", which should be a list of torrent
designators, a torrent designator is a torrent-id or a torrent sha1 string, or
it should be the string "recently-active" (case sensitive).
This function will return nothing of value.
transmission-connection
) ids) ¶Stop (pause) the given torrents.
The torrents are specified by "IDS", which should be a list of torrent
designators, a torrent designator is a torrent-id or a torrent sha1 string, or
it should be the string "recently-active" (case sensitive).
This function will return nothing of value.
transmission-connection
) ids) ¶Queue the given torrents for verification.
The torrents are specified by "IDS", which should be a list of torrent
designators, a torrent designator is a torrent-id or a torrent sha1 string, or
it should be the string "recently-active" (case sensitive).
This function will return nothing of value.
transmission-connection
) ids) ¶The general error used when we could not complete the request to the transmission server.
error
.
:response
This slot is read-only.
The protocol to use to contact the server probably "http" or "https".
string
"http"
:protocol
The host of the transmission server.
string
"localhost"
:host
The port of the transmission server.
cl-transmission::port-number
9091
:port
The part of the url of the transmission server after the port.
string
"transmission/rpc"
:url
he basic authentication for the transmission server. Use NIL if no auth is needed.
(or null list)
:credentials
The current "X-Transmission-Session-Id" used by the transmission server.
string
""
transmission-error
)) ¶Jump to: | %
C D F G K M N P S T U V |
---|
Jump to: | %
C D F G K M N P S T U V |
---|
Jump to: | +
C H P R S U |
---|
Jump to: | +
C H P R S U |
---|
Jump to: | C F M P S T U |
---|
Jump to: | C F M P S T U |
---|