Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program crashes when downloading #61

Closed
Quicksilver151 opened this issue Jun 17, 2022 · 7 comments
Closed

Program crashes when downloading #61

Quicksilver151 opened this issue Jun 17, 2022 · 7 comments

Comments

@Quicksilver151
Copy link
Contributor

Describe the bug
downloads fails and program crashes

To Reproduce
Steps to reproduce the behavior:

  1. select download mode or even just use it normally
    error and output:
***Download Mode***
Downloads are stored in: /home/renderinguser/.local/lib/python3.8/site-packages/anipy_cli/download
Search: yuusha yamemasu
[1] Yuusha, Yamemasu
[2] Yuusha, Yamemasu: Kenshuu Ryokou wa Mokuteki wo Miushinau na
Enter Number: 1
Episode [1-11]: 9                                                                                                                                                                                                    
Traceback (most recent call last):                                                                                                                                                                                   
  File "./run_anipy_cli.py", line 14, in <module>                                                                                                                                                                    
    main()                                                                                                                                                                                                           
  File "./run_anipy_cli.py", line 8, in main                                                                                                                                                                         
    cli.main()                                                                                                                                                                                                       
  File "/home/renderinguser/.local/lib/python3.8/site-packages/anipy_cli/cli.py", line 494, in main                                                                                                                  
    download_cli(args.quality, False)                                                                                                                                                                                
  File "/home/renderinguser/.local/lib/python3.8/site-packages/anipy_cli/cli.py", line 69, in download_cli                                                                                                           
    url_class.stream_url()                                                                                                                                                                                           
  File "/home/renderinguser/.local/lib/python3.8/site-packages/anipy_cli/url_handler.py", line 237, in stream_url
    enc_id = self.aes_encrypt(id, self.key).decode()
  File "/home/renderinguser/.local/lib/python3.8/site-packages/anipy_cli/url_handler.py", line 208, in aes_encrypt
    AES.new(key, self.mode, iv=self.iv).encrypt(
  File "/home/renderinguser/.local/lib/python3.8/site-packages/Cryptodome/Cipher/AES.py", line 232, in new
    return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
  File "/home/renderinguser/.local/lib/python3.8/site-packages/Cryptodome/Cipher/__init__.py", line 79, in _create_cipher
    return modes[mode](factory, **kwargs)
  File "/home/renderinguser/.local/lib/python3.8/site-packages/Cryptodome/Cipher/_mode_cbc.py", line 287, in _create_cbc_cipher
    raise ValueError("Incorrect IV length (it must be %d bytes long)" %
ValueError: Incorrect IV length (it must be 16 bytes long)

Expected behavior
anime downloads sucessfully

Info
Post your output of pip show anipy-cli
(ok so, i do have it installed here with pip but i use only the repo directly because the pip version is a bit outdated)

Name: anipy-cli
Version: 2.2.12
Summary: Little tool in python to watch anime from the terminal (the better way to watch anime)
Home-page: https://github.com/sdaqo/anipy-cli
Author: sdaqo
Author-email: sdaqo.dev@protonmail.com
License: GPL-3.0
Location: /home/renderinguser/.local/lib/python3.8/site-packages
Requires: tqdm, requests, bs4, pycryptodomex, better-ffmpeg-progress
Required-by:

if it helps, running which anipy-cli results in

>which anipy-cli                                                    
/home/renderinguser/.local/bin/anipy-cli

Platform

  • Ubuntu (linux)
@sdaqo
Copy link
Owner

sdaqo commented Jun 17, 2022

Does it only fail when downloading? It works fine for me. Maybe try out the pip version, it is up to date apart from some minor commits.

Edit: I think you are using a very outdated pip version, ~/.local/bin/ is the place for python scripts (and also the place of the pip version). Try updating with pip install anipy-cli --upgrade

@Quicksilver151
Copy link
Contributor Author

I think you are using a very outdated pip version,
its the latest version thats available on pip
also im not even using the version on pip
im running the python file in the repo directly

@sdaqo
Copy link
Owner

sdaqo commented Jun 19, 2022

its the latest version thats available on pip

But the newest version is 2.4.18, you are running 2.2.12

also im not even using the version on pip
im running the python file in the repo directly

So you are running ./anipy_cli.py? If that's the case open setup.py and look if the version is 2.4.18, if it isn't try a git pull. If it is, please report back.

@Quicksilver151
Copy link
Contributor Author

Quicksilver151 commented Jul 15, 2022

ok so
its been 26 days and ive looked at the whole thing again
turns out there were a lot of problems

  1. running run_anipy_cli.py makes it import a "global" anipy_cli instead of from the repo's folder. i have an older version installed with pip and thats the one its importing
  2. which version of python is required for this? i have python 3.8 installed and i think thats the main cause of the issues
  3. tried downloading python 3.10 but its somehow really bugged. and im too lazy to fix that rn ¯\_(ツ)_/¯

@sdaqo
Copy link
Owner

sdaqo commented Jul 15, 2022

Yeah it's 3.9 or greater. You could look at this it's a python version manager. Closing this now since I think you can fix it yourself.

@sdaqo sdaqo closed this as completed Jul 15, 2022
@VoidAny
Copy link
Contributor

VoidAny commented Jul 15, 2022

It is only Python 3.10+ because there is a type annotation that uses | somewhere.

I am maintaining a branch for 3.9 compatibility on my fork.

@sdaqo
Copy link
Owner

sdaqo commented Jul 15, 2022

Oh, thats nice to know, this is in the entry dataclass. I will make this a Uninon instead of a pipe than.Thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants