Code Monkey home page Code Monkey logo

anipy-cli's Introduction

Hi there

Metrics

anipy-cli's People

Contributors

arima57 avatar batsmacker84 avatar bratah123 avatar dankni95 avatar dragonofshuu avatar dymattic avatar hache0099 avatar kianmeng avatar migueldeoleiros avatar nadi726 avatar quicksilver151 avatar sdaqo avatar voidany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anipy-cli's Issues

Discord Presence script doesn't find existing Discord installation when not open

Describe the bug
The script complains about No Discord Installation found when Discord is not open. However, it works fine when Discord is opened and running.

To Reproduce
Steps to reproduce the behavior:

  1. Have config to set Discord Presence on
  2. Kill all Discord Instance
  3. Try to run the script

Expected behavior
The Program should warn about discord not initialized, especially after closing #71

Info

Name: anipy-cli
Version: 2.4.23
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: [email protected]
License: GPL-3.0
Location: c:\python310\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Windows 10
  • Discord installed through Chocolatey

Additional context
Error log of script

Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\anipy-cli.exe\__main__.py", line 4, in <module>
  File "C:\Python310\lib\site-packages\anipy_cli\run_anipy_cli.py", line 2, in <module>
    from anipy_cli import cli
  File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 38, in <module>
    rpc_client = dc_presence_connect()
  File "C:\Python310\lib\site-packages\anipy_cli\player.py", line 80, in dc_presence_connect
    rpc_client = Presence(CLIENT_ID)
  File "C:\Python310\lib\site-packages\pypresence\presence.py", line 13, in __init__
    super().__init__(*args, **kwargs)
  File "C:\Python310\lib\site-packages\pypresence\baseclient.py", line 28, in __init__
    raise DiscordNotFound
pypresence.exceptions.DiscordNotFound: Could not find Discord installed and running on this machine.

Downloading anime bug (Some Anime have a whitespace at the end of the name)

Describe the bug
Bug where the download path is not found because of the whitespace after the folder name (seen with "Neon Genesis Evangelion ")

To Reproduce
(dl) PS C:\Users\jerom> anipy-cli -d
Download Mode
Downloads are stored in: E:\ANIME
Search Kitsu for anime in Season? (y|n):
n
Search: neon genesis eva
Add another search: (y|n)
n

Current: neon genesis eva
[1] Neon Genesis Evangelion
[2] Neon Genesis Evangelion (Dub)
[3] Neon Genesis Evangelion: Death & Rebirth
[4] Neon Genesis Evangelion: Death & Rebirth (Dub)
[5] Neon Genesis Evangelion: The End of Evangelion (Dub)
Enter Number: 1
Episode (Range with '-') [1-26]
1
anipy-cli: error: quality not avalible, using default
Neon Genesis Evangelion _1.mp4
E:\ANIME\Neon Genesis Evangelion \Neon Genesis Evangelion _1.mp4

Downloading: Neon Genesis Evangelion EP: 1 - hls
Type: m3u8
Downloader: internal
Traceback (most recent call last):
File "C:\Users\jerom\miniconda3\envs\dl\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\jerom\miniconda3\envs\dl\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\jerom\miniconda3\envs\dl\Scripts\anipy-cli.exe_main
.py", line 7, in
File "C:\Users\jerom\miniconda3\envs\dl\lib\site-packages\anipy_cli\run_anipy_cli.py", line 8, in main
cli.main()
File "C:\Users\jerom\miniconda3\envs\dl\lib\site-packages\anipy_cli\cli.py", line 670, in main
download_cli(args.
quality, args.ffmpeg, args.no_kitsu)
File "C:\Users\jerom\miniconda3\envs\dl\lib\site-packages\anipy_cli\cli.py", line 133, in download_cli
download(show_entry, ffmpeg).download()
File "C:\Users\jerom\miniconda3\envs\dl\lib\site-packages\anipy_cli\download.py", line 85, in download
self.multithread_m3u8_dl()
File "C:\Users\jerom\miniconda3\envs\dl\lib\site-packages\anipy_cli\download.py", line 265, in multithread_m3u8_dl
self.temp_folder.mkdir(exist_ok=True)
File "C:\Users\jerom\miniconda3\envs\dl\lib\pathlib.py", line 1313, in mkdir
self._accessor.mkdir(self, mode)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'E:\ANIME\Neon Genesis Evangelion \1_temp'

Expected behavior
Download the Episode

Info
Name: anipy-cli
Version: 2.5.3
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: [email protected]
License: GPL-3.0
Location: c:\users\jerom\miniconda3\envs\dl\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Win11
  • Python 3.9.6

Additional context
I made a temporary fix on my end at download.py where the show_name checks if the anime name has the character " " at the end and remove it if it exists.
temp_flix

Downloads not starting due to bad path name

Describe the bug
When trying to download episodes, the downloader produces incorrect path name and it is unable to create a directory with the same name, thereby crashing the script.

To Reproduce
Steps to reproduce the behavior:

  1. Open anipy-cli -d
  2. Say no to search via Kitsu
  3. Search for series and episode
  4. Crash

Expected behavior
The program should make a directory and download episodes

Info

Name: anipy-cli
Version: 2.4.29
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: [email protected]
License: GPL-3.0
Location: c:\python310\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Windows 10

Additional context
Error Log

Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\anipy-cli.exe\__main__.py", line 7, in <module>
  File "C:\Python310\lib\site-packages\anipy_cli\run_anipy_cli.py", line 8, in main
    cli.main()
  File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 665, in main
    download_cli(args.quality, args.ffmpeg, args.no_kitsu)
  File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 128, in download_cli
    download(show_entry, ffmpeg).download()
  File "C:\Python310\lib\site-packages\anipy_cli\download.py", line 55, in download
    self.show_folder.mkdir(exist_ok=True)
  File "C:\Python310\lib\pathlib.py", line 1175, in mkdir
    self._accessor.mkdir(self, mode)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'D:\\Videos\\Anime\\\nIsekai Ojisan\n'

Discussion: Deprecate makefile

The makefile still exist and is pretty useless now that we can install the project with pip. I think we should just delete it to avoid confusion if anyone tries to use it. Thoughts?

downloading anime now causes issues

i ran main.py with download flag

./main.py -dq 480                         

when i searched for anime, it crashed

