Skip to content

Commit

Permalink
Changed program to be a CLI for nyaa.si
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvictorfs committed Nov 17, 2019
1 parent 281c254 commit 7431796
Show file tree
Hide file tree
Showing 10 changed files with 220 additions and 275 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 140
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,11 @@ dmypy.json

# Local settings
settings.json
downloaded.json
downloaded.json

# Editor files
.idea/
.vscode/

# Local
Anime/
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# nyaa-cli

A CLI for downloading Anime from https://nyaa.si making use of their RSS Feed and [python-libtorrent](https://github.com/arvidn/libtorrent/blob/RC_1_2/docs/python_binding.rst)

---

![image](https://user-images.githubusercontent.com/37747572/69002323-bb2ea100-08cb-11ea-9b47-20bd9870c8c0.png)

![image](https://user-images.githubusercontent.com/37747572/69002293-33e12d80-08cb-11ea-842e-02947726185d.png)

![image](https://user-images.githubusercontent.com/37747572/69002363-ad2d5000-08cc-11ea-9360-76bf1598512d.png)

---

## Installing

- Will be available on PyPi to be installed with Pip soon
- For now dependencies can be installed with [poetry](https://github.com/sdispater/poetry) using `poetry install` and run with `poetry run nyaa.py --help`
- *Note:* python-libtorrent will still need to be downloaded separately as shown below

- This Program depends on python3-libtorrent, which can be installed using Apt with `sudo apt install python3-libtorrent` or can be built from source here: [python-libtorrent](https://github.com/arvidn/libtorrent/blob/RC_1_2/docs/python_binding.rst)

---

## Usage

- **Help:** `nyaa-cli --help`

- `nyaa-cli "Anime Name" <Episode Number (Optional)> -o <Output Folder (Default: ~/Videos/Anime)>`
- **Example:**
```bash
# Downloading Episode 14 of 'Steins;gate' to '~/Anime/Steins;Gate' folder
nyaa-cli "Steins;Gate" 14 -o ~/Anime/Steins\;Gate
```
- Then select the entry you want to Download
73 changes: 0 additions & 73 deletions anilist.py

This file was deleted.

45 changes: 0 additions & 45 deletions anime_feed.py

This file was deleted.

74 changes: 0 additions & 74 deletions main.py

This file was deleted.

47 changes: 47 additions & 0 deletions nyaa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env python

import sys

import click

from nyaacli.nyaa_search import search_torrent
from nyaacli.colors import red, green


@click.command()
@click.argument('anime')
@click.argument('episode', type=int, default=None, required=False)
@click.option('--output', '-o', default='~/Videos/Anime', help=green('Output Folder'), type=click.Path(), show_default=True)
def main(anime: str, episode: int, output: str):
"""
Search for an Anime on https://nyaa.si and downloads it
\b