animethemes_compressed.webm
This is a Python script that lets you search for an anime and play its opening or ending theme songs using the mpv media player. The script uses the AnimeThemes API to get the available theme songs and the pyfzf library to prompt the user for selections.
- Python 3.x
- requests module (can be installed via pip)
- pyfzf module (can be installed via pip)
- mpv media player (must be installed separately)
- install fzf as well (depending on your OS)
- For linux
Alternatively, you can "git clone" this repository to any directory and run install script.
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
Package Manager | Linux Distribution | Command |
---|---|---|
APK | Alpine Linux | sudo apk add fzf |
APT | Debian 9+/Ubuntu 19.10+ | sudo apt install fzf |
Conda | conda install -c conda-forge fzf |
|
DNF | Fedora | sudo dnf install fzf |
Nix | NixOS, etc. | nix-env -iA nixpkgs.fzf |
Pacman | Arch Linux | sudo pacman -S fzf |
pkg | FreeBSD | pkg install fzf |
pkgin | NetBSD | pkgin install fzf |
pkg_add | OpenBSD | pkg_add fzf |
Portage | Gentoo | emerge --ask app-shells/fzf |
XBPS | Void Linux | sudo xbps-install -S fzf |
Zypper | openSUSE | sudo zypper install fzf |
- Install the script
sudo curl -sL https://raw.githubusercontent.com/Laezor/animetheme-player/main/animethemes -o /$HOME/.local/bin/animethemes &&
sudo chmod +x /$HOME/.local/bin/animethemes
- For windows
Package manager | Command |
---|---|
Chocolatey | choco install fzf |
Scoop | scoop install fzf |
Winget | winget install fzf |
- Install the script
iwr "https://raw.githubusercontent.com/Laezor/animetheme-player/main/animethemes-win.py" -OutFile "%userprofile%/Downloads/animethemes-win.py"
To use the script, follow these steps:
- Clone the repository to your local machine.
- Open a terminal window and navigate to the directory where the script is located.
- Run the script by typing the following command and pressing Enter:
For windows
python animethemes-win.py
For linux
animethemes
- When prompted, enter the title of the anime you want to search for and whether you want to play its opening or ending theme songs.
- Select the anime you want to play theme songs for from the list of search results that appear.
- Select the theme song you want to play from the list of available theme songs.
- The script will automatically launch the mpv media player and play the selected theme song. Press Q to quit mpv.
- After the theme song has finished playing, you will be prompted to choose whether to exit the selection or play another theme song from the current anime.
- If you choose to play another theme song, the available theme songs for the current anime will be displayed and you can select another one to play.
- If you choose to exit the selection, you will be prompted to choose whether to search for a new anime or exit the script.
- If you choose to search for a new anime, the script will start over and prompt you for a new anime title and theme type.
- If you choose to exit the script, the script will terminate.
- The script only searches for TV and OVA anime titles.
- The script only supports playing opening and ending theme songs.
- The script only plays one theme song at a time.
- The script requires an active internet connection to function properly.
- AnimeThemes for providing the API used by the script.
- pyfzf for providing the FzfPrompt library used by the script.
- The creators and contributors of the requests and mpv modules used by the script.