mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
8.09k stars 644 forks source link

Use channel name as artist for MPRIS metadata? #1139

Open christopher-dG opened 3 years ago

christopher-dG commented 3 years ago

Issue / Suggestion

It would be nice if, even perhaps as a fallback, the YouTube channel name could be used as the artist for MPRIS metadata. Especially useful for when you're watching/listening to a video that is not music. I'd be happy to work on this myself if someone can point me in the right direction!

Your Environment

Arch Linux, installed with mps-youtube-git.

mpsyt version      : 0.2.8
   notes           : released 17 February 2018
pafy version       : 0.5.5 (youtube-dl backend)
youtube-dl version : 2021.01.03
Python version     : 3.9.1 (default, Dec 13 2020, 11:55:53)
[GCC 10.2.0]
Processor          :
Machine type       : x86_64
Architecture       : 64bit, ELF
Platform           : Linux-5.10.4-arch2-1-x86_64-with-glibc2.32
sys.stdout.enc     : utf-8
default enc        : utf-8
Config dir         : /home/degraafc/.config/mps-youtube
env:TERM           : alacritty
env:SHELL          : /bin/zsh
env:LANG           : en_US.UTF-8

Music player: mpv

christopher-dG commented 3 years ago

Upon reading the code a bit I can see where the metadata is generated, and it's done solely on the video title. As far as I can tell, the channel name isn't tracked anywhere, so a fix won't be super trivial at least.

https://github.com/mps-youtube/mps-youtube/blob/4c6ee0f8f4643fc1308e637b622d0337bf9bce1b/mps_youtube/player.py#L147 https://github.com/mps-youtube/mps-youtube/blob/4c6ee0f8f4643fc1308e637b622d0337bf9bce1b/mps_youtube/util.py#L510