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

aioytmdesktopapi-0.0.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for aioytmdesktopapi-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3c7f16a9df90bc3d9346c7923df78442f02ba311b926ee857b71ffc6228091f2
MD5 99a62c7d1cba3891f16cc945c90cb9c5
BLAKE2b-256 52d4421f5778c9036700ad0c6fd84c4b8c4bf650103375da232a8fbbd04d575b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aioytmdesktopapi-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1e56b1237209107c62490df894f3421ffe66cc11e4236a400fcd1b3f7020ffb
MD5 7a63116e6c00ebd8cde1e7415e598d17
BLAKE2b-256 b04b59e1b6059ec84cdc2f290849314d2bd882efc71e9633190378034e76179f

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