ytmd-sdk


Nameytmd-sdk JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryA Python SDK for interacting with the YouTube Music Desktop App.
upload_time2024-08-13 00:22:50
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords youtube music desktop sdk api ytmd ytmd-sdk youtube-music youtube-music-desktop youtube-music-desktop-app
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Youtube Music Desktop SDK
Simple SDK for controlling [Youtube Music Desktop App](https://ytmdesktop.app/).

## Installation
`pip install ytmd-sdk`

## Example
```python
from YTMDSDK import Events, YTMD, Parser
from time import sleep

ytmd = YTMD("touchportalytmd", "TouchPortalYTMD", "1.0.0")

key = ytmd.authenticate() # get token key and sets it at same time
# ytmd.update_token("token") # if you already have a token key you can set it like this

def on_connect():
    print("Connected to YTMD")

def on_disconnect():
    print("Disconnected from YTMD")

def on_error(data):
    print("Error from YTMD: " + data)

def on_state_update(data):
    parser = Parser(data)
    print("Player: " + str(parser.player_state))
    print("Player State: " + parser.player_state.state)
    print("Player video progress: " + str(parser.player_state.video_progress))
    print("Player volume: " + str(parser.player_state.volume))
    print("Player muted: " + str(parser.player_state.muted))
    print("Player ad playing: " + str(parser.player_state.adPlaying))
    print("Player auto play: " + str(parser.player_state.auto_play))
    print("Player is generating: " + str(parser.player_state.isGenerating))
    print("Player is infinite: " + str(parser.player_state.isInfinite))
    print("Player repeat mode: " + parser.player_state.repeatMode)
    print("Player selected item index: " + str(parser.player_state.selectedItemIndex))
    print("Player queue: " + str(parser.player_state.queue))

ytmd.register_event(Events.connect, on_connect)
ytmd.register_event(Events.disconnect, on_disconnect)
ytmd.register_event(Events.error, on_error)
ytmd.register_event(Events.state_update, on_state_update)

ytmd.connect()
sleep(60)
```

## Change Log
```
- 1.0.0: Initial release
```

## Bugs and Suggestions
If you have any bugs or suggestions, feel free to open an issue or a pull request.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ytmd-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Damien Staeber <damienweifen@gmail.com>",
    "keywords": "youtube, music, desktop, sdk, api, ytmd, ytmd-sdk, youtube-music, youtube-music-desktop, youtube-music-desktop-app",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/3f/94/34bacaca669fa96ed2583529fe53c093b2323127e4c1e377dad0a030ef2a/ytmd_sdk-1.0.1.tar.gz",
    "platform": null,
    "description": "# Youtube Music Desktop SDK\nSimple SDK for controlling [Youtube Music Desktop App](https://ytmdesktop.app/).\n\n## Installation\n`pip install ytmd-sdk`\n\n## Example\n```python\nfrom YTMDSDK import Events, YTMD, Parser\nfrom time import sleep\n\nytmd = YTMD(\"touchportalytmd\", \"TouchPortalYTMD\", \"1.0.0\")\n\nkey = ytmd.authenticate() # get token key and sets it at same time\n# ytmd.update_token(\"token\") # if you already have a token key you can set it like this\n\ndef on_connect():\n    print(\"Connected to YTMD\")\n\ndef on_disconnect():\n    print(\"Disconnected from YTMD\")\n\ndef on_error(data):\n    print(\"Error from YTMD: \" + data)\n\ndef on_state_update(data):\n    parser = Parser(data)\n    print(\"Player: \" + str(parser.player_state))\n    print(\"Player State: \" + parser.player_state.state)\n    print(\"Player video progress: \" + str(parser.player_state.video_progress))\n    print(\"Player volume: \" + str(parser.player_state.volume))\n    print(\"Player muted: \" + str(parser.player_state.muted))\n    print(\"Player ad playing: \" + str(parser.player_state.adPlaying))\n    print(\"Player auto play: \" + str(parser.player_state.auto_play))\n    print(\"Player is generating: \" + str(parser.player_state.isGenerating))\n    print(\"Player is infinite: \" + str(parser.player_state.isInfinite))\n    print(\"Player repeat mode: \" + parser.player_state.repeatMode)\n    print(\"Player selected item index: \" + str(parser.player_state.selectedItemIndex))\n    print(\"Player queue: \" + str(parser.player_state.queue))\n\nytmd.register_event(Events.connect, on_connect)\nytmd.register_event(Events.disconnect, on_disconnect)\nytmd.register_event(Events.error, on_error)\nytmd.register_event(Events.state_update, on_state_update)\n\nytmd.connect()\nsleep(60)\n```\n\n## Change Log\n```\n- 1.0.0: Initial release\n```\n\n## Bugs and Suggestions\nIf you have any bugs or suggestions, feel free to open an issue or a pull request.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python SDK for interacting with the YouTube Music Desktop App.",
    "version": "1.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/KillerBOSS2019/YTMD_SDK/issues",
        "Changelog": "https://github.com/KillerBOSS2019/YTMD_SDK/blob/main/README.md#change-log",
        "Documentation": "https://github.com/KillerBOSS2019/YTMD_SDK/blob/main/README.md",
        "Homepage": "https://github.com/KillerBOSS2019/YTMD_SDK",
        "Repository": "https://github.com/KillerBOSS2019/YTMD_SDK"
    },
    "split_keywords": [
        "youtube",
        " music",
        " desktop",
        " sdk",
        " api",
        " ytmd",
        " ytmd-sdk",
        " youtube-music",
        " youtube-music-desktop",
        " youtube-music-desktop-app"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "46c0bd44b69903220738d2a010b06760ace05eba66b3bdc4be119e167fd00510",
                "md5": "0a3f1c8e5e86fdcbff606f09ef91c254",
                "sha256": "26d05544aa0545096bcf80ae2e22c991305de689ca897b6f1615584f46ea88ca"
            },
            "downloads": -1,
            "filename": "ytmd_sdk-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0a3f1c8e5e86fdcbff606f09ef91c254",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 20119,
            "upload_time": "2024-08-13T00:22:49",
            "upload_time_iso_8601": "2024-08-13T00:22:49.364239Z",
            "url": "https://files.pythonhosted.org/packages/46/c0/bd44b69903220738d2a010b06760ace05eba66b3bdc4be119e167fd00510/ytmd_sdk-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f9434bacaca669fa96ed2583529fe53c093b2323127e4c1e377dad0a030ef2a",
                "md5": "0f9623a5af2fdd7316ce5fe6d7fc7350",
                "sha256": "20f3da034557d12fbf4b789472940ada7c9a04ab6d52dc63f6310c723811370a"
            },
            "downloads": -1,
            "filename": "ytmd_sdk-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0f9623a5af2fdd7316ce5fe6d7fc7350",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 20798,
            "upload_time": "2024-08-13T00:22:50",
            "upload_time_iso_8601": "2024-08-13T00:22:50.632909Z",
            "url": "https://files.pythonhosted.org/packages/3f/94/34bacaca669fa96ed2583529fe53c093b2323127e4c1e377dad0a030ef2a/ytmd_sdk-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-13 00:22:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "KillerBOSS2019",
    "github_project": "YTMD_SDK",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ytmd-sdk"
}
        
Elapsed time: 0.92772s