spotilib.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:Spotilyrics 作者: eitchtee 项目源码 文件源码
def song_info_linux():
    if linux_status() == "Playing":
        session_bus = dbus.SessionBus()
        spotify_bus = session_bus.get_object("org.mpris.MediaPlayer2.spotify",
                                             "/org/mpris/MediaPlayer2")
        spotify_properties = dbus.Interface(spotify_bus,
                                            "org.freedesktop.DBus.Properties")
        metadata = spotify_properties.Get(
            "org.mpris.MediaPlayer2.Player", "Metadata")
        song_info = metadata['xesam:title']
        return song_info
    else:
        return "There is nothing playing at this moment"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号