QueryLMS创建了一个简单的接口,用于向Logitech媒体服务器和相关播放器发出查询和命令
QueryLMS的Python项目详细描述
QueryLMS公司
QueryLMS管理对Logitech媒体服务器的查询并与单个播放器关联。QueryLMS对象可用于查询服务器或播放器状态信息并控制LMS播放器。在
QueryLMS是对LMSQuery的重写,它重用了LMSQuery代码的很大一部分。在
用法:
import QueryLMS
# create the object and try to discover LMS on the local network
# try to associate with "My Player"
my_player = QueryLMS(player_name='My Player')
# get now playing tracks
my_player.get_now_playing()
>>> {'time': 0,
'mode': 'stop',
'id': 17001,
'title': 'We Belong Together',
'artist': 'Vampire Weekend feat. Danielle Haim',
'coverid': 'c9d646ff',
'duration': 190.733,
'album_id': '2064',
'genre': 'No Genre',
'album': 'Father of the Bride',
'artwork_url': 'http://192.168.178.9:9000/music/c9d646ff/cover.jpg'}
# create the object with a defined hostname and port
# try to associate with player "Living Room"
living_room = QueryLMS(host="media-server.local", port=9001, player_name="Living Room")
美国石油学会
如果未设置player_id,则所有与播放器相关的调用都将引发ValueError。在
^{pr2}$- 项目
标签: