sdaqo / anipy-cli

Little tool in python to watch and download anime from the terminal (the better way to watch anime). Also applicable as an API
https://sdaqo.github.io/anipy-cli
GNU General Public License v3.0
266 stars 39 forks source link

CLI crashing when trying to download seasonals #193

Closed Prashanthvsdvn closed 1 month ago

Prashanthvsdvn commented 2 months ago

Describe the bug Inside Seasonals menu, the CLI keeps crashing when trying to either watch or download newest episodes. Although, I suspect this happens only when there is no new episodes for it to fetch (but I'm not sure). I'm have attached the error log.

To Reproduce Steps to reproduce the behavior:

  1. Open anipy-cli in seasonal mode
  2. Try to download/watch newest episode
  3. Program Crashes

Expected behavior The program would fetch new episodes and show options on what to download/watch. If nothing is found, it would say so.

Info

Name: anipy-cli
Version: 3.1.11
Summary: Watch and Download anime from the comfort of your Terminal
Home-page: https://sdaqo.github.io/anipy-cli
Author: sdaqo
Author-email: sdaqo.dev@protonmail.com
License: GPL-3.0
Location: C:\Python312\Lib\site-packages
Requires: anipy-api, appdirs, inquirerpy, pypresence, pyyaml, yaspin
Required-by:

Platform

Additional context Error log

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python312\Scripts\anipy-cli.exe\__main__.py", line 7, in <module>
  File "C:\Python312\Lib\site-packages\anipy_cli\cli.py", line 60, in run_cli
    cli_class(options=args).run()
  File "C:\Python312\Lib\site-packages\anipy_cli\clis\base_cli.py", line 31, in run
    ret = func()
          ^^^^^^
  File "C:\Python312\Lib\site-packages\anipy_cli\clis\seasonal_cli.py", line 31, in post
    menu.run()
  File "C:\Python312\Lib\site-packages\anipy_cli\menus\base_menu.py", line 30, in run
    self.take_input()
  File "C:\Python312\Lib\site-packages\anipy_cli\menus\base_menu.py", line 41, in take_input
    op.callback()
  File "C:\Python312\Lib\site-packages\anipy_cli\menus\seasonal_menu.py", line 187, in download_latest
    picked = self._choose_latest()
             ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\anipy_cli\menus\seasonal_menu.py", line 78, in _choose_latest
    choices = inquirer.fuzzy(  # type: ignore
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\InquirerPy\prompts\fuzzy.py", line 413, in __init__
    self._content_control: InquirerPyFuzzyControl = InquirerPyFuzzyControl(
                                                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python312\Lib\site-packages\InquirerPy\prompts\fuzzy.py", line 88, in __init__
    super().__init__(
  File "C:\Python312\Lib\site-packages\InquirerPy\base\control.py", line 73, in __init__
    self._safety_check()
  File "C:\Python312\Lib\site-packages\InquirerPy\base\control.py", line 156, in _safety_check
    raise InvalidArgument("argument choices cannot be empty")
InquirerPy.exceptions.InvalidArgument: argument choices cannot be empty
Prashanthvsdvn commented 2 months ago

@sdaqo am I getting botted on this issue. 6 identical comments from 2 accounts in matter of minutes, all asking me to install something from an external website. and none of them seem to be related to the repo

sdaqo commented 2 months ago

Yup that looks like a bot, about your issue. I am currently on vacation (without a laptop) and cannot fix your issue until I am back, sorry, but maybe someone else will pick it up.

DragonOfShuu commented 1 month ago

I will look into this! I'll run tests on MacOS and Windows and see what I can find, and I'll post a pull request when I find the solution

DragonOfShuu commented 1 month ago

Okay, I have discovered the problem you have encountered. This error happens when you are already all caught up on all episodes (from my testing). There are a few other potential errors that may occur, so I'm going to try to make fail safes for those too. Once I am done, I'll make a PR referencing this issue! Thanks for bringing this issue up :)

Prashanthvsdvn commented 1 month ago

Yup. that was my suspicion too, when I checked for new episodes when I caught up with them. ty for the response

sdaqo commented 1 month ago

fixed in 3.2.0