***Download Mode***
Downloads are stored in: /home/renderinguser/GIT/anipy-cli/download
Search for Anime: saenai
Traceback (most recent call last):                                     
  File "./main.py", line 4, in <module>                                
    from src import query, play, history, menu, download, url          
  File "/home/renderinguser/GIT/anipy-cli/src/query.py", line 3, in <module>
    from main import config
  File "/home/renderinguser/GIT/anipy-cli/main.py", line 53, in <module>
    download.main_activity()
  File "/home/renderinguser/GIT/anipy-cli/src/download.py", line 95, in main_activity
    link = query.query(search)
AttributeError: partially initialized module 'src.query' has no attribute 'query' (most likely due to a circular import)

Program crashes when trying to create download folder with special character

Describe the bug
The program crashes when trying to make directory for anime names with characters that dont behave with windows file system. An example is semi colon.

To Reproduce
Steps to reproduce the behavior:

  1. Run anipy-cli -d for download mode
  2. Answer 'no' for searching with Kitsu
  3. Search for anime name with semicolon
  4. Answer 'no' for another search
  5. Select the series
  6. Select the episode
  7. CRASH!!

Expected behavior
The Program should start creating a folder with anime name and start downloading files

Info

WARNING: Ignoring invalid distribution -nipy-cli (c:\python310\lib\site-packages)
Name: anipy-cli
Version: 2.4.17
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: [email protected]
License: GPL-3.0
Location: c:\python310\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Windows 10

Additional context
Traceback Logs from stderr

Traceback (most recent call last):
File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Python310\Scripts\anipy-cli.exe\__main__.py", line 7, in <module>
File "C:\Python310\lib\site-packages\anipy_cli\run_anipy_cli.py", line 8, in main
cli.main()
File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 641, in main
download_cli(args.quality, args.ffmpeg, args.no_kitsu)
File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 113, in download_cli
download(show_entry, ffmpeg).download()
File "C:\Python310\lib\site-packages\anipy_cli\download.py", line 41, in download
self.show_folder.mkdir(exist_ok=True)
File "C:\Python310\lib\pathlib.py", line 1175, in mkdir
self._accessor.mkdir(self, mode)
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\Prashanth\\.anipy-cli\\download\\Kaguya-sama wa Kokurasetai: Ultra Romantic' 

I reckon this was looking similar to #61 but its not the same.

Had hard time getting Geckodriver to work

Hi,

I installed geckodriver with pacman, but it still gave me an error about path. Tried setting path manually in .bashrc with no luck.

What fixed my problem was using pip install webdriver-manager

And this code in url.py:

from selenium import webdriver
from webdriver_manager.firefox import GeckoDriverManager

                browser = webdriver.Firefox(
                    executable_path=GeckoDriverManager().install())

Maybe this can be helpful to someone! :)

Problems with downloads and titles

After downloading some anime, I can not play it.

Here is the text produced when downloading an episode:

--------------------
Downloading: Sword Art Online EP: 1 - hlsp
Type: m3u8
Downloading Parts: (1/4)
Parts Downloaded
Merging Parts:  (4/4)
Parts Merged

After trying to play it, mpv produces a lot of errors like this:

Playing: ep.1.1645242517.1080295.ts
[file] Cannot open file 'ep.1.1645242517.1080295.ts': No such file or directory
Failed to open ep.1.1645242517.1080295.ts.

Playing: ep.1.1645242517.1080296.ts
[file] Cannot open file 'ep.1.1645242517.1080296.ts': No such file or directory
Failed to open ep.1.1645242517.1080296.ts.

Playing: ep.1.1645242517.1080297.ts
[file] Cannot open file 'ep.1.1645242517.1080297.ts': No such file or directory
Failed to open ep.1.1645242517.1080297.ts.

Playing: ep.1.1645242517.1080298.ts
[file] Cannot open file 'ep.1.1645242517.1080298.ts': No such file or directory
Failed to open ep.1.1645242517.1080298.ts.

Playing: ep.1.1645242517.1080299.ts
[file] Cannot open file 'ep.1.1645242517.1080299.ts': No such file or directory
Failed to open ep.1.1645242517.1080299.ts.

Playing: ep.1.1645242517.1080300.ts
[file] Cannot open file 'ep.1.1645242517.1080300.ts': No such file or directory
Failed to open ep.1.1645242517.1080300.ts.

Playing: ep.1.1645242517.1080301.ts
[file] Cannot open file 'ep.1.1645242517.1080301.ts': No such file or directory
Failed to open ep.1.1645242517.1080301.ts.

Playing anime normally without downloading it works fine, but the title of the series is replaced with hlsp ex. - EP: 1 - hlsp

This issue has been replicated with version 2.2.3 and 2.2.0 on Artix and Debian

Error When Trying To Run The Program

Describe the bug
Get a traceback yaml error whenever I try to run the program.

To Reproduce
Steps to reproduce the behavior:

  1. Go to terminal.
  2. Run the program.
  3. See error shown below.

Expected behavior
Another yaml error to occur.
Info
3B4MFU
Platform

  • OS: Windows 10

Program breaks when trying to stream

Describe the bug
Selecting a bug breaks the program with an Unicode Decode error. I get error logs like these.

Traceback (most recent call last):
File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Python310\Scripts\anipy-cli.exe\__main__.py", line 7, in <module>
File "C:\Python310\lib\site-packages\anipy_cli\run_anipy_cli.py", line 7, in main
cli.main()
File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 494, in main
default_cli(args.quality)
File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 41, in default_cli
url_class.stream_url()
File "C:\Python310\lib\site-packages\anipy_cli\url_handler.py", line 230, in stream_url
id = id[: id.index(b"&")].decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 0: invalid start byte 

To Reproduce

  1. Try to stream any anime episode

Expected behavior
Mpv should launch and stream the episode

Info

