This is the torrents Reference Manual, version 0.12.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:28:16 2024 GMT+0.
torrents/torrents.asd
torrents/src/utils.lisp
torrents/src/models.lisp
torrents/src/tpb.lisp
torrents/src/torrentcd.lisp
torrents/src/kat.lisp
torrents/src/1337.lisp
torrents/src/downloadsme.lisp
torrents/src/torrents-paradise.lisp
torrents/src/torrents.lisp
torrents/src/commands.lisp
torrents/src/config.lisp
The main system appears first, followed by any subsystem dependency.
torrents
Search for torrents on popular trackers. Lisp library, CLI interface, terminal application, Tk GUI.
vindarel
MIT
[[https://gitlab.com/vindarel/cl-torrents][file:https://gitlab.com/vindarel/cl-torrents/badges/master/pipeline.svg]]
This is a little app to search for torrents on popular trackers and
to open them with a local or a remote client.
It comes as:
- a *lisp library*,
- a *command line* interface,
- a terminal *readline interface*,
- a simple *GUI*.
- The *[[https://github.com/vindarel/cl-torrents-web][Web UI]]* works too.
We currently scrape [[http://1337x.to][1337x.to]] (since v0.9), [[https://www.torrentdownloads.me][torrentdownloads.me]]
(v0.10) and [[https://torrent-paradise.ml][torrents-paradise]] (v0.11) and present the results sorted by seeders.
Download for GNU/Linux 64 bits: see [[https://gitlab.com/vindarel/cl-torrents/tags][Releases]] (/23MB, self-contained
executable/).
NOTE: torrents-paradise has a rich collection, a simple website as in KISS, it works on IPFS and has
it offers an API… frankly, I want to use its web service and click on its adds.
#+html: <p align="center"><img src="assets/img-colored-results.png" /></p>
#+html: <p align=’center’><img src=’assets/img-readline.png’ /></p>
#+html: <p align="center"><img src="assets/torrents-tk.png" /></p>
With the new default Yaru theme (and [[https://lisp-journey.gitlab.io/blog/pretty-gui-in-common-lisp-with-nodgui-tk-themes/][there are more]]):
#+html: <p align="center"><img src="assets/tk-gui-yaru-theme.png" /></p>
** Installation
The library is on Quicklisp (february 2019) and [[http://ultralisp.org/][Ultralisp]].
: (ql:quickload "torrents")
: (torrents:search-torrents "tears of steel")
Note: the master branch needs [[https://github.com/libre-man/cl-transmission/][cl-transmission]] which was added
to the Quicklisp distribution of december, 2019.
See the download link of the binary above. It is a self-contained executable for
GNU/Linux 64-bits. You do /not/ need to install a Lisp
implementation. It’s a 23MB binary.
To build the readline app, do:
: make build
To build the Tk GUI:
: make build-gui
then run
: ./torrents –help
: ./torrents-tk &
_Troubleshooting_
The Tk GUI needs [[https://notabug.org/cage/nodgui/][nodgui]] newer than march, 2019.
If a search doesn’t work with a =CRYPTO_num_locks= error message:
#+BEGIN_EXPORT ascii
> ./torrents matrix
searching ’(matrix)’ on 1337... no results.
error: The alien function "CRYPTO_num_locks" is undefined.
searching ’(matrix)’ on DOWNLOADSME... no results.
error: The alien function "CRYPTO_num_locks" is undefined.
#+END_EXPORT
You might need to upgrade your OpenSSL version. See [[https://gitlab.com/vindarel/cl-torrents/issues/5][this issue]].
** Usage
We can use this little app both in a Lisp REPL (Slime) and in a
terminal, as a command line tool or from its embedded interactive prompt.
Results are cached in =~/.cl-torrents/cache/=. Delete this
directory if you want new results.
*** Lisp REPL
Search for torrents:
#+BEGIN_SRC text
(use-package :torrents)
(search-torrents "matrix")
[...]
6: The Matrix Revolutions (2003) BRRip [Dual Audio] [Hindi+Eng]
5: Matrix (1999)Blu-Ray 720p Dublado PT-BR - mo93438
4: The Matrix Trilogy (1999-2003) BDRip 1080p Dual Audio [ Hind
3: The Matrix Trilogy (1999-2003) BluRay BDRip 1080p AC3
2: The Matrix Trilogy (1999-2003) + Extras 1080p BluRay x264 Du
1: The Matrix Reloaded (2003) FullHD, Dual Audio: English + Spa
0: Matrix FRENCH DVDRIP 1999 COOL
#+END_SRC
To help finding the most relevant results (the website sometimes is
a bit relaxed with our search terms), each keyword is printed in a
different color:
#+html: <p align="center"><img src="assets/img-colored-results.png" /></p>
(you need to enable ansi colors in Slime, see [[https://github.com/enriquefernandez/slime-repl-ansi-color][slime-repl-ansi-color]].
Disable this feature with =(setf cl-ansi-text:*enabled* nil)=)
We get a magnet link with:
#+BEGIN_SRC lisp
(magnet 0)
;; "magnet:?xt=urn:btih:40eca43690cf1b99b0a4d485ebf4855d20b0bac5"
#+END_SRC
We can open it with a torrent client (transmission-gtk by default):
#+BEGIN_SRC lisp
(download 0)
#+END_SRC
Download it with a remote client (only transmission-remote so far):
you need settings, see below. TODO
#+BEGIN_SRC lisp
;; in ~/.config/torrents.lisp
(setf *remote-client-url* "my.url.without.port")
(setf *remote-client-username* "transmission")
(setf *remote-client-password* "password")
;; port is 9091 by default.
#+END_SRC
#+BEGIN_SRC lisp
(remote-download 0)
#+END_SRC
And voilà :)
We may add more features, eventually. Our goal is rather to write a
tutorial to show you diverse Common Lisp topics.
**** Parameters
=*cache-p*=: if nil, don’t use the cache system.
*** Command line
Use the options given below,
#+BEGIN_SRC text
$ torrents -h
CL-torrents. Usage:
Available options:
-d, –details print more details (like the torrent’s url)
-h, –help print this help text
-i, –interactive enter an interactive repl
-m, –magnet ARG get the magnet link of the given search result.
-n, –nb ARG set the maximum number of results to print.
-o, –open INDEX download with a torrent client (transmission-gtk by default)
-v, –version print the version
#+END_SRC
Example: below we search for "matrix…", we display only 1 result and
we get the magnet link of the first result.
: $ torrents -n 1 matrix french 1999 cool -m 0
#+html: <p align=’center’><img src=’assets/img-cli.png’ /></p>
*** Readline interface
Start it with =torrents -i=.
See the =help= and the help of each command.
The available commands are (use the auto-completion):
- =search=: search for torrents, print the results sorted by number of seeders.
- =magnet <i>=, where /i/ is a result index,
- =open= or =firefox <i>=: open the given torrent page in a web browser
- =download <i>=: open a magnet link with a torrent client
(transmission-gtk by default)
- =filter <text>=: show results that have this text in their
title. This reduces the tab-completion of ids for all commands.
- =highlight= (and =unhighlight=): highlight the given words in
yellow, for this session.
- =url <i>=
- =nb-results= =n= to set the number of results to print to /n/
- =details=: toggle the display of details
- =quit= (or =C-c=)
And the available settings to change with =set= are (use =set=’s autocompletion):
- =*details*=: if true, print more details below each row (like the
url). Defaults to false.
- =*nb-results*=: how many results to print. Defaults to 20.
- =*browser*=: the browser name to use to open urls. Defaults to Firefox.
- =*torrent-client*=: the desktop torrent client name. Defaults to Transmission.
- =*cache-p*=: if true (the default), use the cached results.
You can also set them in a configuration file.
Note that we are in a regular [[https://tiswww.case.edu/php/chet/readline/readline.html#SEC9][readline]] interface, so the usual keybindings and
options are available. For example, Readline obeys the =~/.inputrc=
startup file. You can change the way the TAB key does completion:
: TAB: menu-complete
if you add this, the first press on TAB will insert the first
completion candidate (VS listing all the choices, and requiring a
second keypress). For cl-torrents, it is convenient because we can
enter the first result quickly: I typically do =search foo= then
=download TAB=.
Note: I found out that =C-x C-r= re-reads the inputrc file, so you can
try without quitting cl-torrents.
#+html: <p align=’center’><img src=’assets/img-readline.png’ /></p>
*** Configuration files (in development)
=cl-torrents= will read two configuration files. An ini-style one,
and a lispy one.
**** Ini-style config
First, it will search for a =~.torrents.conf= file
from =~/.config/.torrents.conf= and =~/.torrents.conf=. The last
one takes precedence.
For example, those are the default values:
#+BEGIN_SRC conf
[default]
scrapers = 1337 DOWNLOADSME
browser = firefox
nb-results = 20
cache-p = true # use the cache system.
#+END_SRC
Moreover, you can set parameters related to the repl:
#+BEGIN_SRC text
[default]
# again, default values:
confirm-exit = true # ask with a yes/no prompt before quiting the app.
verbose = false
history = true # use the repl history.
write-history = true # read the history, but don’t write to it.
#+END_SRC
You can set them for all replic-based apps in =~/.replic.conf=, or
override them in =.torrents.conf=.
/Note: we only use a "default" profile for now./
**** Lisp init file
If the file =~/.torrents.lisp= exists, it will be loaded after the
=.conf= one and before the command line arguments.
The option =–no-userinit= prevents it from loading.
You can write whatever you want there, it is just a lisp file that
will be =load=’ed at startup.
/Note/: what we will eventually do then is to expose cl-torrents’
mechanism via hooks.
**** Extending the app, creating commands
One thing you can do is define additional commands to be found at the
repl. We do so by following [[https://github.com/vindarel/replic/][replic]]’s mechanism:
- define functions inside the =torrents.user= package
- define the completion choices for some functions
- =export= the functions you want to see turned into
commands. =cl-torrents=, with the help of the =replic= library, will
automatically turn them into commands available at the application
prompt.
You can copy the example below in =~/.torrents.lisp= and re-run
=torrents -i= to try this out.
#+BEGIN_SRC lisp
(in-package :torrents.user)
(defparameter *names* ’()
"List of names (string) given to ‘hello‘. Will be autocompleted by ‘goodbye‘.")
(defun hello (name)
"Takes only one argument. Adds the given name to the global
‘*names*‘ global variable, used to complete arguments of ‘goodbye‘. "
(format t "hello ~a~&" name)
(push name *names*))
(defun goodbye (name)
"Says goodbye to name, where ‘name‘ should be completed from what was given to ‘hello‘."
(format t "goodbye ~a~&" name))
;; Custom completion for goodbye:
(replic.completion:add-completion "goodbye" (lambda () *names*))
;; and export the two functions to find them as commands.
(export ’(hello
goodbye))
#+END_SRC
** Ideas, todos
- [X] cache (on files) v0.3
- [X] CI
- use a local copy of TPB
- [X] build with ECL. Used [[https://hub.docker.com/r/daewok/lisp-devel/][the lisp-devel]] docker
image. Result: a 52Mo executable with a runtime error.
- [X] open an url
- download the torrent file
- [X] ini config file, to parse with [[https://common-lisp.net/project/py-configparser/][py-configparser]]
- [X] add torrent to a local torrent client
- [X] add the torrent to a remote transmission client, with
[[https://github.com/libre-man/cl-transmission/][cl-transmission]]. v0.12
- [X] self-contained web app ([[https://lispcookbook.github.io/cl-cookbook/scripting.html][doc]]). POC: [[https://github.com/vindarel/cl-torrents-web][cl-torrents-web]].
- [X] interactive prompt, with completion of commands.
** Release notes
[[https://gitlab.com/vindarel/cl-torrents/tags][https://gitlab.com/vindarel/cl-torrents/tags]]
*** WIP
- added: a simple Tk GUI (search, open in browser, download with
torrent desktop client).
*** v0.12
- june, 2021: added [[https://torrent-paradise.ml][torrents-paradise]] API.
*** v0.11
- november, 2019: added connection to transmission-remote
- added rarbg scraper (needs new tests)
- june, 2019: changed the location of the lisp init file from
=~/.torrents.lisp= to =~/.config/torrents.lisp=.
- added: a =filter= command, to only display results whose title
contains a given string. It reduces the TAB-completion of ids (but
doesn’t constrain it).
- added: all functions can now TAB-complete the list of ids.
- added: scrape and display torrents’ size.
- fixed =-d= cli arg.
- added: load =~/.torrents.lisp=, create new commands from the
=torrents.user= package.
- added the ability to read an ini-like config file,
=~/.torrents.conf=. All exported variables from the =:torrent= package
can be overriden. They are written without earmuffs:
#+BEGIN_SRC lisp
:*nb-results*
:*browser*
:*torrent-client*
:*cache-p*
#+END_SRC
gives
#+BEGIN_SRC text
# ~/.torrents.conf
# those are the defaults.
[default]
nb-results = 20
browser = firefox
torrent-client = firefox
cache-p = true
#+END_SRC
See more on replic.
(all parameters need more tests)
- added missing =-o= option to download with a torrent client (transmission-gtk).
- =cl-torrents.conf= configuration file:
- choose the list of scrapers.
- =download= command (open magnet link with transmission by default).
- use the [[https://github.com/vindarel/replic/][replic]] library to build the repl, the commands and their completions.
- -> new builtin =highlight= and =unhighlight= commands,
- -> better error handling (don’t exit the repl on an error).
- fix cli usage without a keyword search, print help.
*** v0.10
- added [[https://www.torrentdownloads.me][torrentdownloads.me]] scraper.
- new parameter, =*cache-p*=: if nil, don’t use the cache.
*** v0.9
- added [[http://1337x.to][1337x.to]] scraper.
- removed piratebay.to, katcr.co, torrent.cd, they’re down :/
*** v0.8
- added a readline-based repl with some commands: =search=, =magnet=,
=open=, with their completion. See =help=. Built with [[https://github.com/mrkkrp/cl-readline][cl-readline]],
but might use [[https://github.com/vindarel/replic][replic]] anytime soon.
*** v0.7
- fix cache not created by binary
- create cache in =~/.cl-torrents/cache/=
* Dev
Clone cl-torrents in =~/quicklisp/local-projects=,
now you can =(ql:quickload :torrents)=.
We use our [[https://github.com/vindarel/replic/][replic]] library to automatically build the readline repl.
Unit tests:
: make test
End-to-end tests (checking that the websites respond and our scrapers still work):
: make test-end2end
Try the Ltk GUI: load =gui-tk.lisp= and run =(main)=.
* Resources
Don’t miss these good resources:
- http://lisp-lang.org/
- [[Https://github.com/CodyReichert/awesome-cl][Awesome-cl]]
- [[https://lispcookbook.github.io/cl-cookbook/][the Common Lisp Cookbook]]
- http://quickdocs.org/
- (my) [[https://lisp-journey.gitlab.io/][lisp-journey]]: introductory posts, lists of resources, selection
of screencasts.
** Tutorial
*update, 2021*: this tutorial is one of the first things I wrote
when discovering CL and it probably bitrot a bit. I’d recommend the
Cookbook now as I ported most of its useful content there.
Writing a little web scraper like this one is not
difficult. However, I had to spend some time to find out the right
libraries and resources. It is also not trivial at first to start
a Lisp project. So the first thing we did is write a tutorial. It
is a mix of hopefully useful stuff:
- web scraping,
- async web scraping,
- trying out things at the REPL,
- where to find documentation,
- creating and loading a project,
- basic data structures and gotchas,
- some useful libraries,
- unit tests, with mocks, running tests from the shell, continuous integration,
- parsing command line arguments, creating executables, continuous delivery,
- basics of error handling,
- ...
It will eventually tackle more topics and features (more settings,
working with a local copy of TPB…) but in the meanwhile, read
the [[https://vindarel.github.io/cl-torrents/tutorial.html][tutorial]] !
It was built with https://github.com/fniessen/org-html-themes.
** Bypassing ISP blocking
Some Internet Service Providers block access to torrent sites, as it’s
the case in France. They currently don’t block the HTTP version of
torrents-paradise, but that one works on IPFS anyways. You can bypass
them by using other DNS servers than your ISP’s.
Here’s how to do it on Ubuntu: https://doc.ubuntu-fr.org/dns (french)
You can use [[https://www.opennic.org/][OpenNIC]] addresses or again the ones of the [[https://www.fdn.fr/actions/dns/][French Data Network]] association.
* Licence
MIT.
0.12.1
replic
(system).
x.let-star
(system).
cl-transmission
(system).
access
(system).
dexador
(system).
jonathan
(system).
plump
(system).
str
(system).
lparallel
(system).
cl-ansi-text
(system).
unix-opts
(system).
clache
(system).
mockingbird
(system).
lquery
(system).
py-configparser
(system).
cl-readline
(system).
parse-float
(system).
log4cl
(system).
src
(module).
Modules are listed depth-first from the system components tree.
torrents/src
torrents
(system).
utils.lisp
(file).
models.lisp
(file).
tpb.lisp
(file).
torrentcd.lisp
(file).
kat.lisp
(file).
1337.lisp
(file).
downloadsme.lisp
(file).
torrents-paradise.lisp
(file).
torrents.lisp
(file).
commands.lisp
(file).
config.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
torrents/torrents.asd
torrents/src/utils.lisp
torrents/src/models.lisp
torrents/src/tpb.lisp
torrents/src/torrentcd.lisp
torrents/src/kat.lisp
torrents/src/1337.lisp
torrents/src/downloadsme.lisp
torrents/src/torrents-paradise.lisp
torrents/src/torrents.lisp
torrents/src/commands.lisp
torrents/src/config.lisp
torrents/src/utils.lisp
src
(module).
exit
(function).
find-magnet-link
(function).
missing-arg
(function).
parse-size
(function).
sublist
(function).
unknown-option
(function).
when-option
(macro).
*colors*
(special variable).
*keywords*
(special variable).
arg-parser-failed
(function).
colorize-all-keywords
(function).
colorize-keyword-in-string
(function).
join-for-query
(function).
keyword-color-pairs
(function).
next-color
(function).
reset-color
(function).
torrents/src/models.lisp
src
(module).
format-size
(function).
href
(reader method).
(setf href)
(writer method).
leechers
(reader method).
(setf leechers)
(writer method).
magnet-link
(reader method).
(setf magnet-link)
(writer method).
make-torrent
(function).
print-object
(method).
seeders
(reader method).
(setf seeders)
(writer method).
size
(reader method).
(setf size)
(writer method).
size-unit
(reader method).
(setf size-unit)
(writer method).
source
(reader method).
(setf source)
(writer method).
title
(reader method).
(setf title)
(writer method).
torrent
(class).
torrents/src/tpb.lisp
src
(module).
tpb
.
torrents
(function).
*prefilter-selector*
(special variable).
*search-url*
(special variable).
*selectors*
(special variable).
request
(function).
result-href
(function).
result-leechers
(function).
result-peers
(function).
result-peers-or-leechers
(function).
result-title
(function).
torrents/src/torrentcd.lisp
src
(module).
torrents
(function).
*base-url*
(special variable).
*search-url*
(special variable).
parse
(function).
query
(function).
request
(function).
result-href
(function).
result-leechers
(function).
result-seeders
(function).
result-title
(function).
torrents/src/kat.lisp
src
(module).
kat
.
torrents
(function).
*base-url*
(special variable).
*results-selector*
(special variable).
*search-url*
(special variable).
parse
(function).
query
(function).
request
(function).
result-href
(function).
result-leechers
(function).
result-seeders
(function).
result-title
(function).
torrents/src/1337.lisp
src
(module).
torrents
(function).
*base-url*
(special variable).
*results-selector*
(special variable).
*search-results*
(special variable).
*search-url*
(special variable).
*source*
(special variable).
parse
(function).
query
(function).
request
(function).
result-href
(function).
result-leechers
(function).
result-seeders
(function).
result-size
(function).
result-title
(function).
torrents/src/downloadsme.lisp
src
(module).
torrents
(function).
*base-url*
(special variable).
*results-selector*
(special variable).
*search-results*
(special variable).
*search-url*
(special variable).
*source*
(special variable).
parse
(function).
query
(function).
request
(function).
result-href
(function).
result-leechers
(function).
result-seeders
(function).
result-size
(function).
result-title
(function).
torrents/src/torrents-paradise.lisp
src
(module).
torrents
(function).
*max-results*
(special variable).
*search-url*
(special variable).
*source-name*
(special variable).
*source-name-short*
(special variable).
get-magnet-link
(function).
request
(function).
torrents/src/torrents.lisp
src
(module).
*browser*
(special variable).
*cache-p*
(special variable).
*details*
(special variable).
*last-results*
(special variable).
*nb-results*
(special variable).
*remote-client-password*
(special variable).
*remote-client-url*
(special variable).
*remote-client-username*
(special variable).
*torrent-client*
(special variable).
async-torrents
(function).
browse
(function).
download
(function).
filter
(function).
magnet
(function).
magnet-link-from
(function).
main
(function).
remote-download
(function).
search-torrents
(function).
url
(function).
*cache-directory*
(special variable).
*commands*
(special variable).
*config-directory*
(special variable).
*ids-completion-list*
(special variable).
*keywords*
(special variable).
*keywords-colors*
(special variable).
*remote-client*
(special variable).
*remote-client-name*
(special variable).
*remote-clients-alist*
(special variable).
*scrapers-alist*
(special variable).
*store*
(special variable).
*torrent-clients-list*
(special variable).
*torrents-list*
(special variable).
*verbs*
(special variable).
*version*
(special variable).
assoc-value
(function).
browse-elt
(function).
common-prefix
(function).
create-remote-client
(function).
custom-complete
(function).
display-results
(function).
ensure-cache
(function).
ensure-cache-and-store
(function).
get-cached-results
(function).
instance
(reader method).
(setf instance)
(writer method).
looks-like-magnet-link-p
(function).
looks-like-url-p
(function).
name
(reader method).
(setf name)
(writer method).
process-options
(function).
remote-client
(class).
remote-client-add
(method).
remote-client-connect
(method).
request-details
(function).
save-results
(function).
select-completions
(function).
torrents/src/config.lisp
src
(module).
config-scrapers
(function).
Packages are listed by definition order.
torrents-asd
torrents
torrents.models
torrents.user
torrents.torrents-paradise
torrents.commands
tpb
torrentcd
torrents.utils
torrents.1337
kat
torrents.downloadsme
torrents
cl-ansi-text
.
clache
.
common-lisp
.
torrents.models
.
*browser*
(special variable).
*cache-p*
(special variable).
*details*
(special variable).
*last-results*
(special variable).
*nb-results*
(special variable).
*remote-client-password*
(special variable).
*remote-client-url*
(special variable).
*remote-client-username*
(special variable).
*torrent-client*
(special variable).
async-torrents
(function).
browse
(function).
download
(function).
filter
(function).
magnet
(function).
magnet-link-from
(function).
main
(function).
remote-download
(function).
search-torrents
(function).
url
(function).
*cache-directory*
(special variable).
*commands*
(special variable).
*config-directory*
(special variable).
*ids-completion-list*
(special variable).
*keywords*
(special variable).
*keywords-colors*
(special variable).
*remote-client*
(special variable).
*remote-client-name*
(special variable).
*remote-clients-alist*
(special variable).
*scrapers-alist*
(special variable).
*store*
(special variable).
*torrent-clients-list*
(special variable).
*torrents-list*
(special variable).
*verbs*
(special variable).
*version*
(special variable).
assoc-value
(function).
browse-elt
(function).
common-prefix
(function).
config-scrapers
(function).
create-remote-client
(function).
custom-complete
(function).
display-results
(function).
ensure-cache
(function).
ensure-cache-and-store
(function).
get-cached-results
(function).
instance
(generic reader).
(setf instance)
(generic writer).
looks-like-magnet-link-p
(function).
looks-like-url-p
(function).
name
(generic reader).
(setf name)
(generic writer).
process-options
(function).
remote-client
(class).
remote-client-add
(generic function).
remote-client-connect
(generic function).
request-details
(function).
save-results
(function).
select-completions
(function).
torrents.models
common-lisp
.
format-size
(function).
href
(generic reader).
(setf href)
(generic writer).
leechers
(generic reader).
(setf leechers)
(generic writer).
magnet-link
(generic reader).
(setf magnet-link)
(generic writer).
make-torrent
(function).
seeders
(generic reader).
(setf seeders)
(generic writer).
size
(generic reader).
(setf size)
(generic writer).
size-unit
(generic reader).
(setf size-unit)
(generic writer).
source
(generic reader).
(setf source)
(generic writer).
title
(generic reader).
(setf title)
(generic writer).
torrent
(class).
torrents.torrents-paradise
Search on torrents-paradise API.
common-lisp
.
torrents
(function).
*max-results*
(special variable).
*search-url*
(special variable).
*source-name*
(special variable).
*source-name-short*
(special variable).
get-magnet-link
(function).
request
(function).
tpb
common-lisp
.
torrents
(function).
*prefilter-selector*
(special variable).
*search-url*
(special variable).
*selectors*
(special variable).
request
(function).
result-href
(function).
result-leechers
(function).
result-peers
(function).
result-peers-or-leechers
(function).
result-title
(function).
torrentcd
common-lisp
.
torrents
(function).
*base-url*
(special variable).
*search-url*
(special variable).
parse
(function).
query
(function).
request
(function).
result-href
(function).
result-leechers
(function).
result-seeders
(function).
result-title
(function).
torrents.utils
common-lisp
.
parse-float
.
exit
(function).
find-magnet-link
(function).
missing-arg
(function).
parse-size
(function).
sublist
(function).
unknown-option
(function).
when-option
(macro).
*colors*
(special variable).
*keywords*
(special variable).
arg-parser-failed
(function).
colorize-all-keywords
(function).
colorize-keyword-in-string
(function).
join-for-query
(function).
keyword-color-pairs
(function).
next-color
(function).
reset-color
(function).
torrents.1337
common-lisp
.
torrents
(function).
*base-url*
(special variable).
*results-selector*
(special variable).
*search-results*
(special variable).
*search-url*
(special variable).
*source*
(special variable).
parse
(function).
query
(function).
request
(function).
result-href
(function).
result-leechers
(function).
result-seeders
(function).
result-size
(function).
result-title
(function).
kat
common-lisp
.
torrents
(function).
*base-url*
(special variable).
*results-selector*
(special variable).
*search-url*
(special variable).
parse
(function).
query
(function).
request
(function).
result-href
(function).
result-leechers
(function).
result-seeders
(function).
result-title
(function).
torrents.downloadsme
common-lisp
.
torrents
(function).
*base-url*
(special variable).
*results-selector*
(special variable).
*search-results*
(special variable).
*search-url*
(special variable).
*source*
(special variable).
parse
(function).
query
(function).
request
(function).
result-href
(function).
result-leechers
(function).
result-seeders
(function).
result-size
(function).
result-title
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Default browser, in case $BROWSER is not set.
If true, use the cache.
If true, print additional details (like the url).
Remembering the last search results.
Maximum number of search results to display.
Password to login to the remote client.
Full URL to connect to our remote torrent client. Set it along with the username and password in the lisp init file, ~/.config/torrents.lisp, which is loaded at startup.
Username to login to the remote client.
Default torrent client.
Call the scrapers in parallel and sort by seeders.
Open firefox to this search result’s url. Use from the repl.
Download with a torrent client.
Exit from Lisp. Return ‘status’ (0 by default).
Show results that have this text in their title.
This doesn’t change the list of last results.
The nice thing is that it changes the list of ids to complete, so using any command with tab completion afterwards is more practical, specially with 1 result remaining.
Return the firts href of the page that starts with ’magnet’.
parsed: plump node.
Print the size humanly, with its unit.
Search the magnet from last search’s ‘index”s result.
Extract the magnet link from a ‘torrent’ result.
Return the first href of the page that starts with ’magnet’.
Parse command line arguments, read the config files and call the program.
Try to parse this string to a float.
Return two values: the size (float) and the unit (string of MB, GB).
- ‘string’ looks like 703.9 MB.
Download with a remote torrent client, if we have the credentials
Search for torrents on the different sources and print the results, sorted by number of seeders.
Search for torrents on the different sources and print the results, sorted by number of seeders.
‘words’: a string (space-separated keywords) or a list of strings.
‘nb-results’: max number of results to print.
‘log-stream’: used in tests to capture (and ignore) some output.
‘cache’: if true (the default), read from the cache.
Select a sublist when end can be superior to the size of the list. Wrapper around subseq that fails with ’bouncing indices bad error’.
Search torrents.
Return a list of alists with title, href, and seeders.
Return a list of...
Return a list of...
Return the url from last search’s ‘index”s result.
The directory where cl-torrents stores its cache.
Functions to colorize text.
List of alist tuples, a verb and its doc, for completion on the REPL.
The directory to put configuration files.
The list of ids (index of search results) to use at the completion, when we want to filter it. They must be strings, not numbers.
List of keywords given as input by the user.
List of keywords given as input by the user.
alist associating a keyword with a color. See ‘keyword-color-pairs’.
Max number of results to return. To not clutter our output.
Call before we extract the search results.
The remote client we are connected to (instance of remote-client).
Name of the remote client we will connect to.
An alist that associates a remote client name (a string, taken from the user’s config file) and a function to create an instance of it.
CSS selector to get a list of items inside the search results.
CSS selector to get a list of items inside the search results.
CSS selector to get a list of items inside the search results.
Alist to associate a scraper name (str, for a user config) to its symbol function to call.
List of the last search results (plump nodes) (to eas e2e tests).
List of the last search results (plump nodes) (to eas e2e tests).
Base search API end point. KEYWORDS to be replaced by the search terms (a string with +-separated words).
Base search url. KEYWORDS to be replaced by the search terms (a string with +-separated words).
Base url for a search. A POST request is necessary to get sorted results by seeds
Base url for a search. Sorted by seeders
Base url for a search. Sorted by seeders
Base url for a search. Sorted by seeders
Source short name for human presentation.
Source short name for human presentation.
Human readable name of this source.
Short name to display data, for example in a 80-chars width window.
Cache. The directory must exist.
List of available torrent clients, along with the optional command line options.
List of scraper functions to call. Modified after reading the user’s conf files.
List of verbs for completion. Strings.
Colorize all the user’s search keywords in the given title. ‘kw-color’: list of pairs with a keyword and a color (function).
Colorize the given keyword in the title.
Keep the letters’ possible mixed up or down case.
‘color-f’: color function (cl-ansi-text).
Find the common prefix between strings.
Uses the built-in ‘mismatch’, that returns the position at which
the strings fail to match.
Example: ‘(str:common-prefix ’("foobar" "foozz"))‘ => "foo"
- items: list of strings
- Return: a string.
Filter the global ‘*scrapers-alist*‘ with the ‘scrapers‘ parameter in config. Return the list of torrent functions to search with.
Complete a symbol when the cursor is at the beginning of the prompt.
Results: list of plump nodes. We want to print a numbered list with the needed information (torrent title, the number of seeders,... Print at most *nb-results*.
From this ID, construct the magnet link.
From a string (space-separated words), return a +-separated string.
Associate each keyword with a different color and return a list of pairs.
At each call, return the next color of the list -and start over. Uses *colors*.
Post-process options that need it.
Here, get and set the scrapers list (they are read as a simple string).
Reading and setting options was done with replic.config:apply-config.
Wrapper around dex:get. Fetch an url.
Request to torrent.cd. POST request in order to get results sorted by seeders.
Get the html page of the given url. Mocked in unit tests.
Return the number of peers (int) of a search result (node: a plump node). index 0 => peers, index 1 => leechers.
Save results in cache.
Select all verbs from ‘list’ that start with ‘text’.
remote-client
)) ¶remote-client
)) ¶Here comes the real object of the remote client.
remote-client
)) ¶remote-client
)) ¶The name isn’t very important.
name
.
remote-client
) magnet/file) ¶remote-client
)) ¶""
:title
:seeders
:leechers
:size-unit
:magnet-link
:source
Jump to: | (
A B C D E F G H I J K L M N P Q R S T U W |
---|
Jump to: | (
A B C D E F G H I J K L M N P Q R S T U W |
---|
Jump to: | *
H I L M N S T |
---|
Jump to: | *
H I L M N S T |
---|
Jump to: | 1
C D F K M P R S T U |
---|
Jump to: | 1
C D F K M P R S T U |
---|