{"id":18259123,"url":"https://github.com/github30/pichromecast","last_synced_at":"2025-04-04T19:32:38.670Z","repository":{"id":58549020,"uuid":"532427814","full_name":"GitHub30/pichromecast","owner":"GitHub30","description":"Library for MicroPython to communicate with the Google Chromecast.","archived":false,"fork":false,"pushed_at":"2022-09-04T12:45:09.000Z","size":34,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T05:47:05.745Z","etag":null,"topics":["cast","chromecast","chromecast-audio","internet-of-things","micropython","pypi","python","raspberry-pi","raspberry-pi-pico-rp2040","raspberry-pi-pico-w"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pichromecast","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GitHub30.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-04T03:23:53.000Z","updated_at":"2024-10-08T06:48:49.000Z","dependencies_parsed_at":"2022-09-04T04:52:05.117Z","dependency_job_id":null,"html_url":"https://github.com/GitHub30/pichromecast","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHub30%2Fpichromecast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHub30%2Fpichromecast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHub30%2Fpichromecast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GitHub30%2Fpichromecast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GitHub30","download_url":"https://codeload.github.com/GitHub30/pichromecast/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247238000,"owners_count":20906372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cast","chromecast","chromecast-audio","internet-of-things","micropython","pypi","python","raspberry-pi","raspberry-pi-pico-rp2040","raspberry-pi-pico-w"],"created_at":"2024-11-05T10:36:32.289Z","updated_at":"2025-04-04T19:32:33.664Z","avatar_url":"https://github.com/GitHub30.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Python](https://img.shields.io/pypi/pyversions/pichromecast.svg)](https://badge.fury.io/py/pichromecast)\n[![PyPI](https://badge.fury.io/py/pichromecast.svg)](https://badge.fury.io/py/pichromecast)\n# PiChromecast\nLibrary for MicroPython to communicate with the Google Chromecast.\n\n## Install\n`Tools` \u003e `Manage packages...`\n\n![image](https://user-images.githubusercontent.com/12811398/188298181-916f6997-2c25-4d4e-8a7f-a9152ce1c1e9.png)\n\nor copy and paste code\n\nhttps://github.com/GitHub30/pichromecast/blob/main/pichromecast.py\n\n## Usage\n\n```python\nfrom pichromecast import play_url\n\nplay_url('https://nyanpass.com/nyanpass.mp3', '192.168.10.101')\n```\n\nText to Speech\n\n```python\nfrom pichromecast import play_url, create_url\n\nplay_url(create_url('hello world', 'en'), '192.168.10.101')\n```\n\n```python\n# https://gist.github.com/SpotlightKid/eca9b00239104e8c599b86635f62ab73#file-urlencode-py\nfrom urlencode import urlencode\nfrom pichromecast import play_url\n\nurl = 'https://translate.google.com/translate_tts?client=tw-ob\u0026' + urlencode({'q': 'Hello, 世界', 'tl': 'ja'})\nplay_url(url, '192.168.10.101')\n```\n\n### Connect wifi and play\n```python\nimport network\nimport time\n\nwlan = network.WLAN(network.STA_IF)\nwlan.active(True)\nwlan.connect(\"aterm-SSID-g\", \"YOUR_PASSWORD\")\nwhile not wlan.isconnected() and wlan.status() \u003e= 0:\n    print(\"Waiting to connect:\")\n    time.sleep(1)\n\n\nfrom pichromecast import play_url\n\nplay_url('https://nyanpass.com/nyanpass.mp3', '192.168.10.101')\n```\n\n![image](https://user-images.githubusercontent.com/12811398/188296486-296ed2e6-84c1-493a-9125-202f22bd04cd.png)\n\n\n### Lookup host IP\n\n```python\n#pip install pychromecast\nimport pychromecast\n\nservices, browser = pychromecast.discovery.discover_chromecasts()\npychromecast.discovery.stop_discovery(browser)\nprint(services)\n[CastInfo(services={ServiceInfo(type='mdns', data='Google-Home-Mini-3b0a32dc5803130351919f8a286e406f._googlecast._tcp.local.')}, uuid=UUID('3b0a32dc-5803-1303-5191-9f8a286e406f'), model_name='Google Home Mini', friendly_name='書斎', host='192.168.10.101', port=8009, cast_type='audio', manufacturer='Google Inc.')]\n```\n\nor use [MicroPython MDNS](https://pypi.org/project/micropython-mdns/)\n\n## Demo\n\n[![Watch the video](https://img.youtube.com/vi/bA8fouVAPho/maxresdefault.jpg)](https://youtu.be/bA8fouVAPho)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub30%2Fpichromecast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub30%2Fpichromecast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub30%2Fpichromecast/lists"}