Toru, the command line tool designed for anime enthusiasts. Browse the latest releases on nyaa.si or search for specific titles with Toru's intuitive interface. Stream episodes directly from the command line using MPV or your favorite video player or browser. Toru serves the selected anime over localhost, making it as accessible as any HTTP link. It also functions as a convenient torrent client for magnet links. Simplify your streaming and torrenting with Toru.
https://github.com/sweetbbak/toru/assets/75046310/4a2a8c2e-3a11-4771-b79e-66e4de77a8b8
Quick install a pre-built binary
export PREFIX="$HOME/bin"
wget "https://github.com/sweetbbak/toru/releases/download/v0.1/toru_$(uname -s)_$(uname -m).tar.gz" -O - | tar -xz
mv toru "${PREFIX}"
on Windows
iwr -Uri "https://github.com/sweetbbak/toru/releases/download/v0.1/toru_Windows_x86_64.zip" -OutFile toru_Windows_x86_64.zip
With Nix
nix profile install github:sweetbbak/toru
go install github.com/sweetbbak/toru/cmd/toru@latest
if you are on nix or have nix installed you can just use the shell.nix directly and run just
or make
Search for an anime:
toru search -j "one piece" # outputs json
toru search -i "one piece" # search interactively with fzf
the selected torrent will begin playing and once the video player is closed you will have the option to select another episode, make another search query, or to exit.
toru search --latest
toru search "Akuyaku"
If you know the magnet link for the content you can directly download or stream it
toru stream --magnet 'magnet:?xt=urn:btih:1...announce'
toru download --magnet 'magnet:?xt=urn:btih:1...announce'
All of the above outputs a link that you can use to stream the torrent 'http://localhost:8080/stream?ep=torrent_info_hash'
you can treat this link like any other http link and stream it with mpv
or vlc
, download it, use yt-dlp
, or open it in the browser etc...
this can be helpful for geoblocking and for browsing "special" Nyaa sites
toru search --proxy="https://sukebei.nyaa.si" -i
toru search --proxy="https://nyaa.ink.iss" -i
You can use toru to search for anime and other media types and then output the results in multiple formats.
Output in Json and parsing that output with jq
:
toru search --latest --json | jq -r '.[]|.Name,.Magnet'
toru search --json "one piece" > cache.json
toru search --from-json cache.json --interactive
toru search "akuyaku 99 1080p"
# Outputs:
[Erai-raws] Akuyaku Reijou Level 99 - 01 [1080p][Multiple Subtitle] [ENG][POR-BR][SPA-LA][SPA][ARA][FRE][GER][ITA][RUS]
2024-01-09 07:36:29
Downloads: 1203
[33|0]
Size: 727 MB
magnet:... [ magnet link here ]
# Create a JSON file using toru
toru search --latest --json > out.json
# Here is a simple example of using fzf and toru to create a simple interace to select and play torrents
# you can also replace toru with any CLI bittorrent client
cat out.json | jq '.[].Name' | \
fzf --preview='cat out.json | jq -r ".[{n}]"' \
--bind "enter:become(cat out.json | jq -r '.[{n}].Magnet')" | \
xargs toru stream --magnet
ZSH
installing bash completions
Copy the file _toru
from the completions
directory into your $FPATH
echo $FPATH | sed "s/:/\n/g"
to see a list of directories in your $FPATH
run this command in an interactive shell or put this command in your .zshrc
source <(toru init --zsh)
BASH
installing bash completions
Place the file _toru_bash
from the completions
directory into your completions path
run this command in an interactive shell or put it in your .bashrc
source <(toru init --bash)
[!IMPORTANT]\ toru is in a very early development phase! In order to provide a consistent and smooth experience the CLI interface is subject to change. PR's and advice on project sturcture, pkg organization and feedback on the UI of toru is much appreciated.
Currently tested on Linux, Mac and Windows I would much appreciate someone reporting on the functionality on any BSD, or any other niche device or architecture Android with termux currently has UDP issues. Idk much about how android works
2024-05-21
2024-03-1
--proxy
which allows use of nyaa proxy sites and sukebinyaa.si
Fork it!
Create your feature branch: git checkout -b my-new-feature
Commit your changes: git commit -m 'Add some feature'
Push to the branch: git push origin my-new-feature
Submit a pull request 🤘
PR's welcome! This project currently uses Golang 1.22.2
make sure to format go files using gofmt
and alejandra
for nix. I'm likely to reject PR's that are directly to main unless they are small
or are regarding typos, the readme or documentation.
Because scraping is annoying af and it constantly breaks. On top of that, someone is paying for those servers. Torrents are more resistant to takedowns and hopefully will have more longevity.
torrenting library:
Nyaa package is modified from here:
Consider creating a PR, taking up a minor issue on the TODO list, leaving an issue to help improve functionality or buy me a coffee!