Anipy-cli is a versatile Python tool that allows you to watch and download anime from the terminal, providing you with the ultimate anime watching experience.
This tool scrapes its content from GoGoAnime and can be used as an API. In this tutorial, we’ll walk you through the installation process, usage, and other features of anipy-cli.
Table of Contents
Quick Demo
This is a quick demo on how it works. I’m running:
anipy-cli -Dq 720
In this example I’m using the options:
-D
: this downloads the anime. Otherwise you’d stream it.-q 720
: this is the quality I want it to download. The default one is 1080p.
1. Installation
To install anipy-cli, it is recommended to use the PyPI package:
python3 -m pip install anipy-cli --upgrade
You can also install directly from the GitHub repository, which may be more up-to-date:
python3 -m pip install git+https://github.com/sdaqo/anipy-cli
Anipy-cli requires mpv
for video playback. Install it from the official website. If you prefer to use a different video player, you can specify its path in the configuration file.
Optionally, you can install ffmpeg
to download m3u8 playlists using the -f
flag. This is recommended if the internal downloader fails, although ffmpeg
is comparatively slower.
2. Configuring anipy-cli
When you run the program for the first time, a configuration file will be automatically created. The configuration file can be found at the following locations:
- Linux:
~/.config/anipy-cli/config.yaml
- Windows:
%USERPROFILE%/AppData/Local/anipy-cli/config.yaml
- MacOS:
~/.config/anipy-cli/config.yaml
You can customize the settings in this file to suit your preferences, such as video player path, download location, and MyAnimeList credentials.
Windows users who enable the reuse_mpv_window
option will need to download and add the mpv-2.dll
to their system path. This file can be obtained from SourceForge.
This is how the config.yaml
file looks like:
anime_types:
- sub
- dub
auto_map_mal_to_gogo: false
auto_open_dl_defaultcli: false
auto_sync_mal_to_seasonals: false
dc_presence: false
download_folder_path: /path/where/you/want/to/download/anime
download_name_format: '{show_name}_{episode_number}.mp4'
download_remove_dub_from_folder_name: false
ffmpeg_hls: false
ffmpeg_log_path: /usr/local/lib/python3.10/dist-packages/anipy_cli/user_files/ffmpeg_log
gogoanime_url: https://gogoanime.gg/
history_file_path: /usr/local/lib/python3.10/dist-packages/anipy_cli/user_files/history.json
mal_local_user_list_path: /usr/local/lib/python3.10/dist-packages/anipy_cli/user_files/mal_list.>
mal_password: ''
mal_status_categories:
- watching
mal_user: ''
mpv_commandline_options:
You can read the docs to find out more about the configs.
I recommend setting the download_folder_path to your preferred download location.
After you save the file the changes will be in effect.
3. Using anipy-cli
Anipy-cli offers several actions and modes to choose from, along with options to customize its behavior.
To see all available options, run:
anipy-cli --help
usage: anipy-cli [-D | -B | -H | -S | -M | --delete-history] [-q QUALITY] [-f] [-o] [-a]
[-p {mpv,vlc,syncplay,mpvnet}] [-l LOCATION] [--mal-password MAL_PASSWORD]
[-h] [-v] [--config-path]
Play Animes from gogoanime in local video-player or Download them.
Actions:
Different Actions and Modes of anipy-cli (only pick one)
-D, --download Download mode. Download multiple episodes like so: first_number-
second_number (e.g. 1-3)
-B, --binge Binge mode. Binge multiple episodes like so: first_number-second_number
(e.g. 1-3)
-H, --history Show your history of watched anime
-S, --seasonal Seasonal Anime mode. Bulk download or binge watch newest episodes.
-M, --my-anime-list MyAnimeList mode. Similar to seasonal mode, but using MyAnimeList
(requires MAL account credentials to be set in config).
--delete-history Delete your History.
Options:
Options to change the behaviour of anipy-cli
-q QUALITY, --quality QUALITY
Change the quality of the video, accepts: best, worst or 360, 480, 720
etc. Default: best
-f, --ffmpeg Use ffmpeg to download m3u8 playlists, may be more stable but is way
slower than internal downloader
-o, --no-seas-search Turn off search in season. Disables prompting if GoGoAnime is to be
searched for anime in specific season.
-a, --auto-update Automatically update and download all Anime in seasonals list from
start EP to newest.
-p {mpv,vlc,syncplay,mpvnet}, --optional-player {mpv,vlc,syncplay,mpvnet}
Override the player set in the config.
-l LOCATION, --location LOCATION
Override all configured download locations
--mal-password MAL_PASSWORD
Provide password for MAL login (overrides password set in config)
Info:
Info about the current anipy-cli installation
-h, --help show this help message and exit
-v, --version show program's version number and exit
--config-path Print path to the config file.
4. anipy-cli Features
Anipy-cli offers several features, including:
- Faster anime playback than in a browser.
- Local video player support.
- Quality selection for playback and downloads.
- History of watched episodes.
- Binge mode for continuous playback of a range of episodes.
- Seasonal mode for bulk downloading or binge-watching the latest episodes.
- Optional MyAnimeList mode for personalized anime lists.
- Optional Discord Presence for displaying the currently watched anime.
5. Library Usage in Python
Anipy-cli can be used as a library, and the documentation can be found here.
Note: To import the library, use import anipy_cli
instead of import anipy-cli
, as hyphens are not allowed in Python imports.
6. Other Versions
In addition to the CLI version, there are alternative versions of Anipy available:
- GUI Frontend (Work in Progress) by sdaqo
- Dmenu script by @Dabbing-Guy
- Ulauncher extension by @Dankni95 (not maintained)
These other versions offer different interfaces and integrations, catering to different user preferences.
Conclusion
Now that you’ve learned how to install, configure, and use Anipy-cli, you can enjoy watching and downloading your favorite anime directly from the Linux terminal. Happy anime watching!