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.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

aioytmdesktopapi-0.1.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aioytmdesktopapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 67ad6ee45cbef84c75fedd06f41a5beabc11e52024ba562eb68d0fb05db114fb
MD5 d78c97c671410ef3f22af9598c1dcdca
BLAKE2b-256 14f9060e26a1bd4718a7d6259fc97bd552cbbe72c2ddb2dac4b607e1503b59bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aioytmdesktopapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6bdacbf21f57ec010e39ce60a5190d6efaba3ec07bca36ce70e6d1c562719fcc
MD5 f93c3bd5bb7a4d40ddadee665993f21c
BLAKE2b-256 c858ae40f1beb90a388c41dc96659475a95495597aca90045dba78c9ed2b5dc4

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