{"id":21616031,"url":"https://github.com/9beach/toke","last_synced_at":"2025-03-18T17:19:45.953Z","repository":{"id":143578034,"uuid":"616039532","full_name":"9beach/toke","owner":"9beach","description":"Aria2c command-line client written in Python.","archived":false,"fork":false,"pushed_at":"2024-05-05T11:34:40.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-24T20:45:53.208Z","etag":null,"topics":["aria2","aria2c","client","command-line","torrent"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/9beach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-19T12:50:08.000Z","updated_at":"2024-05-05T11:34:43.000Z","dependencies_parsed_at":"2023-07-25T05:15:28.125Z","dependency_job_id":null,"html_url":"https://github.com/9beach/toke","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Ftoke","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Ftoke/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Ftoke/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Ftoke/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9beach","download_url":"https://codeload.github.com/9beach/toke/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244267475,"owners_count":20425835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aria2","aria2c","client","command-line","torrent"],"created_at":"2024-11-24T22:13:24.971Z","updated_at":"2025-03-18T17:19:45.899Z","avatar_url":"https://github.com/9beach.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# toke\n[toke](https://github.com/9beach/toke) is a [aria2c](https://aria2.github.io)\ncommand-line client written in [Python](https://www.python.org).\n\n`toke` is mainly influenced by [diana](https://github.com/baskerville/diana).\nAlthough largely rewritten, you can easily feel the soul of `diana` in my code.\n\n## Installation\n\nFor _Microsoft Windows_ users, first\n[install Python](https://www.python.org/downloads/), and then just copy\n[toke](https://raw.githubusercontent.com/9beach/toke/main/toke)\nto your favorite directory. In UNIX-like OSes (MacOS, Linux, BSD), you can \ninstall `toke` in the following way:\n\n```\nsudo curl -L https://raw.githubusercontent.com/9beach/toke/main/toke -o /usr/local/bin/toke\nsudo chmod a+rx /usr/local/bin/toke\n```\n\nAt last, make your `.toke` file in your home directory. A typical `.toke` is\nlike this.\n\n```\n❯ cat ~/.toke\nhost: 192.123.134.244\nsecret: 9898\nport:6800\n```\n\nYou know what is this. If there is no `.toke` file, `toke` tries to read the\nenvironment variables, `TOKE_HOST`, `TOKE_PORT`, and `TOKE_SECRET`.\n\nFor `toke` to connect to your `aria2c`, you need to run `aria2c` in daemon mode,\ne.g, `aria2c --enable-rpc --rpc-listen-all`.\n\n## Usages\n\nFor _Microsoft Windows_ users, you need to type `python c:/path-to/toke` in\nCommand Prompt to run `toke`. But in all the usages below, I just type `toke`\nfor _OSX_ and _Linux_ users.\n\n```\n❯ toke\nUsage: toke ACTION [OPT] [...]\n\nActions\n    add [OPT ...] ITEM [...]    Download the given items (local or remote URLs \n                                to torrents, etc.).\n    list/l                      Print list of active downloads.\n    list-compact/lc             Print compact list of active downloads.\n    list-long/ll                Print long list of active downloads.\n    list-json/lj                Print JSON response of active downloads.\n    paused/p                    Print list of paused downloads.\n    paused-compact/pc           Print compact list of paused downloads.\n    paused-long/pl              Print long list of paused downloads.\n    paused-json/pj              Print JSON response of paused downloads.\n    stopped/s                   Print list of stopped downloads.\n    stopped-compact/sc          Print compact list of stopped downloads.\n    stopped-long/sl             Print long list of stopped downloads.\n    stopped-json/sj             Print JSON response of stopped downloads.\n    errors/e                    Print the list of errors.\n    files/f GID [...]           Print files of the given GIDs.\n    stats/st                    Print download bandwidth statistics.\n    show-options/so             Print global options of aria2.\n    change-options/co OPT [...] Change global options of aria2 dynamically.\n    clean/clear                 Stop seeding completed downloads.\n    forcerm GID [...]           Forcibly remove downloads of the given GIDs.\n    pause GID [...]             Pause the downloads of the given GIDs.\n    purge/pg                    Clear the list of stopped downloads and errors.\n    resume/re GID [...]         Resume the downloads of the given GIDs.\n    stop/remove/rm GID [...]    Remove the downloads of the given GIDs.\n    sleep                       Pause all the active downloads.\n    wake                        Resume all the paused downloads.\n    shutdown                    Shut down aria2.\n\nExamples\n    toke list\n    toke lc\n    toke add /path-to/file.torrent \"magnet:?xt=urn:btih:FFC7E738EAA4CD4EC...\"\n    toke add :dir=/mnt/mov :select-file=1,3-5 /path-to/file.torrent\n    toke add :out=dad.png \"https://my-webserver/pic/IMG_0422.png\"\n    toke pause 9ba47a7aa365473f cdacca57aef44ec6\n    toke co :max-tries=6 :max-concurrent-downloads=50\n    toke files f81834e2c0d8d02f 615c023cf658b2a4\n\nFor more information on OPT in `change-options` and `add` actions, please see\n\u003chttp://aria2.github.io/manual/en/html/aria2c.html#aria2.changeGlobalOption\u003e\nand \u003chttp://aria2.github.io/manual/en/html/aria2c.html#aria2.addTorrent\u003e.\n```\n\n```\n❯ toke add sintel.torrent\nadded: b8aaa40985558c64\n```\n\n```\n❯ toke add *torrent\nadded: 0ad16a169a3f4278\nadded: e2d09371458ab4ab\nadded: 41654d88bcb56854\n```\n\n```\n❯ toke list\n 12.6G\t 90.5%\t   n/a\t  0KB/s\tMy.Mysterious.Movies.1978.1080...-HELLO[myworld]\n263.6M\t 40.7%\t   40s\t3.9MB/s\tBig Buck Bunny\n210.6M\t 57.9%\t   27s\t3.3MB/s\tCosmos Laundromat\n123.3M\t 99.8%\t    5s\t 40KB/s\tSintel\n```\n\n```\n❯ toke list-compact\n 12.6G\t 90.5%\t   n/a\t  0KB/s\tMy.Mysterious.M...ELLO[myworld] 05b8b08a5d847095\n263.6M\t 40.7%\t   40s\t3.9MB/s\tBig Buck Bunny                  4ec9cb9e0912eaac\n210.6M\t 57.9%\t   27s\t3.3MB/s\tCosmos Laundromat               05b8b08a5d847095\n123.3M\t 99.8%\t    5s\t 40KB/s\tSintel                          e2d09371458ab4ab\n```\n\n```\n❯ toke files 05b8b08a5d847095 4ec9cb9e0912eaac\n05b8b08a5d847095:\n[X]  1  100.0%  /Torrents/incompletes/Cosmos Laundromat/Cosmos Laundromat.en.srt\n[X]  2  100.0%  /Torrents/incompletes/Cosmos Laundromat/Cosmos Laundromat.es.srt\n[X]  3  100.0%  /Torrents/incompletes/Cosmos Laundromat/Cosmos Laundromat.fr.srt\n[X]  4  100.0%  /Torrents/incompletes/Cosmos Laundromat/Cosmos Laundromat.it.srt\n[X]  5  100.0%  /Torrents/incompletes/Cosmos Laundromat/Cosmos Laundromat.mp4\n[X]  6  100.0%  /Torrents/incompletes/Cosmos Laundromat/poster.jpg\n4ec9cb9e0912eaac:\n[X]  1  100.0%  /Torrents/incompletes/Big Buck Bunny/Big Buck Bunny.en.srt\n[X]  2  100.0%  /Torrents/incompletes/Big Buck Bunny/Big Buck Bunny.mp4\n[X]  3  100.0%  /Torrents/incompletes/Big Buck Bunny/poster.jpg\n```\n\n```\n❯ toke stats\ndownload: 25MB/s, upload: 0KB/s, active: 4, stopped: 0, waiting: 0\n```\n\nFinishing downloads, you can check the downloaded files.\n\n```\n❯ toke stopped\n123.3M\t100.0%\t   n/a\t  0KB/s\tSintel\n210.6M\t100.0%\t   n/a\t  0KB/s\tCosmos Laundromat\n263.6M\t100.0%\t   n/a\t  0KB/s\tBig Buck Bunny\n```\n\nYou can easily get to know what the usages below are.\n\n```\ntoke list\ntoke lc\ntoke add /path-to/file.torrent \"magnet:?xt=urn:btih:FFC7E738EAA4CD4EC...\"\ntoke add :dir=/mnt/mov :select-file=1,3-5 /path-to/file.torrent\ntoke add :out=dad.png \"https://my-webserver/pic/IMG_0422.png\"\ntoke pause 9ba47a7aa365473f cdacca57aef44ec6\ntoke resume 9ba47a7aa365473f cdacca57aef44ec6\ntoke co :max-tries=6 :max-concurrent-downloads=50\ntoke files f81834e2c0d8d02f 615c023cf658b2a4\n```\n\nYou can change downloading file name with `:out=new-name` when you `toke add`.\n\n```\ntoke add :out=dad.png \"https://my-webserver/pic/IMG_0422.png\"\n```\n\nYou can change temporary downloading directory with `:dir=new-destination`\nwhen you `toke add`. And also you can specify the files to download like this,\n`:select-file=1,3-5`.\n\n```\ntoke add :dir=/mnt/mov :select-file=1,3-5 /path-to/file.torrent\n```\n\nYou can change `max-concurrent-downloads` and `max-tries` options of `aria2c`\ndynamically with `toke change-options`. But when you restart `aria2c`, it\nrecovers the original options in `aria2.conf`.\n\n```\ntoke change-options :max-tries=6 :max-concurrent-downloads=50\n```\n\nYou can list all the global options of `aria2c` with the command\n`toke show-options`.\n\nFor more information on OPT (variable with colon prefix, i.e., the global\noptions of `aria2c`) in `change-options` and `add` actions, please see\n\u003chttp://aria2.github.io/manual/en/html/aria2c.html#aria2.changeGlobalOption\u003e\nand \u003chttp://aria2.github.io/manual/en/html/aria2c.html#aria2.addTorrent\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9beach%2Ftoke","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9beach%2Ftoke","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9beach%2Ftoke/lists"}