G4music / Gapless Discord Rich Presence
Discord Rich Presense for Gapless
Features
- Highly customisable
- Templating for various fields
- Buttons with customisable text and url
- Cover art display (through litterbox)
- Position display
Installation
There are 2 options for installation:
- Pypi
python3 -m pip install g4music-discord-rpc
- Running from source
git clone https://github.com/x-9917638/g4music-discord-rpc
cd g4music-discord-rpc
python3 -m pip install -r requirements.txt
python3 src/main.py
Configuration
g4music-discord-rpc will create a default configuration at $XDG_CONFIG_HOME/g4music-discord-rpc/config.toml
Default:
[general]
appid = 1436573238636576891
cover-art = true
show-time = true
log-level = 30
art-server-url = "https://litterbox.catbox.moe/resources/internals/api.php"
[art-server]
url = "https://litterbox.catbox.moe/resources/internals/api.php"
filename = "fileToUpload"
[art-server.data]
reqtype = "fileupload"
time = "1h"
[details]
text = ""
url = ""
[state]
text = "${song} / ${album} - ${artist}"
url = ""
[image]
text = "Listening to ${song}"
url = ""
[buttons.1]
text = ""
url = ""
[buttons.2]
text = ""
url = ""
Options:
| Option Name | Explanation | Type | Default |
|---|---|---|---|
general.appid |
The application that the activity is set as. You are free to create your own, with customised fallback, play and pause icons. | integer | 1436573238636576891 |
general.cover-art |
Whether or not to display cover art. Please note that if this is true, art will be uploaded to litterbox anonymously. |
boolean | true |
general.show-time |
Whether or not to show the position that you are at and the length of the song. | boolean | true |
general.log-level |
The level of logs that are sent to stdout. Acceptable levels are 30 WARN, 20 INFO, 10 DEBUG. | integer | 30 |
art-server.url |
A URL to an API that hosts images. The API must accept a POST request and return the URL of the uploaded image | string | "https://litterbox.catbox.moe/resources/internals/api.php" |
art-server.filename |
The filename to be uploaded to the server. | string | "fileToUpload" |
art-server.data |
Data to POST to the API. You may define any keys and values. | table | |
details.text |
The text to display in the details section of the activity. Templating is allowed. Leave as an empty string if unwanted. | string | "" |
details.url |
The URL that clicking on the activity's details text will open. Leave as an empty string if unwanted. | string | "" |
state.text |
The text to display in the state section of the activity, typically below the details. Templating is allowed. | string | "${song} / ${album} - ${artist}" |
state.url |
The URL that clicking on the activity's state text will open. Leave as an empty string if unwanted. | string | "" |
image.text |
The tooltip text shown when hovering over the large album art. Templating is allowed. | string | "Listening to ${song}" |
image.url |
The URL that clicking on the large album art will open. Leave as an empty string if unwanted. | string | "" |
buttons.*.text |
The text to display on the first button in the activity. A button will only appear if both its text and url attributes are filled. | string | "" |
buttons.*.url |
The URL that clicking the button will open. A button will only appear if both its text and url attributes are filled. The url must be of format http://* or https://*. |
string | "" |
Templating
Templating allows strings to be dynamic dependent on the current song.
To use templating, wrap the desired field with curly brackets and prefix a $. e.g.${song}
There are 3 valid fields:
| Field | Explanation |
|---|---|
| ${song} | The title of the current song. |
| ${artist} | The artist of the current song |
| ${album} | The name of the album from the current song |
License
g4music-discord-rpc is licensed under the MIT License. The full license can be found here.
Metadata
Release files for g4music-discord-rpc 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| g4music_discord_rpc-1.0.2.tar.gz | 6.9 kB | Without provenance | Details for g4music_discord_rpc-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| g4music_discord_rpc-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for g4music_discord_rpc-1.0.2-py3-none-any.whl |
Total release size: 14.8 kB
Release files / g4music_discord_rpc-1.0.2.tar.gz
| Download URL | g4music_discord_rpc-1.0.2.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
149ce73550e5e67dcda9d7948255bdb36a16a98a17f5a966ae83208a22c75183
|
|
BLAKE2b-256 checksum How to use checksums |
40597bdaf6a863b658a17106d4567d9702b7959d099c00e758eab9c6134e9fc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / g4music_discord_rpc-1.0.2-py3-none-any.whl
| Download URL | g4music_discord_rpc-1.0.2-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd53125379d647619d2a1bafec93d8d7e83f2fdfda7d281d0505b8bfae496b9a
|
|
BLAKE2b-256 checksum How to use checksums |
4d905801f8afec491d963e0040e9dca092684c7076e7b69d0d192914ed269945
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for g4music-discord-rpc 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.