https://github.com/jakobbbb/anipresence
discord rich presence for ani-cli/animdl
https://github.com/jakobbbb/anipresence
ani-cli discord
Last synced: 3 months ago
JSON representation
discord rich presence for ani-cli/animdl
- Host: GitHub
- URL: https://github.com/jakobbbb/anipresence
- Owner: jakobbbb
- License: gpl-3.0
- Created: 2023-03-29T01:12:10.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-12-24T11:51:41.000Z (5 months ago)
- Last Synced: 2025-12-26T02:22:53.318Z (5 months ago)
- Topics: ani-cli, discord
- Language: Python
- Homepage:
- Size: 43.9 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# anipresence
discord rich presence for ani-cli/animdl:
## deps
your player must be `mpv`, and you must have either `pypresence` or `lynxpresence` installed.
from AUR: `yay -S python-pypresence` / `yay -S python-lynxpresence`.
for Discord to display 'Watching' instead of 'Playing' you'll currently need either lynxpresence or the [git version](https://github.com/qwertyquerty/pypresence#Installation) of pypresence.
to use the rpc with local media on Linux, you'll also need [wmctrl](](https://www.freedesktop.org/wiki/Software/wmctrl/)) (and a compatible window manager)
## how
### Linux
start the `anipresence.py` after mpv has been started.
there's many ways to do this. one hacky way:
add this to your `mpv.conf`:
```ini
[discord-rpc]
profile-cond=os.execute("/path/to/anipresence.py > /dev/null &")
```
### Windows:
since autostart does not work like this on Windows, you can start the script with the argument `-d` or `--daemonlike` which checks every 10s if a process matches the regexes. It's called daemon-like, because it will, once started, keep running and check running processes every 10s starting the rpc and connecting to Discord every time it finds a match.
## show titles on discord
shows usually have three official titles that AL reconizes and makes easily accessible:
`Romaji`, `Native` and `English`. for [EVA](https://anilist.co/anime/30/Shin-Seiki-Evangelion/) that would be "Shin Seiki Evangelion", "新世紀エヴァンゲリオン" and "Neon Genesis Evangelion". anipresence uses romaji as the default title format.
to select which title format to use, set argument `-t` or `--titleformat` with the options `r | romaji | n | native | e | english`.
should you, for example, want enlish titles just change the `mpv.conf` entry to:
```ini
[discord-rpc]
profile-cond=os.execute("/path/to/anipresence.py -t e > /dev/null &")
```
_**note:**_ anipresence saves only one so called "display title". if you decide to change the title format, all shows watched _before_ this change will still show their title in the _old_ title format.
## nicer titles
patch `ani-cli`:
```diff
- mpv*) nohup "$player_function" --force-media-title="${allanime_title}episode-${ep_no}-${mode}" "$episode" >/dev/null 2>&1 & ;;
+ mpv*) nohup "$player_function" --force-media-title="${title}episode-${ep_no}-${mode}" "$episode" >/dev/null 2>&1 & ;;
```
check `./ani-patch.sh` for an automated way of patching `ani-cli`