{"id":28601361,"url":"https://github.com/metaory/nyaa-cli","last_synced_at":"2025-07-28T20:11:06.938Z","repository":{"id":297312956,"uuid":"996217994","full_name":"metaory/nyaa-cli","owner":"metaory","description":"🚧 Download episodes in bulk from nyaa.si","archived":false,"fork":false,"pushed_at":"2025-06-04T22:40:10.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-05T02:54:26.433Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/metaory.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,"zenodo":null}},"created_at":"2025-06-04T16:16:37.000Z","updated_at":"2025-06-04T22:40:12.000Z","dependencies_parsed_at":"2025-06-05T02:55:56.288Z","dependency_job_id":null,"html_url":"https://github.com/metaory/nyaa-cli","commit_stats":null,"previous_names":["metaory/nyaa-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/metaory/nyaa-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fnyaa-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fnyaa-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fnyaa-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fnyaa-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metaory","download_url":"https://codeload.github.com/metaory/nyaa-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fnyaa-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267578003,"owners_count":24110351,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-06-11T15:01:17.588Z","updated_at":"2025-07-28T20:11:06.933Z","avatar_url":"https://github.com/metaory.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003enyaa-cli\u003c/h1\u003e\n    \u003cimg src=\".github/logo.svg\" alt=\"nyaa-cli\" width=\"128\" height=\"128\"\u003e\n    \u003ch4\u003eSmart anime torrent fetcher with stateful episode tracking\u003c/h4\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e |\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e |\n  \u003ca href=\"#usage-patterns\"\u003ePatterns\u003c/a\u003e |\n  \u003ca href=\"#example-workflow\"\u003eWorkflow\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Requirements\n\n- `Bash 5.0+`\n- `jq`\n- `curl`\n- `Go` _(needed for first-time installation of `pup`)_\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBash 5+ (macOS users only)\u003c/strong\u003e\u003c/summary\u003e\n\nThis script requires \u003cstrong\u003eBash 5.0 or later\u003c/strong\u003e.\n\nOn macOS, the default \u003ccode\u003e/bin/bash\u003c/code\u003e is too old.  \nInstall the latest Bash with Homebrew:\n\n```sh\nbrew install bash\n```\n\nThen, either:\n- Run the script with the full path:\n  ```sh\n  /opt/homebrew/bin/bash ./nyaa-cli ...\n  ```\n- Or, add Homebrew Bash to your PATH (Apple Silicon):\n  ```sh\n  echo 'export PATH=\"/opt/homebrew/bin:$PATH\"' \u003e\u003e ~/.zshrc\n  source ~/.zshrc\n  ```\n  (For Intel Macs, use \u003ccode\u003e/usr/local/bin\u003c/code\u003e)\n\nCheck your Bash version:\n```sh\nbash --version\n```\nIt should say `5.x` or later\n\n\u003c/details\u003e\n\n---\n\n## Installation\n\n```sh\n# clone the repository\ngit clone https://github.com/metaory/nyaa-cli.git\ncd nyaa-cli\n\n# make the script executable\nchmod +x nyaa-cli\n\n# symlink the script to somewhere in $PATH\nsudo ln -sf \"$(pwd)/nyaa-cli\" /usr/local/bin/nyaa-cli\n```\n\n## Usage\n\n```dart\nnyaa-cli :: Smart anime torrent fetcher with stateful episode tracking\n\nOptions:\n  -n, --name      Anime name (required)\n  -e, --episode   Download a single episode\n  -f, --from      Starting episode (exclusive with -e)\n  -t, --to        Ending episode (optional, with -f)\n  -q, --quality   Video quality (default: 720)\n  -u, --uploader  Uploader filter (e.g. Erai, SubsPlease)\n  -o, --output    Output directory (default: ./output)\n  -h, --help      Show this help message\n\nNotes:\n  • -f and -e cannot be used together\n  • -f without -t downloads all episodes from start\n  • Not specifying -u picks highest seeder\n```\n\n\n### Examples\n\n```bash\n# Basic usage - continues from last downloaded episode\nnyaa-cli --name \"one piece\"\n\n# Download a specific episode\nnyaa-cli --name \"one piece\" --episode 120\n\n# Download all episodes from a starting point\nnyaa-cli --name \"one piece\" --from 120\n\n# Download a specific range of episodes\nnyaa-cli --name \"one piece\" --from 120 --to 130\n\n# Additional options\nnyaa-cli --name \"one piece\" --from 120 --quality \"720\"\nnyaa-cli --name \"one piece\" --from 120 --uploader \"Erai\"\n```\n\n---\n\n\u003cdiv align=\"center\"\u003e\n   \u003cimg src=\".github/demos/auto-continue.gif\" alt=\"Auto-Continue\"\u003e\n   \u003cp\u003eContinue downloading from last tracked episode\u003c/p\u003e\n\u003c/div\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eMore Demos\u003c/strong\u003e\u003c/summary\u003e\n\u003cdiv align=\"center\"\u003e\n   \u003cdiv\u003e\n      \u003ch3\u003eSingle Episode\u003c/h3\u003e\n      \u003cimg src=\".github/demos/single-episode.gif\" alt=\"Single Episode\" width=\"90%\"\u003e\n      \u003cp\u003eDownload a specific episode by number\u003c/p\u003e\n   \u003c/div\u003e\n   \u003chr\u003e\n   \u003cdiv\u003e\n      \u003ch3\u003eEpisode Range\u003c/h3\u003e\n      \u003cimg src=\".github/demos/range.gif\" alt=\"Episode Range\" width=\"90%\"\u003e\n      \u003cp\u003eDownload multiple episodes within a range\u003c/p\u003e\n   \u003c/div\u003e\n   \u003chr\u003e\n   \u003cdiv\u003e\n      \u003ch3\u003eFrom Episode\u003c/h3\u003e\n      \u003cimg src=\".github/demos/from-episode.gif\" alt=\"From\" width=\"90%\"\u003e\n      \u003cp\u003eDownload all episodes from a starting point\u003c/p\u003e\n   \u003c/div\u003e\n\u003c/div\u003e\n\u003c/details\u003e\n\n---\n\n\u003cdetails id=\"usage-patterns\"\u003e\n\u003csummary\u003e\u003cstrong\u003eUsage Patterns\u003c/strong\u003e\u003c/summary\u003e\n\nThe script supports four main usage patterns:\n\n1. **Continue from Last Episode** (`--name` only)\n   - Automatically continues from the last downloaded episode\n   - If no previous episodes found, starts from episode 1\n   - Uses state file to track progress\n\n2. **Single Episode** (`--episode`)\n   - Downloads a specific episode\n   - Cannot be used with `--from` or `--to`\n   - Example: `--episode 120`\n\n3. **From Episode to Present** (`--from` without `--to`)\n   - Downloads all available episodes from the starting point\n   - Continues until no more episodes are found\n   - Example: `--from 120`\n\n4. **Episode Range** (`--from` and `--to`)\n   - Downloads episodes within a specific range\n   - `--to` must be greater than `--from`\n   - Example: `--from 120 --to 130`\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eState Management\u003c/strong\u003e\u003c/summary\u003e\n\nThe script maintains a state file at `~/.local/state/nyaa-cli/progress` to track the last downloaded episode for each anime. The state file is a TSV (Tab-Separated Values) file where:\n\n- First column: Normalized anime name\n- Second column: Last downloaded episode number\n\nExample state file:\n```\none+piece\t1278\nsolo+leveling\t18\n```\n\nThe state is automatically updated whenever an episode is downloaded, and is used to:\n- Continue from the last downloaded episode when no episode is specified\n- Track progress across multiple runs\n- Start from episode 1 for new anime\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails id=\"example-workflow\"\u003e\n\u003csummary\u003e\u003cstrong\u003eExample Workflow\u003c/strong\u003e\u003c/summary\u003e\n\nYou can use `nyaa-cli` to automate your anime downloads with a torrent client that supports directory watching. For example, with **rtorrent**, you can configure it to watch a directory for new `.torrent` files. When a torrent file is placed there, rtorrent will automatically start downloading it.\n\nA typical workflow:\n\n1. Configure your torrent client (e.g., rtorrent) to watch a directory (e.g., `~/watch/torrents`).\n\n2. Create a script to download new episodes (e.g., `~/bin/update-anime.sh`):\n   ```sh\n   #!/bin/bash\n   \n   # Update One Piece\n   nyaa-cli --name \"one piece\" --output ~/watch/torrents\n   \n   # Update Solo Leveling\n   nyaa-cli --name \"solo leveling\" --output ~/watch/torrents\n   ```\n\n3. Make the script executable:\n   ```sh\n   chmod +x ~/bin/update-anime.sh\n   ```\n\n4. Add a weekly cronjob to run the script (e.g., every Sunday at 2 AM):\n   ```sh\n   # Edit crontab\n   crontab -e\n   \n   # Add this line\n   0 2 * * 0 ~/bin/update-anime.sh\n   ```\n\nThe script will:\n- Use the state file to automatically continue from the last downloaded episode\n- Download new episodes if available\n- Save torrent files with normalized filenames (lowercase, no spaces, no special characters)\n- Your torrent client will pick up the new files and start downloading automatically\n\nMany other torrent clients also support directory watching for automation.\n\n\u003c/details\u003e\n\n---\n\n## License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaory%2Fnyaa-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetaory%2Fnyaa-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaory%2Fnyaa-cli/lists"}