mirror of
https://tilde.club/~comet/git/musefetch.git
synced 2026-01-24 07:50:19 +00:00
Add Cover Art to Output
Now displays album cover art along with basic song data
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import dbus
|
import dbus
|
||||||
import json
|
import json
|
||||||
|
from term_image.image import from_url
|
||||||
|
|
||||||
|
|
||||||
def get_players():
|
def get_players():
|
||||||
@@ -25,6 +26,11 @@ def main():
|
|||||||
)
|
)
|
||||||
metadata = player.Get("org.mpris.MediaPlayer2.Player", "Metadata")
|
metadata = player.Get("org.mpris.MediaPlayer2.Player", "Metadata")
|
||||||
|
|
||||||
|
cover = from_url(metadata.get("mpris:artUrl", ""))
|
||||||
|
cover.height = 15
|
||||||
|
|
||||||
|
print(cover)
|
||||||
|
|
||||||
print(f"Title: {metadata.get('xesam:title', 'Unknown')}")
|
print(f"Title: {metadata.get('xesam:title', 'Unknown')}")
|
||||||
print(f"Artist(s): {', '.join(metadata.get('xesam:artist', ['Unknown']))}")
|
print(f"Artist(s): {', '.join(metadata.get('xesam:artist', ['Unknown']))}")
|
||||||
print(f"Album: {metadata.get('xesam:album', 'Unknown')}")
|
print(f"Album: {metadata.get('xesam:album', 'Unknown')}")
|
||||||
|
|||||||
Reference in New Issue
Block a user