{"id":24769606,"url":"https://github.com/sweetbbak/toru","last_synced_at":"2025-05-16T11:04:55.390Z","repository":{"id":221279500,"uuid":"753931918","full_name":"sweetbbak/toru","owner":"sweetbbak","description":"Bittorrent streaming CLI tool. Stream anime torrents, real-time with no waiting for downloads. ","archived":false,"fork":false,"pushed_at":"2024-10-24T18:15:13.000Z","size":6201,"stargazers_count":332,"open_issues_count":1,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-12T08:17:25.050Z","etag":null,"topics":["anime","bittorrent","cli","torrent","webrtc"],"latest_commit_sha":null,"homepage":"","language":"Go","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/sweetbbak.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":"2024-02-07T04:00:40.000Z","updated_at":"2025-04-01T03:32:42.000Z","dependencies_parsed_at":"2024-03-02T02:28:27.095Z","dependency_job_id":"8fb455e5-a238-4763-afd3-c5abd6ece957","html_url":"https://github.com/sweetbbak/toru","commit_stats":null,"previous_names":["sweetbbak/toru"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetbbak%2Ftoru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetbbak%2Ftoru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetbbak%2Ftoru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetbbak%2Ftoru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sweetbbak","download_url":"https://codeload.github.com/sweetbbak/toru/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"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":["anime","bittorrent","cli","torrent","webrtc"],"created_at":"2025-01-29T03:00:29.117Z","updated_at":"2025-05-16T11:04:50.375Z","avatar_url":"https://github.com/sweetbbak.png","language":"Go","funding_links":["https://www.buymeacoffee.com/sweetbabyalaska"],"categories":["\u003ca name=\"torrent\"\u003e\u003c/a\u003eTorrent"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/toru.png\" /\u003e\n\u003cbr\u003e\n\u003ca href=\"http://makeapullrequest.com\"\u003e\u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"#Linux\"\u003e\u003cimg src=\"https://img.shields.io/badge/os-linux-brightgreen\"\u003e\n\u003ca href=\"#MacOS\"\u003e\u003cimg src=\"https://img.shields.io/badge/os-mac-brightgreen\"\u003e\n\u003ca href=\"#Android\"\u003e\u003cimg src=\"https://img.shields.io/badge/os-android-brightgreen\"\u003e\n\u003ca href=\"#Windows\"\u003e\u003cimg src=\"https://img.shields.io/badge/os-windows-yellowgreen\"\u003e\n\u003ca href=\"#Steam-deck\"\u003e\u003cimg src=\"https://img.shields.io/badge/os-steamdeck-yellow\"\u003e\n\u003cbr\u003e\n\u003ca href=\"https://www.buymeacoffee.com/sweetbabyalaska\"\u003e\u003cimg src=\"https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge\u0026logo=buy-me-a-coffee\u0026logoColor=black\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003e\nToru: Stream Torrents instantly, straight from the Command Line\n\u003c/h3\u003e\n\nToru, 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.\nToru 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.\n\nhttps://github.com/sweetbbak/toru/assets/75046310/4a2a8c2e-3a11-4771-b79e-66e4de77a8b8\n\n## Table of Contents\n\n- [Install](#install)\n- [Example Usage](#examples)\n- [Contribution Guidelines](./CONTRIBUTING.md)\n- [Disclaimer](./disclaimer.md)\n\n## Install\n\nQuick install a pre-built binary\n\n```sh\nexport PREFIX=\"$HOME/bin\"\nwget \"https://github.com/sweetbbak/toru/releases/download/v0.1/toru_$(uname -s)_$(uname -m).tar.gz\" -O - | tar -xz\nmv toru \"${PREFIX}\"\n```\n\non Windows\n\n```pwsh\niwr -Uri \"https://github.com/sweetbbak/toru/releases/download/v0.1/toru_Windows_x86_64.zip\" -OutFile toru_Windows_x86_64.zip\n```\n\nWith Nix\n\n```sh\nnix profile install github:sweetbbak/toru\n```\n\n\u003cdetails closed\u003e\n  \u003csummary\u003eInstall Go\u003c/summary\u003e\n  \u003ca href=\"https://go.dev/doc/install\"\u003eInstall go\u003c/a\u003e\n  This project requires go 1.21.7 or higher.\n\u003c/details\u003e\n\n```sh\ngo install github.com/sweetbbak/toru/cmd/toru@latest\n```\n\n\u003cdetails closed\u003e\n  \u003csummary\u003eBuild from source\u003c/summary\u003e\n\nusing Go is recommended alongside `gup` so that it can be easily updated\n\n```sh\ngit clone https://github.com/sweetbbak/toru.git \u0026\u0026 cd toru\ngo build -o toru ./cmd/toru\n```\n\nyou can also use the justfile\n\n```sh\ngit clone https://github.com/sweetbbak/toru.git \u0026\u0026 cd toru\njust\n```\n\nor the makefile\n\n```sh\ngit clone https://github.com/sweetbbak/toru.git \u0026\u0026 cd toru\nmake build\n```\n\nUsing `docker`, `podman` with the `shell.nix` file on non-nixOS distros\nthis will automatically pull the correct version of Go and install `just`\nso that building is easy.\n\n```sh\ngit clone https://github.com/sweetbbak/toru.git \u0026\u0026 cd toru\n# mount the project directory inside the container\npodman run --volume $(pwd):/toru -ti docker.io/nixos/nix:latest\n# inside the container run:\ncd /toru\nnix-shell\njust\n```\n\n### Building for different platforms and architectures\n\nRun to find your target architecture and platform:\n\n```sh\ngo tool dist list\n```\n\nthen use the environment variables `GOOS` and `GOARCH` before using\nthe build command.\n\nExample:\n\n```sh\nGOOS=linux GOARCH=arm64 go build -o toru ./cmd/toru\n```\n\n_If you do this_ feel free to create an issue for a platform reporting how it went\nSo far there is an issue with android and termux as well as arm 6.\n\n\u003c/details\u003e\n\nif you are on nix or have nix installed you can just use the shell.nix directly and run `just` or `make`\n\n## Examples\n\nSearch for an anime:\n\n```sh\ntoru search -j \"one piece\" # outputs json\ntoru search -i \"one piece\" # search interactively with fzf\n```\n\n![example of toru in progress](assets/search.png)\n\nthe selected torrent will begin playing and once the video player is closed\nyou will have the option to select another episode, make another search query,\nor to exit.\n\n#### _View_ the latest anime on nyaa.si in an interactive fzf session\n\n```sh\ntoru search --latest\n```\n\n#### Search for a specific keyword or series\n\n```sh\ntoru search \"Akuyaku\"\n```\n\nIf you know the magnet link for the content you can directly download or stream it\n\n```sh\ntoru stream --magnet 'magnet:?xt=urn:btih:1...announce'\ntoru download --magnet 'magnet:?xt=urn:btih:1...announce'\n```\n\nAll of the above outputs a link that you can use to stream the torrent `'http://localhost:8080/stream?ep=torrent_info_hash'`\nyou 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...\n\n#### Use a proxy Nyaa site\n\nthis can be helpful for geoblocking and for browsing \"special\" Nyaa sites\n\n```sh\ntoru search --proxy=\"https://sukebei.nyaa.si\" -i\ntoru search --proxy=\"https://nyaa.ink.iss\" -i\n```\n\n### Handling input and output\n\nYou can use toru to search for anime and other media types and then output the results in multiple formats.\nOutput in Json and parsing that output with `jq`:\n\n```sh\ntoru search --latest --json | jq -r '.[]|.Name,.Magnet'\n```\n\n#### Open a cached search session from a json file\n\n```sh\ntoru search --json \"one piece\" \u003e cache.json\ntoru search --from-json cache.json --interactive\n```\n\n#### Output in a human readable format:\n\n```sh\ntoru search \"akuyaku 99 1080p\"\n# Outputs:\n[Erai-raws] Akuyaku Reijou Level 99 - 01 [1080p][Multiple Subtitle] [ENG][POR-BR][SPA-LA][SPA][ARA][FRE][GER][ITA][RUS]\n2024-01-09 07:36:29\nDownloads: 1203\n[33|0]\nSize: 727 MB\nmagnet:... [ magnet link here ]\n\n```\n\n### Creating your own CLI tool using toru\n\n```sh\n# Create a JSON file using toru\ntoru search --latest --json \u003e out.json\n# Here is a simple example of using fzf and toru to create a simple interace to select and play torrents\n# you can also replace toru with any CLI bittorrent client\ncat out.json | jq '.[].Name' | \\\nfzf --preview='cat out.json | jq -r \".[{n}]\"' \\\n  --bind \"enter:become(cat out.json | jq -r '.[{n}].Magnet')\" | \\\n  xargs toru stream --magnet\n```\n\n### Shell completions\n\n_ZSH_\n\ninstalling bash completions\n\n- Copy the file `_toru` from the `completions` directory into your `$FPATH`\n\n  - `echo $FPATH | sed \"s/:/\\n/g\"` to see a list of directories in your `$FPATH`\n\n- run this command in an interactive shell or put this command in your `.zshrc`\n\n```bash\nsource \u003c(toru init --zsh)\n```\n\n_BASH_\n\ninstalling bash completions\n\n- Place the file `_toru_bash` from the `completions` directory into your completions path\n\n- run this command in an interactive shell or put it in your `.bashrc`\n\n```bash\nsource \u003c(toru init --bash)\n```\n\n\u003e [!IMPORTANT]\\\n\u003e toru is in a very early development phase! In order to provide a consistent and smooth experience\n\u003e the CLI interface is subject to change. PR's and advice on project sturcture, pkg organization and\n\u003e feedback on the UI of toru is much appreciated.\n\u003e\n\u003e Currently tested on Linux, Mac and Windows\n\u003e I would much appreciate someone reporting on the functionality on any BSD, or any other niche device or architecture\n\u003e Android with termux currently has UDP issues. Idk much about how android works\n\n## Features\n\n- [x] Stream anime from torrents\n- [x] add Nyaa.si as a source\n- [ ] add a generic torrent tracker library for Korean and American movies\n- [ ] package as various formats (AUR, DEB, Flatpak, AppImage, Release binaries)\n- [ ] ensure compatibility across platforms and aim for consistent compatibility (should work but currently untested)\n\n## Changelog\n\n2024-05-21\n\n- added zsh and bash completions\n- support multi-file torrents\n\n2024-03-1\n\n- added `--proxy` which allows use of nyaa proxy sites and sukebi\n- added the ability to disable ipv6\n- sub-command \"run\" now accepts a trailing search term argument\n\n## Good issues to work on\n\n- [ ] add a package for your distro\n- [ ] fix race condition in UI between progress bar and fzf interface when searching interactively\n\n## Roadmap\n\n- Daemonize into the background and listen for commands on a socket (optional for user, sometimes this is annoying)\n- Simple torrent client features (download|seed|add magnet|stream|search)\n- Add other trackers besides `nyaa.si`\n- Expand user interface with bubbletea\n\n## Contributing\n\n    Fork it!\n    Create your feature branch: git checkout -b my-new-feature\n    Commit your changes: git commit -m 'Add some feature'\n    Push to the branch: git push origin my-new-feature\n    Submit a pull request 🤘\n\nPR's welcome! This project currently uses Golang 1.22.2\nmake 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\nor are regarding typos, the readme or documentation.\n\n## Why though?\n\nBecause scraping is annoying af and it constantly breaks. On top of that, _someone_ is paying for those servers.\nTorrents are more resistant to takedowns and hopefully will have more longevity.\n\n## Credits\n\ntorrenting library:\n![anacrolix/torrent](https://github.com/anacrolix/torrent)\n\nNyaa package is modified from here:\n![Feyko/nyaa-go](https://github.com/Feyko/nyaa-go)\n\n## Support\n\nConsider creating a PR, taking up a minor issue on the TODO list, leaving an issue to help improve functionality or buy\nme a coffee!\n\n![moe-visitor-counter](https://count.getloli.com/get/@sweetbbak?theme=asoul)\n![moe](https://camo.githubusercontent.com/dbf5b38242697e9e50ac56f3d6dfec3a65057129fa1dde5d89afdd1a6e876ffe/68747470733a2f2f636f756e742e6765746c6f6c692e636f6d2f6765742f4073776565746262616b3f7468656d653d61736f756c)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsweetbbak%2Ftoru","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsweetbbak%2Ftoru","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsweetbbak%2Ftoru/lists"}