YouTube Music Desktop Remote Control API
Async IO API package for YouTube Music Desktop app.
Installation
python3 -m pip install aioytmdesktopapi
Contents
This package contains the YtmDesktop
class which represents the API.
Check the API documentation to see what functionality is available and how to use it.
Example usage
Check example.py
for a runnable example.
async with aiohttp.ClientSession() as session:
async with YtmDesktop(session, "192.168.1.123", password="PASSWORD") as ytmdesktop:
await ytmdesktop.initialize()
print(f"{ytmdesktop.player.has_song=}")
print(f"{ytmdesktop.player.is_paused=}")
print(f"{ytmdesktop.track.author=}")
print(f"{ytmdesktop.track.title=}")
print(f"{ytmdesktop.track.album=}")
await ytmdesktop.send_command.track_pause()
await ytmdesktop.update()
print(f"{ytmdesktop.player.is_paused=}")
time.sleep(2)
await ytmdesktop.send_command.track_play()
await ytmdesktop.update()
print(f"{ytmdesktop.player.is_paused=}")