Skip to content

Commit

Permalink
Only show torrent alert messages on debug mode (Closes #25)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvictorfs committed May 24, 2020
1 parent 49c4ce8 commit 2ca33f5
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

---

## 0.1.9

- Only show torrent alert messages in debug mode (`--debug`) (Closes Issue [`#25`](https://github.com/johnvictorfs/nyaa-cli/issues/25))

---

## 0.1.8

- Add argument `-n` (`--number`, default = 10) to specify the number of entries to select from
- Add argument `-n` (`--number`, default = 10) to specify the number of entries to select from ([`#24`](https://github.com/johnvictorfs/nyaa-cli/commit/53771685f94f2d34c257b45c2ca749b08ab18ac2))

---

Expand Down
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,27 @@ A CLI for downloading Anime from https://nyaa.si making use of their RSS Feed an

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

- `nyaa "Anime Name" <Episode Number (Optional)> -o <Output Folder (Default: ~/Videos/Anime)>`
- **Example:**
```bash
Usage: nyaa [OPTIONS] ANIME [EPISODE]

Search for Anime on https://nyaa.si and downloads it

Usage:
nyaa "Anime Name" <Episode Number (Optional)> -o <Output Folder (Default = "~/Videos/Anime")>

Example:
nyaa "Kimetsu no Yaiba" 19 -o /home/user/My/Animes/Folder/Kimetsu_No_Yaiba/

Options:
-o, --output PATH Output Folder [default: ~/Videos/Anime]
-n, --number INTEGER Number of entries [default: 10]
--debug / --no-debug Debug Mode
--help Show this message and exit.
```

- **Example:**
```bash
# Downloading Episode 14 of 'Steins;gate' to '~/Anime/Steins;Gate'
nyaa "Steins;Gate" 14 -o ~/Anime/Steins\;Gate
```
- Then select the entry you want to Download

4 changes: 2 additions & 2 deletions nyaacli/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ def entries_autocomplete(ctx, args: List[str], incomplete: str):
@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)
@click.option('--debug/--no-debug', default=False, help=green('Debug Mode'))
@click.option('--number', '-n', default=10, help=green('Number of entries'), show_default=True, autocompletion=entries_autocomplete)
@click.option('--debug/--no-debug', default=False, help=green('Debug Mode'))
def main(anime: str, episode: int, output: str, debug: bool = False, number: int = 10):
"""
Search for Anime on https://nyaa.si and downloads it
\b
Usage:
\33[92mnyaa \33[36m"Anime Name" \33[33m<Episode Number (Optional)> \33[34m-o <Output Folder (Default = '~/Videos/Anime')>\033[0m
\33[92mnyaa \33[36m"Anime Name" \33[33m<Episode Number (Optional)> \33[34m-o <Output Folder (Default = "~/Videos/Anime")>\033[0m
\b
Example:
Expand Down
2 changes: 1 addition & 1 deletion nyaacli/torrenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def download_torrent(filename: str, result_filename: str = None, show_progress:
alert: libtorrent.alert
for alert in alerts:
if alert.category() & libtorrent.alert.category_t.error_notification:
sys.stdout.write(f"{red('[Alert]')} {alert} \r")
logger.debug(f"{red('[Alert]')} {alert}")

sys.stdout.flush()

Expand Down

0 comments on commit 2ca33f5

Please sign in to comment.