Skip to content

Instantly share code, notes, and snippets.

@gridhead
Created April 21, 2022 13:28
Show Gist options
  • Save gridhead/22f5be275dcb0b3eb108f2a82d5eafcb to your computer and use it in GitHub Desktop.
Save gridhead/22f5be275dcb0b3eb108f2a82d5eafcb to your computer and use it in GitHub Desktop.
Aria2c Python Usage with XMLRPC
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "19a7770a-d48f-4e92-bc1e-5991609bde9a",
"metadata": {},
"outputs": [],
"source": [
"#aria2c --enable-rpc=true --rpc-listen-port=6800 --rpc-secret=hello"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "538e6695-bce8-44c7-a9e6-483cc9927732",
"metadata": {},
"outputs": [],
"source": [
"from xmlrpc import client\n",
"from pprint import pprint"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "a0565beb-f8ea-413a-817a-432af8442d06",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<ServerProxy for localhost:6800/rpc>\n"
]
}
],
"source": [
"s = client.ServerProxy(\"http://localhost:6800/rpc\")\n",
"print(s)"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "6bac7a7a-d8be-4096-93df-a104b16742c6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'7f1a4cb1c4e9c021'\n"
]
}
],
"source": [
"a = s.aria2.addUri(\"token:hello\", [\"http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso\"])\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "53bd5ef8-81ca-4769-9aea-0c5953e278df",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'bitfield': 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n",
" 'completedLength': '228687872',\n",
" 'connections': '1',\n",
" 'dir': '/home/t0xic0der',\n",
" 'downloadSpeed': '3860914',\n",
" 'files': [{'completedLength': '228589568',\n",
" 'index': '1',\n",
" 'length': '864366592',\n",
" 'path': '/home/t0xic0der/archlinux-2022.04.05-x86_64.1.iso',\n",
" 'selected': 'true',\n",
" 'uris': [{'status': 'used',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}],\n",
" 'gid': 'ac9832584bd72588',\n",
" 'numPieces': '825',\n",
" 'pieceLength': '1048576',\n",
" 'status': 'active',\n",
" 'totalLength': '864366592',\n",
" 'uploadLength': '0',\n",
" 'uploadSpeed': '0'}\n"
]
}
],
"source": [
"a = s.aria2.tellStatus(\"token:hello\", \"ac9832584bd72588\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "29ff479f-3a68-4edf-8b51-208153f7812d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'index': '1',\n",
" 'servers': [{'currentUri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso',\n",
" 'downloadSpeed': '3500155',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}]\n"
]
}
],
"source": [
"a = s.aria2.getServers(\"token:hello\", \"60c1f15532479f3c\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "0a6687dd-faec-4494-9fba-78285dca65e8",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'bitfield': 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n",
" 'completedLength': '440025088',\n",
" 'connections': '1',\n",
" 'dir': '/home/t0xic0der',\n",
" 'downloadSpeed': '4481780',\n",
" 'files': [{'completedLength': '439353344',\n",
" 'index': '1',\n",
" 'length': '864366592',\n",
" 'path': '/home/t0xic0der/archlinux-2022.04.05-x86_64.1.iso',\n",
" 'selected': 'true',\n",
" 'uris': [{'status': 'used',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}],\n",
" 'gid': 'ac9832584bd72588',\n",
" 'numPieces': '825',\n",
" 'pieceLength': '1048576',\n",
" 'status': 'active',\n",
" 'totalLength': '864366592',\n",
" 'uploadLength': '0',\n",
" 'uploadSpeed': '0'},\n",
" {'bitfield': 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n",
" 'completedLength': '326041600',\n",
" 'connections': '1',\n",
" 'dir': '/home/t0xic0der',\n",
" 'downloadSpeed': '4111196',\n",
" 'files': [{'completedLength': '325058560',\n",
" 'index': '1',\n",
" 'length': '864366592',\n",
" 'path': '/home/t0xic0der/archlinux-2022.04.05-x86_64.1.iso',\n",
" 'selected': 'true',\n",
" 'uris': [{'status': 'used',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}],\n",
" 'gid': '60c1f15532479f3c',\n",
" 'numPieces': '825',\n",
" 'pieceLength': '1048576',\n",
" 'status': 'active',\n",
" 'totalLength': '864366592',\n",
" 'uploadLength': '0',\n",
" 'uploadSpeed': '0'}]\n"
]
}
],
"source": [
"a = s.aria2.tellActive(\"token:hello\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "485ba7e5-91bd-42b9-8044-45c7a74ac457",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'bitfield': 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80',\n",
" 'completedLength': '864366592',\n",
" 'connections': '0',\n",
" 'dir': '/home/t0xic0der',\n",
" 'downloadSpeed': '0',\n",
" 'errorCode': '0',\n",
" 'errorMessage': '',\n",
" 'files': [{'completedLength': '864366592',\n",
" 'index': '1',\n",
" 'length': '864366592',\n",
" 'path': '/home/t0xic0der/archlinux-2022.04.05-x86_64.iso',\n",
" 'selected': 'true',\n",
" 'uris': [{'status': 'used',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}],\n",
" 'gid': '9475dde884ebbf12',\n",
" 'numPieces': '825',\n",
" 'pieceLength': '1048576',\n",
" 'status': 'complete',\n",
" 'totalLength': '864366592',\n",
" 'uploadLength': '0',\n",
" 'uploadSpeed': '0'},\n",
" {'bitfield': 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80',\n",
" 'completedLength': '864366592',\n",
" 'connections': '0',\n",
" 'dir': '/home/t0xic0der',\n",
" 'downloadSpeed': '0',\n",
" 'errorCode': '0',\n",
" 'errorMessage': '',\n",
" 'files': [{'completedLength': '864366592',\n",
" 'index': '1',\n",
" 'length': '864366592',\n",
" 'path': '/home/t0xic0der/archlinux-2022.04.05-x86_64.1.iso',\n",
" 'selected': 'true',\n",
" 'uris': [{'status': 'used',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}],\n",
" 'gid': 'ac9832584bd72588',\n",
" 'numPieces': '825',\n",
" 'pieceLength': '1048576',\n",
" 'status': 'complete',\n",
" 'totalLength': '864366592',\n",
" 'uploadLength': '0',\n",
" 'uploadSpeed': '0'},\n",
" {'bitfield': 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80',\n",
" 'completedLength': '864366592',\n",
" 'connections': '0',\n",
" 'dir': '/home/t0xic0der',\n",
" 'downloadSpeed': '0',\n",
" 'errorCode': '0',\n",
" 'errorMessage': '',\n",
" 'files': [{'completedLength': '864366592',\n",
" 'index': '1',\n",
" 'length': '864366592',\n",
" 'path': '/home/t0xic0der/archlinux-2022.04.05-x86_64.1.iso',\n",
" 'selected': 'true',\n",
" 'uris': [{'status': 'used',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}],\n",
" 'gid': '60c1f15532479f3c',\n",
" 'numPieces': '825',\n",
" 'pieceLength': '1048576',\n",
" 'status': 'complete',\n",
" 'totalLength': '864366592',\n",
" 'uploadLength': '0',\n",
" 'uploadSpeed': '0'},\n",
" {'bitfield': 'ffffffffffffff80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n",
" 'completedLength': '60604416',\n",
" 'connections': '0',\n",
" 'dir': '/home/t0xic0der',\n",
" 'downloadSpeed': '0',\n",
" 'errorCode': '31',\n",
" 'errorMessage': '',\n",
" 'files': [{'completedLength': '59768832',\n",
" 'index': '1',\n",
" 'length': '864366592',\n",
" 'path': '/home/t0xic0der/archlinux-2022.04.05-x86_64.2.iso',\n",
" 'selected': 'true',\n",
" 'uris': [{'status': 'used',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}],\n",
" 'gid': 'eb65122bf5998f32',\n",
" 'numPieces': '825',\n",
" 'pieceLength': '1048576',\n",
" 'status': 'removed',\n",
" 'totalLength': '864366592',\n",
" 'uploadLength': '0',\n",
" 'uploadSpeed': '0'},\n",
" {'bitfield': 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n",
" 'completedLength': '243990528',\n",
" 'connections': '0',\n",
" 'dir': '/home/t0xic0der',\n",
" 'downloadSpeed': '0',\n",
" 'errorCode': '31',\n",
" 'errorMessage': '',\n",
" 'files': [{'completedLength': '243269632',\n",
" 'index': '1',\n",
" 'length': '864366592',\n",
" 'path': '/home/t0xic0der/archlinux-2022.04.05-x86_64.2.iso',\n",
" 'selected': 'true',\n",
" 'uris': [{'status': 'used',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}],\n",
" 'gid': '24c0b1ef9eeb4483',\n",
" 'numPieces': '825',\n",
" 'pieceLength': '1048576',\n",
" 'status': 'removed',\n",
" 'totalLength': '864366592',\n",
" 'uploadLength': '0',\n",
" 'uploadSpeed': '0'}]\n"
]
}
],
"source": [
"a = s.aria2.tellStopped(\"token:hello\", 0, 10)\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "75e66879-a56f-45a3-b5fe-72b4fdf73af9",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'allow-overwrite': 'false',\n",
" 'allow-piece-length-change': 'false',\n",
" 'always-resume': 'true',\n",
" 'async-dns': 'true',\n",
" 'auto-file-renaming': 'true',\n",
" 'auto-save-interval': '60',\n",
" 'bt-detach-seed-only': 'false',\n",
" 'bt-enable-hook-after-hash-check': 'true',\n",
" 'bt-enable-lpd': 'false',\n",
" 'bt-force-encryption': 'false',\n",
" 'bt-hash-check-seed': 'true',\n",
" 'bt-load-saved-metadata': 'false',\n",
" 'bt-max-open-files': '100',\n",
" 'bt-max-peers': '55',\n",
" 'bt-metadata-only': 'false',\n",
" 'bt-min-crypto-level': 'plain',\n",
" 'bt-remove-unselected-file': 'false',\n",
" 'bt-request-peer-speed-limit': '51200',\n",
" 'bt-require-crypto': 'false',\n",
" 'bt-save-metadata': 'false',\n",
" 'bt-seed-unverified': 'false',\n",
" 'bt-stop-timeout': '0',\n",
" 'bt-tracker-connect-timeout': '60',\n",
" 'bt-tracker-interval': '0',\n",
" 'bt-tracker-timeout': '60',\n",
" 'check-certificate': 'true',\n",
" 'check-integrity': 'false',\n",
" 'conditional-get': 'false',\n",
" 'conf-path': '/home/t0xic0der/.config/aria2/aria2.conf',\n",
" 'connect-timeout': '60',\n",
" 'console-log-level': 'notice',\n",
" 'content-disposition-default-utf8': 'false',\n",
" 'continue': 'false',\n",
" 'daemon': 'false',\n",
" 'deferred-input': 'false',\n",
" 'dht-file-path': '/home/t0xic0der/.cache/aria2/dht.dat',\n",
" 'dht-file-path6': '/home/t0xic0der/.cache/aria2/dht6.dat',\n",
" 'dht-listen-port': '6881-6999',\n",
" 'dht-message-timeout': '10',\n",
" 'dir': '/home/t0xic0der',\n",
" 'disable-ipv6': 'false',\n",
" 'disk-cache': '16777216',\n",
" 'download-result': 'default',\n",
" 'dry-run': 'false',\n",
" 'dscp': '0',\n",
" 'enable-color': 'true',\n",
" 'enable-dht': 'true',\n",
" 'enable-dht6': 'false',\n",
" 'enable-http-keep-alive': 'true',\n",
" 'enable-http-pipelining': 'false',\n",
" 'enable-mmap': 'false',\n",
" 'enable-peer-exchange': 'true',\n",
" 'enable-rpc': 'true',\n",
" 'event-poll': 'epoll',\n",
" 'file-allocation': 'prealloc',\n",
" 'follow-metalink': 'true',\n",
" 'follow-torrent': 'true',\n",
" 'force-save': 'false',\n",
" 'ftp-pasv': 'true',\n",
" 'ftp-reuse-connection': 'true',\n",
" 'ftp-type': 'binary',\n",
" 'hash-check-only': 'false',\n",
" 'help': '#basic',\n",
" 'http-accept-gzip': 'false',\n",
" 'http-auth-challenge': 'false',\n",
" 'http-no-cache': 'false',\n",
" 'human-readable': 'true',\n",
" 'keep-unfinished-download-result': 'true',\n",
" 'listen-port': '6881-6999',\n",
" 'log-level': 'debug',\n",
" 'lowest-speed-limit': '0',\n",
" 'max-concurrent-downloads': '5',\n",
" 'max-connection-per-server': '1',\n",
" 'max-download-limit': '0',\n",
" 'max-download-result': '1000',\n",
" 'max-file-not-found': '0',\n",
" 'max-mmap-limit': '9223372036854775807',\n",
" 'max-overall-download-limit': '0',\n",
" 'max-overall-upload-limit': '0',\n",
" 'max-resume-failure-tries': '0',\n",
" 'max-tries': '5',\n",
" 'max-upload-limit': '0',\n",
" 'metalink-enable-unique-protocol': 'true',\n",
" 'metalink-preferred-protocol': 'none',\n",
" 'min-split-size': '20971520',\n",
" 'min-tls-version': 'TLSv1.2',\n",
" 'netrc-path': '/home/t0xic0der/.netrc',\n",
" 'no-conf': 'false',\n",
" 'no-file-allocation-limit': '5242880',\n",
" 'no-netrc': 'false',\n",
" 'optimize-concurrent-downloads': 'false',\n",
" 'parameterized-uri': 'false',\n",
" 'pause-metadata': 'false',\n",
" 'peer-agent': 'aria2/1.35.0',\n",
" 'peer-id-prefix': 'A2-1-35-0-',\n",
" 'piece-length': '1048576',\n",
" 'proxy-method': 'get',\n",
" 'quiet': 'false',\n",
" 'realtime-chunk-checksum': 'true',\n",
" 'remote-time': 'false',\n",
" 'remove-control-file': 'false',\n",
" 'retry-wait': '0',\n",
" 'reuse-uri': 'true',\n",
" 'rlimit-nofile': '1024',\n",
" 'rpc-allow-origin-all': 'false',\n",
" 'rpc-listen-all': 'false',\n",
" 'rpc-listen-port': '6800',\n",
" 'rpc-max-request-size': '2097152',\n",
" 'rpc-save-upload-metadata': 'true',\n",
" 'rpc-secure': 'false',\n",
" 'save-not-found': 'true',\n",
" 'save-session-interval': '0',\n",
" 'seed-ratio': '1.0',\n",
" 'server-stat-timeout': '86400',\n",
" 'show-console-readout': 'true',\n",
" 'show-files': 'false',\n",
" 'socket-recv-buffer-size': '0',\n",
" 'split': '5',\n",
" 'stderr': 'false',\n",
" 'stop': '0',\n",
" 'stream-piece-selector': 'default',\n",
" 'summary-interval': '60',\n",
" 'timeout': '60',\n",
" 'truncate-console-readout': 'true',\n",
" 'uri-selector': 'feedback',\n",
" 'use-head': 'false',\n",
" 'user-agent': 'aria2/1.35.0'}\n"
]
}
],
"source": [
"a = s.aria2.getGlobalOption(\"token:hello\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "b63e1e6e-a67b-4afe-a5ca-c38d77155ba8",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'OK'\n"
]
}
],
"source": [
"a = s.aria2.changeGlobalOption(\"token:hello\", {\"max-download-limit\": \"20K\"})\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "5c97bc42-2491-4eb2-9ed2-1e07699613ac",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'7f1a4cb1c4e9c021'\n"
]
}
],
"source": [
"a = s.aria2.remove(\"token:hello\", \"7f1a4cb1c4e9c021\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "e6e256e7-caf6-47b1-9039-877b033acab9",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'7a11fa864f41b793'\n"
]
}
],
"source": [
"a = s.aria2.pause(\"token:hello\", \"7a11fa864f41b793\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "8882b26c-e8df-4834-85fb-477973b2bcd5",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'completedLength': '864366592',\n",
" 'index': '1',\n",
" 'length': '864366592',\n",
" 'path': '/home/t0xic0der/archlinux-2022.04.05-x86_64.iso',\n",
" 'selected': 'true',\n",
" 'uris': [{'status': 'used',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'},\n",
" {'status': 'waiting',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}]\n"
]
}
],
"source": [
"a = s.aria2.getFiles(\"token:hello\", \"9475dde884ebbf12\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "a0eb82b8-bb47-4039-8ead-3c7ee5484db2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[{'index': '1',\n",
" 'servers': [{'currentUri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso',\n",
" 'downloadSpeed': '5635280',\n",
" 'uri': 'http://mirror.rackspace.com/archlinux/iso/2022.04.05/archlinux-2022.04.05-x86_64.iso'}]}]\n"
]
}
],
"source": [
"a = s.aria2.getServers(\"token:hello\", \"24c0b1ef9eeb4483\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "6b7f2e03-5a1d-4224-aee3-9b1bc29de4ce",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[]\n"
]
}
],
"source": [
"a = s.aria2.tellWaiting(\"token:hello\", 0, 10)\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "080a7da8-6bcf-464e-a46d-418750c1a8e5",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'allow-overwrite': 'false',\n",
" 'allow-piece-length-change': 'false',\n",
" 'always-resume': 'true',\n",
" 'async-dns': 'true',\n",
" 'auto-file-renaming': 'true',\n",
" 'bt-enable-hook-after-hash-check': 'true',\n",
" 'bt-enable-lpd': 'false',\n",
" 'bt-force-encryption': 'false',\n",
" 'bt-hash-check-seed': 'true',\n",
" 'bt-load-saved-metadata': 'false',\n",
" 'bt-max-peers': '55',\n",
" 'bt-metadata-only': 'false',\n",
" 'bt-min-crypto-level': 'plain',\n",
" 'bt-remove-unselected-file': 'false',\n",
" 'bt-request-peer-speed-limit': '51200',\n",
" 'bt-require-crypto': 'false',\n",
" 'bt-save-metadata': 'false',\n",
" 'bt-seed-unverified': 'false',\n",
" 'bt-stop-timeout': '0',\n",
" 'bt-tracker-connect-timeout': '60',\n",
" 'bt-tracker-interval': '0',\n",
" 'bt-tracker-timeout': '60',\n",
" 'check-integrity': 'false',\n",
" 'conditional-get': 'false',\n",
" 'connect-timeout': '60',\n",
" 'content-disposition-default-utf8': 'false',\n",
" 'continue': 'false',\n",
" 'dir': '/home/t0xic0der',\n",
" 'dry-run': 'false',\n",
" 'enable-http-keep-alive': 'true',\n",
" 'enable-http-pipelining': 'false',\n",
" 'enable-mmap': 'false',\n",
" 'enable-peer-exchange': 'true',\n",
" 'file-allocation': 'prealloc',\n",
" 'follow-metalink': 'true',\n",
" 'follow-torrent': 'true',\n",
" 'force-save': 'false',\n",
" 'ftp-pasv': 'true',\n",
" 'ftp-reuse-connection': 'true',\n",
" 'ftp-type': 'binary',\n",
" 'hash-check-only': 'false',\n",
" 'http-accept-gzip': 'false',\n",
" 'http-auth-challenge': 'false',\n",
" 'http-no-cache': 'false',\n",
" 'lowest-speed-limit': '0',\n",
" 'max-connection-per-server': '1',\n",
" 'max-download-limit': '0',\n",
" 'max-file-not-found': '0',\n",
" 'max-mmap-limit': '9223372036854775807',\n",
" 'max-resume-failure-tries': '0',\n",
" 'max-tries': '5',\n",
" 'max-upload-limit': '0',\n",
" 'metalink-enable-unique-protocol': 'true',\n",
" 'metalink-preferred-protocol': 'none',\n",
" 'min-split-size': '20971520',\n",
" 'no-file-allocation-limit': '5242880',\n",
" 'no-netrc': 'false',\n",
" 'parameterized-uri': 'false',\n",
" 'pause-metadata': 'false',\n",
" 'piece-length': '1048576',\n",
" 'proxy-method': 'get',\n",
" 'realtime-chunk-checksum': 'true',\n",
" 'remote-time': 'false',\n",
" 'remove-control-file': 'false',\n",
" 'retry-wait': '0',\n",
" 'reuse-uri': 'true',\n",
" 'rpc-save-upload-metadata': 'true',\n",
" 'save-not-found': 'true',\n",
" 'seed-ratio': '1.0',\n",
" 'split': '5',\n",
" 'stream-piece-selector': 'default',\n",
" 'timeout': '60',\n",
" 'uri-selector': 'feedback',\n",
" 'use-head': 'false',\n",
" 'user-agent': 'aria2/1.35.0'}\n"
]
}
],
"source": [
"a = s.aria2.getOption(\"token:hello\", \"9475dde884ebbf12\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "50811ddd-a2cd-4afa-b974-5ebecc2f14b8",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'OK'\n"
]
}
],
"source": [
"a = s.aria2.changeOption(\"token:hello\", \"248a5f07b0da8fcf\", {\"max-download-limit\": \"20K\"})\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 38,
"id": "081fe865-69fb-408c-a6c5-3faeb05ad6f4",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'downloadSpeed': '0',\n",
" 'numActive': '0',\n",
" 'numStopped': '6',\n",
" 'numStoppedTotal': '6',\n",
" 'numWaiting': '0',\n",
" 'uploadSpeed': '0'}\n"
]
}
],
"source": [
"a = s.aria2.getGlobalStat(\"token:hello\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "499ad70a-1223-442c-a934-9786800514a0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'OK'\n"
]
}
],
"source": [
"a = s.aria2.purgeDownloadResult(\"token:hello\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "c960db45-9866-4c7d-a69b-fc12f4b34d1a",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'OK'\n"
]
}
],
"source": [
"a = s.aria2.removeDownloadResult(\"token:hello\", \"7f1a4cb1c4e9c021\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 44,
"id": "6a5f0b43-2ee0-4671-961e-4d21cbb8b7b9",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'enabledFeatures': ['Async DNS',\n",
" 'BitTorrent',\n",
" 'Firefox3 Cookie',\n",
" 'GZip',\n",
" 'HTTPS',\n",
" 'Message Digest',\n",
" 'Metalink',\n",
" 'XML-RPC'],\n",
" 'version': '1.35.0'}\n"
]
}
],
"source": [
"a = s.aria2.getVersion(\"token:hello\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 45,
"id": "22342527-fa14-4df6-aa7d-022522adf84c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'sessionId': 'bd4ef7f4bd9966e52a9e8ba5949d5df82ce7e81d'}\n"
]
}
],
"source": [
"a = s.aria2.getSessionInfo(\"token:hello\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 46,
"id": "a3f4d022-6a28-4508-ac57-6baa26347c5e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"'OK'\n"
]
}
],
"source": [
"a = s.aria2.shutdown(\"token:hello\")\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 47,
"id": "2ea824d6-8b6d-410c-902f-a2486b1f2894",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['aria2.addUri',\n",
" 'aria2.addTorrent',\n",
" 'aria2.getPeers',\n",
" 'aria2.addMetalink',\n",
" 'aria2.remove',\n",
" 'aria2.pause',\n",
" 'aria2.forcePause',\n",
" 'aria2.pauseAll',\n",
" 'aria2.forcePauseAll',\n",
" 'aria2.unpause',\n",
" 'aria2.unpauseAll',\n",
" 'aria2.forceRemove',\n",
" 'aria2.changePosition',\n",
" 'aria2.tellStatus',\n",
" 'aria2.getUris',\n",
" 'aria2.getFiles',\n",
" 'aria2.getServers',\n",
" 'aria2.tellActive',\n",
" 'aria2.tellWaiting',\n",
" 'aria2.tellStopped',\n",
" 'aria2.getOption',\n",
" 'aria2.changeUri',\n",
" 'aria2.changeOption',\n",
" 'aria2.getGlobalOption',\n",
" 'aria2.changeGlobalOption',\n",
" 'aria2.purgeDownloadResult',\n",
" 'aria2.removeDownloadResult',\n",
" 'aria2.getVersion',\n",
" 'aria2.getSessionInfo',\n",
" 'aria2.shutdown',\n",
" 'aria2.forceShutdown',\n",
" 'aria2.getGlobalStat',\n",
" 'aria2.saveSession',\n",
" 'system.multicall',\n",
" 'system.listMethods',\n",
" 'system.listNotifications']\n"
]
}
],
"source": [
"a = s.system.listMethods()\n",
"pprint(a)"
]
},
{
"cell_type": "code",
"execution_count": 48,
"id": "352cb334-1e15-4967-b151-19357adabdc9",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['aria2.onDownloadStart',\n",
" 'aria2.onDownloadPause',\n",
" 'aria2.onDownloadStop',\n",
" 'aria2.onDownloadComplete',\n",
" 'aria2.onDownloadError',\n",
" 'aria2.onBtDownloadComplete']\n"
]
}
],
"source": [
"a = s.system.listNotifications()\n",
"pprint(a)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment