Skip to main content

Asyncio API package for YouTube Music Desktop app (https://ytmdesktop.app/).

Project description

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:
        # 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

aioytmdesktopapi-0.1.2.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

aioytmdesktopapi-0.1.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file aioytmdesktopapi-0.1.2.tar.gz.

File metadata

  • Download URL: aioytmdesktopapi-0.1.2.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for aioytmdesktopapi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8089b507301591a2acdfbafeb075f2885d6bb85fc36e9da59f3c3c53e991f26a
MD5 7b955bad99fcbb7d7428d2de9efeaae9
BLAKE2b-256 4315064db30725e935a853be30c42e787d98f1808e815dab8cfef7390f4c041b

See more details on using hashes here.

File details

Details for the file aioytmdesktopapi-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for aioytmdesktopapi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bebfdaa1ad9f259cc61b1db3ae7d40729817d809150932fa30da4a7254b62126
MD5 e226bd2cbcf094abf4ef475e09ba156c
BLAKE2b-256 914096857edf2338ff9ebb44953d065084fd35516df23f58fd6211edbc6d4e67

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page