python3-aria2jsonrpc

2014-04-26 16:16 UTC
  • Xyne

Metadata

Description:

A wrapper class around Aria2's JSON RPC interface.

Latest Version:

2014

Architecture:

  • any

Dependencies:

  • python3

Arch Repositories:

  • [xyne-any]
  • [xyne-i686]
  • [xyne-x86_64]

AUR ID:

72150

Arch Forum ID:

173377

Tags:

About

Aria2JsonRpc is a Python 3 module that provides a wrapper class around Aria2's RPC interface. It can be used to build applications that use Aria2 for downloading data.

See the pydoc page for a quick overview of the module.

Included Tools

a2jrg

A command-line tool for URI queuing and basic server querying and management. The name is short for Aria2JsonRpcGet.

a2jrg-scrape

A command-line tool for scraping URIs from a webpage, with regular expression filtering. It is somewhat similar to Firefox's DownThemAll extension.

Other Tools

aria2rpc

aria2rpc is a launcher script for the Aria2 RPC server. Use it as a starting point for your own launcher scripts.

Usage

aria2rpc <port> <session file> [aria2c args]

<port> is the port on which the server will listen (and the same that you will pass to a2jrg). <session file> is an Aria2 session file which will permit session resumption if the server is shut down. This file will be created automatically. It is a simple text file.

a2jrg Help Message

$ a2jrg --help

usage: a2jrg [-h] [-a ADDRESS] [-p PORT] [-s SCHEME] [--token TOKEN]
             [--server-cert SERVER_CERT] [--client-cert CLIENT_CERT]
             [--client-cert-password CLIENT_CERT_PASSWORD] [-o ...]
             [--pause-all] [--unpause-all] [--purge] [-w] [-i INTERVAL]
             [--status]
             [<URI> [<URI> ...]]

Queue downloads via the Aria2 RPC interface.

positional arguments:
  <URI>                 File URIs. These must all point to the same file.

optional arguments:
  -h, --help            show this help message and exit

server options:
  -a ADDRESS, --address ADDRESS
                        The server host. Default: localhost.
  -p PORT, --port PORT  The server port. Default: 6800.
  -s SCHEME, --scheme SCHEME
                        The server scheme. Default: http.
  --token TOKEN         Secret RPC token.
  --server-cert SERVER_CERT
                        HTTPS server certificate file, in PEM format.
  --client-cert CLIENT_CERT
                        HTTPS client certificate file, in PEM format.
  --client-cert-password CLIENT_CERT_PASSWORD
                        Prompt for a client certificate password.

download options:
  -o ..., --options ...
                        Aria2 options as key-value pairs separated by "=".

commands:
  --pause-all           Pause all downloads.
  --unpause-all         Unpause all downloads.
  --purge               Purge download results.

other options:
  -w, --wait            Wait for the download to finish
  -i INTERVAL, --interval INTERVAL
                        Status query interval while waiting, in seconds.
                        Default: 1.
  --status              Print global status report.

a2jrg-scrape Help Message

$ a2jrg-scrape --help

usage: a2jrg-scrape [-h] [-r REGEX] [--ignore-links] [--ignore-images]
                    [--same SAME] [-a ADDRESS] [-p PORT] [-s SCHEME]
                    [--token TOKEN] [--server-cert SERVER_CERT]
                    [--client-cert CLIENT_CERT]
                    [--client-cert-password CLIENT_CERT_PASSWORD] [-o ...]
                    uri <output dir>

Scrape URIs from a web page and download them with Aria2.

positional arguments:
  uri                   The URI to scrape.
  <output dir>          The output directory.

optional arguments:
  -h, --help            show this help message and exit
  -r REGEX, --regex REGEX
                        Regular expresssion for filtering URIs.
  --ignore-links        Ignore links.
  --ignore-images       Ignore images.
  --same SAME           Indicate that all URIs point to the same file.

server options:
  -a ADDRESS, --address ADDRESS
                        The server host. Default: localhost.
  -p PORT, --port PORT  The server port. Default: 6800.
  -s SCHEME, --scheme SCHEME
                        The server scheme. Default: http.
  --token TOKEN         Secret RPC token.
  --server-cert SERVER_CERT
                        HTTPS server certificate file, in PEM format.
  --client-cert CLIENT_CERT
                        HTTPS client certificate file, in PEM format.
  --client-cert-password CLIENT_CERT_PASSWORD
                        Prompt for a client certificate password.

download options:
  -o ..., --options ...
                        Aria2 options as key-value pairs separated by "=".

CHANGELOG

2014-04-26

  • added support for secret RPC token
  • preemptively removed support for HTTP digest authentication

2013-11-24

  • moved reusable code from a2jrg to module
  • added a2jrg-scrape
Contact
echo xyne.archlinux.ca | sed 's/\./@/'
Feeds
Blog News
Validation
XHTML 1.0 Strict CSS level 3 Atom 1.0