From 5b019c09f4034c3fee8be9d56f2c13ca824b7027 Mon Sep 17 00:00:00 2001 From: Shravan Mandava Date: Wed, 31 Dec 2025 02:59:15 +0000 Subject: [PATCH] Add Cover Art to Output Now displays album cover art along with basic song data --- src/musefetch/__main__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/musefetch/__main__.py b/src/musefetch/__main__.py index 68beb99..0cf3ac3 100644 --- a/src/musefetch/__main__.py +++ b/src/musefetch/__main__.py @@ -1,5 +1,6 @@ import dbus import json +from term_image.image import from_url def get_players(): @@ -25,6 +26,11 @@ def main(): ) 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"Artist(s): {', '.join(metadata.get('xesam:artist', ['Unknown']))}") print(f"Album: {metadata.get('xesam:album', 'Unknown')}")