Asyncio API package for YouTube Music Desktop app (https://ytmdesktop.app/).
Project description
YouTube Music Desktop Remote Control API
Async IO API pacakage for YouTube Music Desktop app.
Installation
python3 -m pip install aioytmdesktopapi
Contents
This package contains the YtmDesktop
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:
# Initialize first before using any of the functionality
await ytmdesktop.initialize()
# Print status of some attributes
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=}")
# Pause the current track
await ytmdesktop.send_command.track_pause()
# Call `.update()` to update the internal state of the API with the state of the actual player instance
await ytmdesktop.update()
# Print updated state
print(f"{ytmdesktop.player.is_paused=}")
time.sleep(2)
# Play the current track
await ytmdesktop.send_command.track_play()
# Call `.update()` to update the internal state of the API with the state of the actual player instance
await ytmdesktop.update()
# Print updated state
print(f"{ytmdesktop.player.is_paused=}")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aioytmdesktopapi-0.0.1.tar.gz
.
File metadata
- Download URL: aioytmdesktopapi-0.0.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c7f16a9df90bc3d9346c7923df78442f02ba311b926ee857b71ffc6228091f2 |
|
MD5 | 99a62c7d1cba3891f16cc945c90cb9c5 |
|
BLAKE2b-256 | 52d4421f5778c9036700ad0c6fd84c4b8c4bf650103375da232a8fbbd04d575b |
File details
Details for the file aioytmdesktopapi-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: aioytmdesktopapi-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1e56b1237209107c62490df894f3421ffe66cc11e4236a400fcd1b3f7020ffb |
|
MD5 | 7a63116e6c00ebd8cde1e7415e598d17 |
|
BLAKE2b-256 | b04b59e1b6059ec84cdc2f290849314d2bd882efc71e9633190378034e76179f |