WARNING: Ignoring invalid distribution -nipy-cli (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
Name: anipy-cli
Version: 2.2.6
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: [email protected]
License: GPL-3.0
Location: c:\python310\lib\site-packages
Requires: bs4, pycryptodomex, requests, tqdm
Required-by:

Platform

  • OS: Windows

Additional context
I suspect gogo is changing something again with the website. The folks at ani-cli also mentioned their script is breaking due to gogo constantly changing something from their end. Not sure if its the same root cause here.

No module named requests

I have also installed python3-requests from apt
The Makefile surely has installed it, pip says installed
I dont understand why this error

Traceback (most recent call last):
  File "/home/triplek/.git-repos/anipy-cli/main.py", line 2, in <module>
    from src import query, url, play, history, menu
  File "/home/triplek/.git-repos/anipy-cli/src/query.py", line 4, in <module>
    import requests
ImportError: No module named requests

Since ani-cli wasnt working i saw the discussion and that led me here, so ig your python script is working ?

Feature Request: Option to download the current episode from episode control menu

There are times when the internet connection is unstable and stream keeps buffering. It would be handy if there was an option in the Now Playing menu to download the current episode instead.

The current workaround is to either print the stream url and use yt-dlp to download the file but then manually rename and move.
Or exit the current session and open it in Download Mode and search for the episode to download. Both of which are slight annoyance to accomplish the task.

Download does not complete again

when downloading m3u8 files, downloading parts stop after reaching around 80% again
every
time

in addition, the temporary directory containing the .ts files contain not just video clips but also files containing:

<HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY>
An error occurred while processing your request.<p>
Reference&#32;&#35;50&#46;1feb1cb8&#46;1648791032&#46;bb92fec0
</BODY></HTML>

is this an issue due to my network or something else?

Fails to download anime that is only on streamsb

Describe the bug
This bug happens when an anime episode on gogo is not actually on the gogo server and needs to be streamed from streamsb. It causes the program to crash when trying to watch it or download it.

You can also tell that it needs to be streamed from streamsb because that is what happens on gogo.

Link to episode on gogo: https://gogoanime.gg/cowboy-bebop-dub-episode-15

To Reproduce
Try watching or downloading Cowboy Bebop (Dub) episode 15.

Expected behavior
Normal Operation.

Info

Name: anipy-cli
Version: 2.4.18
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: [email protected]
License: GPL-3.0
Location: /home/michael/.local/lib/python3.10/site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Bedrock Linux
  • Python version 3.10.4

Additional context
Output (from both trying to download and watch normally):

❯ anipy-cli -d
***Download Mode***
Downloads are stored in: /home/michael/anime
Search Kitsu for anime in Season? (y|n):
>>
Search: cowboy bebop
Add another search: (y|n)


Current:  cowboy bebop
[1] Cowboy Bebop
[2] Cowboy Bebop (Dub)
[3] Cowboy Bebop: Tengoku no Tobira
[4] Cowboy Bebop: Tengoku no Tobira (Dub)
[5] Cowboy Bebop Knockin` on Heaven`s Door
Enter Number: 2
Episode [1-26]: 15
anipy-cli: error: quality not avalible, using default
--------------------
Downloading: Cowboy Bebop (Dub) EP: 15 - hlsp
Type: m3u8
Downloader: internal
Traceback (most recent call last):
  File "/home/michael/.local/bin/anipy-cli", line 8, in <module>
    sys.exit(main())
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/run_anipy_cli.py", line 8, in main
    cli.main()
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/cli.py", line 641, in main
    download_cli(args.quality, args.ffmpeg, args.no_kitsu)
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/cli.py", line 106, in download_cli
    download(show_entry, ffmpeg).download()
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/download.py", line 73, in download
    self.multithread_m3u8_dl()
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/download.py", line 256, in multithread_m3u8_dl
    self._m3u8_content = self._download_m3u8(
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/download.py", line 293, in _download_m3u8
    resp.raise_for_status()
  File "/home/michael/.local/lib/python3.10/site-packages/requests/models.py", line 960, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://www11.gogocdn.stream/videos/hls/fHLZTWB-TVC_A6YXgjehJg/1655596029/106825/72c2d7ea52bff63114544ca2a4b17e6d/ep.15.1648324057.m3u8

~/.local/lib/python3.10/site-packages/anipy_cli   20s
❯ anipy-cli
Search: cowboy bebop
[1] Cowboy Bebop
[2] Cowboy Bebop (Dub)
[3] Cowboy Bebop: Tengoku no Tobira
[4] Cowboy Bebop: Tengoku no Tobira (Dub)
[5] Cowboy Bebop Knockin` on Heaven`s Door
Enter Number: 2
Episode [1-26]: 15
anipy-cli: error: quality not avalible, using default
Traceback (most recent call last):
  File "/home/michael/.local/bin/anipy-cli", line 8, in <module>
    sys.exit(main())
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/run_anipy_cli.py", line 8, in main
    cli.main()
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/cli.py", line 659, in main
    default_cli(args.quality, player)
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/cli.py", line 43, in default_cli
    sub_proc = start_player(show_entry, rpc_client, player)
NameError: name 'rpc_client' is not defined

Colors Are Bad in Input Prompts In Windows

Describe the bug
There are (what I assume to be) ansi color escape codes visible to the user when they should not be in Windows.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Do This '...'
  3. See error

Expected behavior
I expect for there not to be color escape codes in the input prompts, like in the linux version.

The strange part is that the colors work perfectly fine for seemingly everything else, there is just an issue with this menu part.

Info
Post your output of pip show anipy-cli

Version: 2.4.14
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: [email protected]
License: GPL-3.0
Location: c:\users\michael\appdata\local\programs\python\python39\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Windows
  • Python: 3.9.7 for windows
  • Terminal: cmd.exe

Additional context

Example:

Enter Number: ←[36m3
←[0mEpisode ←[92m[1-25]←[0m: ←[36m

Issues with .5 episodes

I am not sure if this accounts as an bug or an PR. but we need to address how the program interacts with special episodes (usually has an episode numbers with .5 decimal)

Describe the bug
The current program doesn't identify .5 episodes and incorrectly maps the special episodes as regular episodes.

To Reproduce
Steps to reproduce the behavior:

  1. Run program
  2. Search for '86 Part 2' (not the dub)
  3. Select Episode 6
  4. Episode 6.5 starts playing instead

Expected behavior
The program should play regular episode (episode 6) instead of special episode (episode 6.5).
If i recall correctly, the URL has an '-5' added to the end.

Info

Name: anipy-cli
Version: 2.4.18
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: [email protected]
License: GPL-3.0
Location: c:\python310\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Windows 10

Additional context
Things I think the program should do

  1. The program maps the regular and .5 episodes correctly
  2. The episode selection UI should indicate presence and allow selection of .5 episodes

I detected this with 86 first but check with other series with .5 episodes in between.
Ideally, gogo should categorize them as special episodes but here we are.

Program crashes when downloading

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: [email protected]
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)

[Restructure Request] Reduce the reliance on the main.py frontend

Hello there. Since this project is going to be somewhat rewritten, I'd like to move away from being forced to use the current CLI frontend (in main.py and littered throughout the codebase, for some reason).

Right now, the only way to easily use the code and functions in the src folder is to use main.py. What I want is for the code in the src folder to act more like a library that can be used through any python script.

The end goal for this change is to make an alternative dmenu frontend for this project and to make other alternate frontends easier to create (like the ulauncher version by Dankni).

I am willing to do all of the work in order to achieve this goal. I just wanted to make sure that you support it. If you do not agree with this vision, I will make a fork of this project to do it.

Downloading does not work

Describe the bug
Anime downloader raises an assertation error when used.

To Reproduce
Steps to reproduce the behavior:

  1. Run anipy-cli -D
  2. Say no to kitsu (might not be necessary)
  3. Search for your anime
  4. Optionally add another another anime (does not matter)
  5. Try to download it

Expected behavior
The anime gets downloaded

Info

Name: anipy-cli
Version: 2.4.13
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: [email protected]
License: GPL-3.0
Location: /home/michael/.local/lib/python3.10/site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by: 

Platform

  • OS: Artix Linux
  • Python version 10.4
  • Latest version of anipy-cli

Additional context
Add any other context about the problem here.
Output

Downloads are stored in: /home/michael/.local/lib/python3.10/site-packages/anipy_cli/download
Search Kitsu for anime in Season? (y|n): 
>> n   
Search: log horizon
Add another search: (y|n)
n

Current:  log horizon
[1] Log Horizon
[2] Log Horizon 2
[3] Log Horizon (Dub)
[4] Log Horizon: Entaku Houkai
[5] Log Horizon 2nd Season (Dub)
[6] Log Horizon: Entaku Houkai (Dub)
Enter Number: 1
Episode [1-25]: 16-25
--------------------
Downloading: Log Horizon EP: 16 - hlsp 
Type: m3u8
Downloader: internal
Selected Quality: hlsp
Playlist Index: 0
Resolution at this index: (1920, 1080)


Selected Quality: hlsp
Playlist Index: 1
Resolution at this index: (1280, 720)


Selected Quality: hlsp
Playlist Index: 2
Resolution at this index: (854, 480)


Selected Quality: hlsp
Playlist Index: 3
Resolution at this index: (640, 360)


Traceback (most recent call last):
  File "/home/michael/.local/bin/anipy-cli", line 8, in <module>
    sys.exit(main())
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/run_anipy_cli.py", line 8, in main
    cli.main()
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/cli.py", line 638, in main
    download_cli(args.quality, args.ffmpeg, args.no_kitsu)
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/cli.py", line 110, in download_cli
    download(show_entry, ffmpeg).download()
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/download.py", line 72, in download
    self.multithread_m3u8_dl()
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/download.py", line 247, in multithread_m3u8_dl
    assert self._m3u8_content.is_variant is False
AssertionError
                          ```

[Suggestion] option for reusing the video player window

Currently, video player closes after each episode. I know it is intentional as anipy-cli waits for the player to close and then proceeds to fetch another link (in binge mode). In the normal mode it doesn't need to wait for the end of an episode though...

I think it would be great to have an option for using the same window over and over again (one reason for this feature could be discord streaming, which is locked on a window and closes with it).

This could be done by prefetching all/specified links (not sure if that's an option though, not sure if they expire or not) and then loading all links into some sort of playlist, which would go to the video player.

Another option that comes on mind would be creating some sort of a link between the player and anipy-cli and (on user interaction) feed it with new links.

I know what i'm suggesting is not as simple to perform, but i generally think it would be a greatly appreciated by anyone who likes to watch anime together with friends.

Thanks for taking your time to read this, even if it may be in vain.

Downloading anime bug

Describe the bug
okey so there is apparently bug with some aes implementation, when i tried to download Hyouka anime for example i got this...

To Reproduce
Search: Hyouka
[1]
Hyouka

[2]
Hyouka (Dub)

[3]
Hyouka: Motsubeki Mono wa

[4]
Kyoshin to Hyouka no Shiro

[5]
Hyouka: Motsubeki Mono wa (Dub)

Enter Number: 1
Episode [1-22]: 5
Traceback (most recent call last):
File "/home/hayo/.local/bin/anipy-cli", line 8, in
sys.exit(main())
File "/home/hayo/.local/lib/python3.8/site-packages/anipy_cli/run_anipy_cli.py", line 7, in main
cli.main()
File "/home/hayo/.local/lib/python3.8/site-packages/anipy_cli/cli.py", line 509, in main
default_cli(args.quality)
File "/home/hayo/.local/lib/python3.8/site-packages/anipy_cli/cli.py", line 41, in default_cli
url_class.stream_url()
File "/home/hayo/.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/hayo/.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/hayo/.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/hayo/.local/lib/python3.8/site-packages/Cryptodome/Cipher/init.py", line 79, in _create_cipher
return modes[mode](factory, **kwargs)
File "/home/hayo/.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)

Info
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: [email protected]
License: GPL-3.0
Location: /home/hayo/.local/lib/python3.8/site-packages
Requires: bs4, pycryptodomex, better-ffmpeg-progress, requests, tqdm
Required-by:

Platform

  • OS: windows 10
  • hypervisor: WSL2

Failed to start anipy-cli

Describe the bug
Whenever I start anipy-cli errors are generated. I have tried to reinstall python and anipy-cli but nothing changes.

Expected behavior
Expected anipy-cli to start properly as before

Info
Name: anipy-cli
Version: 2.5.2
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: [email protected]
License: GPL-3.0
Location: c:\users\pc planet\appdata\local\programs\python\python310\lib\site-packages
Requires: better-ffmpeg-progress, pypresence, python-dateutil, tqdm, bs4, requests, pycryptodomex, kitsu.py-extended, m3u8, moviepy
Required-by:

Platform

  • OS: Windows

Additional context
the error generated is shown below:

Traceback (most recent call last):
File "C:\Users\Pc Planet\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\Pc Planet\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\Pc Planet\AppData\Local\Programs\Python\Python310\Scripts\anipy-cli.exe_main
.py", line 4, in
File "C:\Users\Pc Planet\AppData\Local\Programs\Python\Python310\lib\site-packages\anipy_cli_init
.py", line 16, in
from .query import query
File "C:\Users\Pc Planet\AppData\Local\Programs\Python\Python310\lib\site-packages\anipy_cli\query.py", line 9, in
base_url = Config().gogoanime_url
File "C:\Users\Pc Planet\AppData\Local\Programs\Python\Python310\lib\site-packages\anipy_cli\config.py", line 12, in init
self._config_file = self._get_config_path() / "config.yaml"
File "C:\Users\Pc Planet\AppData\Local\Programs\Python\Python310\lib\site-packages\anipy_cli\config.py", line 131, in _get_config_path
raise SysNotFoundError(platform)
anipy_cli.config.SysNotFoundError: win32

quiting binge mode results in error

Videos being queued in the background, quitting here will terminate all players and queues                                                                                         
[q] Quit
Enter option: q

error message after entering q:

Traceback (most recent call last):                                                                                                                                                 
  File "./main.py", line 11, in <module>                                                                                                                                           
    from src import query, play, history, menu, download, url, binge, seasonal                                                                                                     
  File "/media/renderinguser/PC Disk EXT/anipy-cli/./src/menu.py", line 3, in <module>                                                                                             
    import main                                                                                                                                                                    
  File "/media/renderinguser/PC Disk EXT/anipy-cli/./main.py", line 77, in <module>                                                                                                
    seasonal.main_activity()                                                                                                                                                       
  File "/media/renderinguser/PC Disk EXT/anipy-cli/./src/seasonal.py", line 302, in main_activity                                                                                  
    menu()                                                                                                                                                                         
  File "/media/renderinguser/PC Disk EXT/anipy-cli/./src/seasonal.py", line 285, in menu
    start_action(True)
  File "/media/renderinguser/PC Disk EXT/anipy-cli/./src/seasonal.py", line 236, in start_action
    binge.start_watching(episode_urls)
  File "/media/renderinguser/PC Disk EXT/anipy-cli/./src/binge.py", line 89, in start_watching
    prompt_quit()
  File "/media/renderinguser/PC Disk EXT/anipy-cli/./src/binge.py", line 144, in prompt_quit
    kill_subprocess_with_player()
  File "/media/renderinguser/PC Disk EXT/anipy-cli/./src/binge.py", line 160, in kill_subprocess_with_player
    os.killpg(os.getpgid(play.sub_proc.pid), signal.SIGTERM)
AttributeError: module 'src.play' has no attribute 'sub_proc'

`anipy-cli -H` does not seem to be working

Describe the bug
When using anipy-cli -H, attempting to pick a show cause an error to be raised.

To Reproduce

  1. Run anipy-cli -H
  2. Enter a valid number
  3. Press enter
  4. See the error

Expected behavior
anipy-cli plays the episode showed in the history. Or whatever the history function is supposed to do.

Info

Name: anipy-cli
Version: 2.4.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: [email protected]
License: GPL-3.0
Location: /home/michael/.local/lib/python3.10/site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Bedrock Linux (With packages mainly from Artix, an Arch based distro)
  • Python Version: 3.10.4
  • Fresh install of anipy-cli from PyPI (installed with pip install anipy-cli)

Additional context
Output of the error:

❯ anipy-cli -H
[1] EP: 1 | Sword Art Online (Dub)
Enter Number: 1
Traceback (most recent call last):
  File "/home/michael/.local/bin/anipy-cli", line 8, in <module>
    sys.exit(main())
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/run_anipy_cli.py", line 8, in main
    cli.main()
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/cli.py", line 650, in main
    history_cli(args.quality, player)
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/cli.py", line 168, in history_cli
    menu(show_entry, options, sub_proc, quality).print_and_input()
TypeError: menu.__init__() missing 1 required positional argument: 'player'

Feature: pypresence

Feature request: integrate pypresence as an optional setting that can be enabled in the config file. You can check my fork of ani-cli at https://github.com/iamchokerman/ani-cli where i implemented pypresence to be used with the shell script. (You'll find installation instructions in the README.md). The python script runs at the moment when mpv is being launched. You'll find all of the necessary python code in "coolkidzonly.py". If you have any questions, I'll gladly help. I essentially wanted to make a PR, but it seemed like I'd need a lot of time to figure out how the codebase and config work + I'm not good at python

Episode not playing

For the last 2 days, I am unable to play anything with this. I am able to search with the program, So I don't think its a problem of DNS resolve. However, attempting to play an episode gives me an error likes and quits out.

anipy-cli: error: could not locate crypto: https://gogoplay5.com/streaming.php?id=MTgzMzA2&title=Sabikui+Bisco+Episode+12&typesub=SUB

Funnily enough even playing through youtube-dl or yt-dlp quits on me like this

>yt-dlp.exe "https://gogoplay5.com/streaming.php?id=MTgzMzA2&title=Sabikui+Bisco+Episode+12&typesub=SUB"
[generic] streaming: Requesting header
WARNING: [generic] Falling back on generic information extractor.
[generic] streaming: Downloading webpage
[generic] streaming: Extracting information
ERROR: Unsupported URL: https://gogoplay5.com/streaming.php?id=MTgzMzA2&title=Sabikui+Bisco+Episode+12&typesub=SUB

Anyone else facing any similar issues?

[Feature request] Sort the seasonals list by days

so basically, when selecting the list opition in seasonals it shows like this

[a] Add Anime
[e] Delete one anime from seasonals
[l] List animes in seasonals file
[d] Download newest episodes
[w] Binge watch newest episodes
[q] Quit
Enter Option: l
-> shingeki-no-kyojin-the-final-season-part-2
-> genjitsu-shugi-yuusha-no-oukoku-saikenki-part-2
-> sono-bisque-doll-wa-koi-wo-suru
-> sabikui-bisco
-> tensai-ouji-no-akaji-kokka-saisei-jutsu
-> koroshi-ai
-> tokyo-24-ku
-> hakozume-kouban-joshi-no-gyakushuu
-> akebi-chan-no-sailor-fuku
-> ousama-ranking
-> kimetsu-no-yaiba-yuukaku-hen
Press Enter-Key to get back to the menu.

would it be possilbe for it to be something like

[a] Add Anime
[e] Delete one anime from seasonals
[l] List animes in seasonals file
[d] Download newest episodes
[w] Binge watch newest episodes
[q] Quit
Enter Option: l

Sunday:
-> shingeki-no-kyojin-the-final-season-part-2
-> genjitsu-shugi-yuusha-no-oukoku-saikenki-part-2

Monday:
-> sono-bisque-doll-wa-koi-wo-suru
-> sabikui-bisco
-> tensai-ouji-no-akaji-kokka-saisei-jutsu
-> koroshi-ai

etc...
-> tokyo-24-ku
-> hakozume-kouban-joshi-no-gyakushuu
-> akebi-chan-no-sailor-fuku
-> ousama-ranking
-> kimetsu-no-yaiba-yuukaku-hen
Press Enter-Key to get back to the menu.

anime with unknown charachters crashes the program

its the same issue i faced with the shell script ani-cli

when an anime title has an uncommon symbol like in Saenai Heroine no Sodatekata ♭, it fails to download
that is the name of the second season of saenai heroine
selecting an episode from that results in the error message:

Getting emebed-urls                                                    
Traceback (most recent call last):                                     
  File "/home/renderinguser/GIT/anipy-cli/main.py", line 11, in <module>                                                                      
    from src import query, play, history, menu, download, url          
  File "/home/renderinguser/GIT/anipy-cli/src/menu.py", line 3, in <module>                                                                   
    import main
  File "/home/renderinguser/GIT/anipy-cli/main.py", line 60, in <module>
    download.main_activity()
  File "/home/renderinguser/GIT/anipy-cli/src/download.py", line 104, in main_activity
    embeded_urls.append(url.get_embed_url(j))
  File "/home/renderinguser/GIT/anipy-cli/src/url.py", line 63, in get_embed_url
    return f'https:{link["data-video"]}'
TypeError: 'NoneType' object is not subscriptable

heres the link to the issue in ani-cli
i believe the issue discusses the solution so i hope it helps
pystardust/ani-cli#240 (comment)

Config system should be changed so that people don't have to update their personal config everytime an option is added

Right now, every time a config option is added, users are expected to manually go update their config_personal.py file with the new option that was added to continue to be able to use the program. I think that this project should use a config system where there are 2 config files: a defaults one and one that stores the user changed options.

All of the default options are stored in the default config file and then users can manually go through and add every option they want changed into the custom config file with the updated value.

This would solve the issue of new config options breaking the program and the messy code required to use a hard-coded default in case a config option is not set.

Fails downloading all parts and crashes

Describe the bug

  • some parts (.ts files) fail to download
  • but the program continues to download until it thinks all parts have been downloaded
  • program crashes after trying to combine all parts and running into a file missing

To Reproduce
Steps to reproduce the behavior:

  1. run anipy-cli in download mode
  2. have slow internet or something
  3. parts fail to download and crash during the combining processs

Expected behavior
combine parts successfully

Crash message

Downloading  Part: 329/355
Parts Downloaded                                                                                                                                             
Traceback (most recent call last):                                                                                                                           
  File "./anipy_cli.py", line 14, in <module>                                                                                                                
    main()                                                                                                                                                   
  File "./anipy_cli.py", line 8, in main                                                                                                                     
    cli.main()                                                                                                                                               
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/cli.py", line 692, in main                                                                               
    seasonal_cli(args.quality, args.no_kitsu, args.ffmpeg, args.auto_update, player)                                                                         
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/cli.py", line 239, in seasonal_cli                                                                       
    s.take_input()
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/cli.py", line 266, in take_input
    self.download_latest()
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/cli.py", line 360, in download_latest
    download(show_entry, self.ffmpeg).download()
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/download.py", line 82, in download
    self.multithread_m3u8_dl()
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/download.py", line 297, in multithread_m3u8_dl
    self.ffmpeg_merge(input_file, audio_input_file)
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/download.py", line 134, in ffmpeg_merge
    merged_video_ts = self.merge_ts_files(input_file)
  File "/home/renderinguser/GIT/anipy-cli/anipy_cli/download.py", line 179, in merge_ts_files
    with open(ts_file, "rb") as mergefile:
FileNotFoundError: [Errno 2] No such file or directory: '/home/renderinguser/GIT/anipy-cli/anipy_cli/download/Bocchi the Rock!/11_temp/2ebfa29b-8370-11ed-93b4-a0369ffdb630-000062.ts'

Platform

  • OS: Kubuntu (linux)

Additional context
suggestion

  • restarting the download of the specific episode for some reason downloads only the missing parts and then the recombination becomes successful.
  • so, before combining all .ts files, have a check to see if there is a correct number of parts downloaded
  • re-run the download process if number of parts downloaded do not match the number of parts expected
  • you might have fast enough internet connection that makes it so that this process is not repeatable naturally, so during testing, delete some .ts files during the download process to see if the changes work.

also quick question
which version of python is this program compatible with
i run Python 3.8.10 but downloads are successful if i manually retry enough
but manually retrying is annoying when you're downloading a full seasonal batch of anime

tl;dr: add auto restarting failed downloads

Anime with any invalid characters in the title fails to download

Describe the bug
The download folder for any anime with any of these characters in the title ("", "/", ":", "*", "?", "<", ">", "|") is not created and it fails to download

To Reproduce
Steps to reproduce the behavior:
(This is just the example I ran into, any anime with those characters in the title should theoretically not work either)

  1. Enter "anipy-cli -d" into cmd
  2. Don't search in season
  3. Search "konosuba"
  4. Select option 9 (Kono Subarashii Sekai ni Shukufuku wo!: Kurenai Densetsu)
  5. Select episode 1
  6. See error

Expected behavior
Expected the folder with the name of the anime to be created and the episode to be downloaded to that folder (for the record, watching it in the cmd prompt didn't work either)

Info
Name: anipy-cli
Version: 2.4.19
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: [email protected]
License: GPL-3.0
Location: c:\users\my user\appdata\local\programs\python\python310\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Windows 10
  • Python 3.10.5

Error with playing episodes

Describe the bug
A clear and concise description of what the bug is.

An error is raised when the program tries to play an episode.

To Reproduce
Steps to reproduce the behavior:

Here is the full interaction that I had to get this error. This was achieved with a fresh install of anipy-cli. I even rm -rfed my site-packages/anipy_cli after uninstalling.

❯ anipy-cli
Search: sword art online
[1] Sword Art Online
[2] Sword Art Online II
[3] Sword Art Online (Dub)
[4] Sword Art Online Specials
[5] Sword Art Online II (Dub)
[6] Sword Art Online: Alicization
[7] Sword Art Online: Extra Edition
[8] Sword Art Online II Episode 14.5
[9] Sword Art Online: Alicization (Dub)
[10] Sword Art Online Movie: Ordinal Scale
[11] Sword Art Online: Extra Edition (Dub)
[12] Sword Art Online II: Sword Art Offline II
[13] Sword Art Online Movie: Ordinal Scale (Dub)
[14] Sword Art Online Alternative: Gun Gale Online
[15] Sword Art Online: Alicization - War of Underworld
[16] Sword Art Online: Sword Art Offline - Extra Edition
[17] Sword Art Online Alternative - Gun Gale Online (Dub)
[18] Sword Art Online: Alicization - War of Underworld (Dub)
[19] Sword Art Online: Alicization - War of Underworld 2nd Season
[20] Sword Art Online: Progressive Movie - Hoshi Naki Yoru no Aria
[21] Sword Art Online: Alicization - War of Underworld 2nd Season (Dub)
Enter Number: 3
Episode [1-25]: 1
Traceback (most recent call last):
  File "/home/michael/.local/lib/python3.10/site-packages/requests/models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/anipy-cli", line 12, in <module>
    main()
  File "/usr/local/bin/anipy-cli", line 7, in main
    cli.main()
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/cli.py", line 506, in main
    default_cli(args.quality)
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/cli.py", line 41, in default_cli
    url_class.stream_url()
  File "/home/michael/.local/lib/python3.10/site-packages/anipy_cli/url_handler.py", line 244, in stream_url
    self.aes_decrypt(r.json().get("data")).strip(
  File "/home/michael/.local/lib/python3.10/site-packages/requests/models.py", line 917, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: [Errno Expecting value] SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and ep.status != 5 order by type_id asc, status DESC' at line 3<br>: 0

Expected behavior
The episode gets played.

Info

Name: anipy-cli
Version: 2.2.8
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: [email protected]
License: GPL-3.0
Location: /home/michael/.local/lib/python3.10/site-packages
Requires: bs4, pycryptodomex, requests, tqdm
Required-by:

Also note that anipy-cli was installed from PyPI, not github

Platform

  • OS: Artix Linux. Running python 3.10.4. Running requests version 2.27.1

Change the way the program queues downloads

This is probably gonna be a big change in the internal workings of the program so i was initially not gonna raise the issue but now ive faced quite a lot of problems with this being the way it is.
suppose i queue like 100 episodes of one piece to download,
first, the program fetches the links for all the 100 episodes
and only after that, it start to download the episodes
The problem with that is, by the time it downloads like 10 episodes or such, the rest of the download links all expire. I personally wouldnt have much of a problem of being able to download 10 episodes at a time but...
As for me and my awful internet connection, i can barely queue 4 episodes right now

So, would it be possible to make it so that the program only fetches the link of the episode it attempts to download, only when it needs to download the episode?

Cannot download some specific anime

Describe the bug
tired downloading tate no yuusha season 2 but it failed
all other anime ive tried so far worked
idk why its just this specific show but it is a problem

To Reproduce
Steps to reproduce the behavior:
select download mode
select tate no yuusha season 2
download an episode

Expected behavior
To have tate no yuusha season 2 downloaded

Info
Post your output of pip show anipy-cli

i cloned the repo instead of using pip

Platform

  • OS: Linux (Ubuntu)

Additional context

output:

 ~  anipy-cli -dfq 480
***Download Mode***
Downloads are stored in: /home/renderinguser/GIT/anipy-cli/anipy_cli/download
Search Kitsu for anime in Season? (y|n): 
>> n  
Search: tate no yuusha
Add another search: (y|n)
n

Current:  tate no yuusha
[1] Tate no Yuusha no Nariagari
[2] Tate no Yuusha no Nariagari (Dub)
[3] Tate no Yuusha no Nariagari Season 2
[4] Tate no Yuusha no Nariagari 3rd Season
Enter Number: 3
Episode [1-3]: 3                                                                                                                                            
anipy-cli: error: could not locate embed-url: https://gogoanime.gg//tate-no-yuusha-no-nariagari-2nd-season-episode-3 

other season/anime download works:

 ~  anipy-cli -dfq 480
***Download Mode***
Downloads are stored in: /home/renderinguser/GIT/anipy-cli/anipy_cli/download
Search Kitsu for anime in Season? (y|n): 
>> n
Search: tate no yuusha
Add another search: (y|n)
n

Current:  tate no yuusha
[1] Tate no Yuusha no Nariagari
[2] Tate no Yuusha no Nariagari (Dub)
[3] Tate no Yuusha no Nariagari Season 2
[4] Tate no Yuusha no Nariagari 3rd Season
Enter Number: 1
Episode [1-25]: 1                                                                                                                                           
anipy-cli: error: quality not avalible, using default                                                                                                       
--------------------
Downloading: Tate no Yuusha no Nariagari EP: 1 - autop 
Type: m3u8
Downloader: ffmpeg

Script crashes when trying to binge or download seasonal episodes

Describe the bug
When trying to binge new episodes or download the episodes from seasonal animes, the program crashes citing string concatenation.

To Reproduce
Steps to reproduce the behavior:

  1. Run anipy-cli -S to open in season mode
  2. Input 'w' or 'd' to watch or download the newest episodes
  3. Program Crashes

Expected behavior
I should be able to watch them or download them

Info

Name: anipy-cli
Version: 2.4.21
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: [email protected]
License: GPL-3.0
Location: c:\python310\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Windows 10

Additional context
This error is probably brought upon changing the data type for episode number to include .5 episodes like #64. But I'm not sure.
Attaching Error log written to std out:

File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Python310\Scripts\anipy-cli.exe\__main__.py", line 7, in <module>
File "C:\Python310\lib\site-packages\anipy_cli\run_anipy_cli.py", line 8, in main
cli.main()
File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 656, in main
seasonal_cli(args.quality, args.no_kitsu, args.ffmpeg, args.auto_update, player)
File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 226, in seasonal_cli
s.take_input()
File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 253, in take_input
self.download_latest()
File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 325, in download_latest
latest_urls = Seasonal().latest_eps()
File "C:\Python310\lib\site-packages\anipy_cli\seasonal.py", line 39, in latest_eps
eps_range = list(range(e + 1, latest + 1))
TypeError: can only concatenate str (not "int") to str

Unable to play video

Describe the bug
Selecting the episode to play crashes the program.

To Reproduce
Steps to reproduce the behavior:

  1. Run the command
  2. Search for an anime
  3. Select an episode number

Expected behavior
The command should fetch link and play it in mpv

Info
WARNING: Ignoring invalid distribution -nipy-cli (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution - (c:\python310\lib\site-packages)
Name: anipy-cli
Version: 2.4.14
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: [email protected]
License: GPL-3.0
Location: c:\python310\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Windows

Additional context
Attaching error message

Search: spy x family
[1] Spy x Family
[2] Spy x Family (Dub)
Enter Number: ←[36m1
←[0mEpisode ←[92m[1-9]←[0m: ←[36m9
Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\anipy-cli.exe\__main__.py", line 7, in <module>
  File "C:\Python310\lib\site-packages\anipy_cli\run_anipy_cli.py", line 8, in main
    cli.main()
  File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 656, in main
    default_cli(args.quality, player)
  File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 47, in default_cli
    sub_proc = start_player(show_entry, rpc_client, player)
  File "C:\Python310\lib\site-packages\anipy_cli\player.py", line 60, in start_player
    sub_proc = sp.Popen(player_command)
  File "C:\Python310\lib\subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Python310\lib\subprocess.py", line 1435, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Soft fail instead of Hard fail for pypresence not finding Discord running

Not a bug per se, more like feature request.
Is it possible for Discord presence script to just show warning and continue with the script instead of hard failing, when Discord is not open.
Sometimes I don't want to open discord and keep watching anime and I don't want to keep changing the config all the time.
Or maybe even a flag option to skip discord presence even when enabled in config works.

Error log when trying to run without Discord open

Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python310\Scripts\anipy-cli.exe\__main__.py", line 4, in <module>
  File "C:\Python310\lib\site-packages\anipy_cli\run_anipy_cli.py", line 2, in <module>
    from anipy_cli import cli
  File "C:\Python310\lib\site-packages\anipy_cli\cli.py", line 38, in <module>
    rpc_client = dc_presence_connect()
  File "C:\Python310\lib\site-packages\anipy_cli\player.py", line 80, in dc_presence_connect
    rpc_client = Presence(CLIENT_ID)
  File "C:\Python310\lib\site-packages\pypresence\presence.py", line 13, in __init__
    super().__init__(*args, **kwargs)
  File "C:\Python310\lib\site-packages\pypresence\baseclient.py", line 28, in __init__
    raise DiscordNotFound
pypresence.exceptions.DiscordNotFound: Could not find Discord installed and running on this machine.

program no longer works for me

heres a copy of the contents on the terminal

anipy-cli -dq 480                                                                                                                                                        6s
***Download Mode***
Downloads are stored in: /media/renderinguser/PC Disk EXT/anipy-cli/download
Search for Anime: sono bisque
[1] sono-bisque-doll-wa-koi-wo-suru
[2] sono-bisque-doll-wa-koi-wo-suru-dub
Enter Number: 1
Episode [1-7]: 1                                                                                                                                                                    
Getting embed url for sono-bisque-doll-wa-koi-wo-suru-episode-1
Getting video url for sono-bisque-doll-wa-koi-wo-suru-episode-1
Something went wrong with the quality selection. Loading default quality.
Traceback (most recent call last):
  File "/media/renderinguser/PC Disk EXT/anipy-cli/main.py", line 116, in <module>
    download.main_activity()
  File "/media/renderinguser/PC Disk EXT/anipy-cli/src/download.py", line 103, in main_activity
    get_links(episode_urls, config.download_folder_path)    
  File "/media/renderinguser/PC Disk EXT/anipy-cli/src/download.py", line 127, in get_links
    download(video_url, embed_url[0], p, folder_path)
  File "/media/renderinguser/PC Disk EXT/anipy-cli/src/download.py", line 13, in download
    resp = requests.get(video_url, headers={'referer': embed_url}, stream=True)
  File "/home/renderinguser/.local/lib/python3.8/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/home/renderinguser/.local/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/renderinguser/.local/lib/python3.8/site-packages/requests/sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "/home/renderinguser/.local/lib/python3.8/site-packages/requests/sessions.py", line 456, in prepare_request
    p.prepare(
  File "/home/renderinguser/.local/lib/python3.8/site-packages/requests/models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "/home/renderinguser/.local/lib/python3.8/site-packages/requests/models.py", line 390, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'None': No schema supplied. Perhaps you meant http://None?

every time it now seems that anime quality selection always fails
and then it proceeds to fail downloading all together

ok seems like watch mode fails as well

it seems that the program is unable to fetch the link

Unable to add 'Start from beginning' to an anime while adding to seasonal file

Describe the bug
While adding an new anime to seasonal file, the description says we can put 0 to start from beginning but it doesn't let you add 0.

To Reproduce
Steps to reproduce the behavior:

  1. Run anipy-cli -S to open in season mode
  2. Enter 'a' to Add Anime
  3. Enter 'n' to search kitsu for anime
  4. search for new anime
  5. Select the anime from list
  6. Try to enter '0' for Last Episode Watched. Even the description says
  7. Doesn't take the input, spits out anipy-cli: error: Episode 0 does not exsist. anipy-cli: error: Invalid Input and re-prompts you for episode number

Expected behavior
0 as an input should be taken and stored for indicate to start from pilot episode.

Info

Name: anipy-cli
Version: 2.4.21
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: [email protected]
License: GPL-3.0
Location: c:\python310\lib\site-packages
Requires: better-ffmpeg-progress, bs4, kitsu.py-extended, m3u8, moviepy, pycryptodomex, pypresence, python-dateutil, requests, tqdm
Required-by:

Platform

  • OS: Windows 10

History and geckodriver.log are created around the system

Because of the posibility to run the program from any directory both history.txt and geckodriver.log are created in whichever directory you are running the program. The proper and cleaner way to fix this would be to save the files on XDG_CACHE_HOME.
Check out this for more info on how XDG base directories work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.