{"library":"pyytlounge","title":"PyYTLounge","description":"A Python wrapper for the YouTube Lounge API, enabling remote control of YouTube on connected screens (e.g., TV, Chromecast). Current version 3.2.0, requires Python >=3.9. Released on GitHub with active maintenance, roughly monthly release cadence.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pyytlounge"],"cli":null},"imports":["from pyytlounge import YtLoungeApi","from pyytlounge import EventListener","from pyytlounge import DisconnectedEvent","from pyytlounge import create_credentials"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import asyncio\nfrom pyytlounge import YtLoungeApi, create_credentials, EventListener\n\nclass MyListener(EventListener):\n    async def disconnected(self, event):\n        print(f\"Disconnected: {event.reason}\")\n\nasync def main():\n    credentials = create_credentials(\"YOUR_SCREEN_NAME\", \"YOUR_PAIRING_CODE\")\n    api = YtLoungeApi(credentials)\n    api.set_event_listener(MyListener())\n    await api.connect()\n    await api.play_video(\"dQw4w9WgXcQ\")\n    await asyncio.sleep(10)\n    await api.disconnect()\n\nasyncio.run(main())","lang":"python","description":"Basic example of connecting to a YouTube screen and playing a video.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}