hoyon / mpv-mpris

MPRIS plugin for mpv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FR] Thumbnail support

FunctionalHacker opened this issue · comments

Some mpris clients make use of album art, most notably KDE Connect. When I listen to music on MPD with the MPDris plugin, KDE Connect gets the album art from the mpris protocol and displays it on my phone. Example data with playerctl:

$ playerctl metadata | grep artUrl
playerctld mpris:artUrl              file:///home/frodo/Music/Eminem/Relapse/cover.jpg

It would be very nice to do the same thing when I watch a youtube video with mpv and mpv-mpris. Local files obviously wouldn't have a thumbnail.

At least on the command line, you can get the thumbnail URL like this:

$ youtube-dl --list-thumbnails "https://www.youtube.com/watch?v=HaMjPs66cTs"
[info] Thumbnails for HaMjPs66cTs:
ID  width    height  URL
0   unknown  unknown https://i.ytimg.com/vi/HaMjPs66cTs/maxresdefault.jpg

So in the end it would just involve getting the thumbnail URL and publishing it as artUrl. What do you think, is this something that is worth it to implement in this plugin?

I'd also love to have this feature!
+1

Awesome, just built the latest master and it works beautifully!

Thanks for the quick implementation!

Did it stop to work? It doesn't get the cover no matter what for me

Edit. it seems to work only with files named cover*, does it work with embedded images?
Edit2. checked the source, was missing folder.png which was needed for gpodder.

@barolo Embedded images aren't supported as afaik there's no way to get it from mpv and reading the file manually doesn't seem worth the effort.

PR welcome to add missing thumbnail filenames.