Jugran / lyrics-in-terminal

Python curses application to view lyrics of current playing song in terminal.
MIT License
250 stars 20 forks source link

Search lyrics from VLC and cvlc #8

Closed henrikbeck95 closed 3 years ago

henrikbeck95 commented 3 years ago
def get_bus(self):
        try:
            self.session_bus = dbus.SessionBus()
            self.player_bus = self.session_bus.get_object(f'org.mpris.MediaPlayer2.{self.player_name}', '/org/mpris/MediaPlayer2')
            self.player_interface = dbus.Interface(self.player_bus, 'org.freedesktop.DBus.Properties')
            self.running = True
        except dbus.exceptions.DBusException:
            self.running = False
Jugran commented 3 years ago

Glad to hear that you liked this project.

I've tested VLC in various distribution packages (including snap and flatpak) and should be working fine.

Have you tried updating the application from pip?

pip install -U lyrics-in-terminal

If still not working then can you provide full output of following while vlc is playing

$ qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata
henrikbeck95 commented 3 years ago

Thank you by the reply!

Between your last messange and this one I've formatted my laptop and I've also decided to test this software again in the newest operating system but it is not working with VLC too.

I'm using the lyrics-in-terminal 1.2.1 version. If it matters my current operating system is Ubuntu 20.04.1 and the shell is Bash. In the previous messenge I was using Pop_OS! 20.04 and the shell was ZSH.

In both sittuations I've used VLC as .deb distribution package and I've installed lyrics-in-terminal from pip3.

Following your suggest I've also tried these things:

  1. VLC installed by Snap package it returns vlc is not running! on Ubuntu.

  2. VLC installed by Flatpak package it also returns vlc is not running! on Ubuntu.

  3. The command $ pip3 install -U lyrics-in-terminal returns:

    Requirement already up-to-date: lyrics-in-terminal in ./.local/lib/python3.8/site-packages (1.2.1) Requirement already satisfied, skipping upgrade: dbus-python in /usr/lib/python3/dist-packages (from lyrics-in-terminal) (1.2.16)

The following screenshot can show you better what is happening.

Screenshot

Jugran commented 3 years ago

I think I understand what's happening here.

I use dbus to get Metadata of track playing in a mpris media player. If no Metadata is found is shows as player is not running. This functionality was made to stop searching for tracks without any proper Metadata or Advertisement tracks in case of spotify free account.

You are playing a video file in VLC which may not have Title and Artist info in its metadata. You can check for those fields in the output of following

$ qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata

You can edit such file's metadata through vlc from Tools -> Media information