aioytmdesktopapi


Nameaioytmdesktopapi JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/mvdwetering/aioytmdesktopapi
SummaryAsyncio API package for YouTube Music Desktop app (https://ytmdesktop.app/).
upload_time2024-01-01 17:47:35
maintainer
docs_urlNone
authorMichel van de Wetering
requires_python
licenseApache License 2.0
keywords automation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # YouTube Music Desktop Remote Control API

Async IO API package for [YouTube Music Desktop app](https://ytmdesktop.app/).

## Installation

```bash
python3 -m pip install aioytmdesktopapi
```

## Contents

This package contains the `YtmDesktop` class which represents the API.
Check the [API documentation](https://github.com/ytmdesktop/ytmdesktop/wiki/Remote-Control-API) to see what functionality is available and how to use it.


## Example usage

Check `example.py` for a runnable example.

```python

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=}")
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mvdwetering/aioytmdesktopapi",
    "name": "aioytmdesktopapi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "automation",
    "author": "Michel van de Wetering",
    "author_email": "michel.van.de.wetering+ytmdesktop@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/43/15/064db30725e935a853be30c42e787d98f1808e815dab8cfef7390f4c041b/aioytmdesktopapi-0.1.2.tar.gz",
    "platform": null,
    "description": "# YouTube Music Desktop Remote Control API\n\nAsync IO API package for [YouTube Music Desktop app](https://ytmdesktop.app/).\n\n## Installation\n\n```bash\npython3 -m pip install aioytmdesktopapi\n```\n\n## Contents\n\nThis package contains the `YtmDesktop` class which represents the API.\nCheck the [API documentation](https://github.com/ytmdesktop/ytmdesktop/wiki/Remote-Control-API) to see what functionality is available and how to use it.\n\n\n## Example usage\n\nCheck `example.py` for a runnable example.\n\n```python\n\nasync with aiohttp.ClientSession() as session:\n    async with YtmDesktop(session, \"192.168.1.123\", password=\"PASSWORD\") as ytmdesktop:\n        # Initialize first before using any of the functionality\n        await ytmdesktop.initialize()\n\n        # Print status of some attributes\n        print(f\"{ytmdesktop.player.has_song=}\")\n        print(f\"{ytmdesktop.player.is_paused=}\")\n        print(f\"{ytmdesktop.track.author=}\")\n        print(f\"{ytmdesktop.track.title=}\")\n        print(f\"{ytmdesktop.track.album=}\")\n\n        # Pause the current track\n        await ytmdesktop.send_command.track_pause()\n        # Call `.update()` to update the internal state of the API with the state of the actual player instance\n        await ytmdesktop.update()\n        # Print updated state\n        print(f\"{ytmdesktop.player.is_paused=}\")\n\n        time.sleep(2)\n\n        # Play the current track\n        await ytmdesktop.send_command.track_play()\n        # Call `.update()` to update the internal state of the API with the state of the actual player instance\n        await ytmdesktop.update()\n        # Print updated state\n        print(f\"{ytmdesktop.player.is_paused=}\")\n```\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Asyncio API package for YouTube Music Desktop app (https://ytmdesktop.app/).",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/mvdwetering/aioytmdesktopapi"
    },
    "split_keywords": [
        "automation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "914096857edf2338ff9ebb44953d065084fd35516df23f58fd6211edbc6d4e67",
                "md5": "e226bd2cbcf094abf4ef475e09ba156c",
                "sha256": "bebfdaa1ad9f259cc61b1db3ae7d40729817d809150932fa30da4a7254b62126"
            },
            "downloads": -1,
            "filename": "aioytmdesktopapi-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e226bd2cbcf094abf4ef475e09ba156c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10959,
            "upload_time": "2024-01-01T17:47:34",
            "upload_time_iso_8601": "2024-01-01T17:47:34.210921Z",
            "url": "https://files.pythonhosted.org/packages/91/40/96857edf2338ff9ebb44953d065084fd35516df23f58fd6211edbc6d4e67/aioytmdesktopapi-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4315064db30725e935a853be30c42e787d98f1808e815dab8cfef7390f4c041b",
                "md5": "7b955bad99fcbb7d7428d2de9efeaae9",
                "sha256": "8089b507301591a2acdfbafeb075f2885d6bb85fc36e9da59f3c3c53e991f26a"
            },
            "downloads": -1,
            "filename": "aioytmdesktopapi-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "7b955bad99fcbb7d7428d2de9efeaae9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11049,
            "upload_time": "2024-01-01T17:47:35",
            "upload_time_iso_8601": "2024-01-01T17:47:35.670706Z",
            "url": "https://files.pythonhosted.org/packages/43/15/064db30725e935a853be30c42e787d98f1808e815dab8cfef7390f4c041b/aioytmdesktopapi-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-01 17:47:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mvdwetering",
    "github_project": "aioytmdesktopapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "aioytmdesktopapi"
}
        
Elapsed time: 0.17602s