YouTube chromecast api
casttube provides a way to interact with the Youtube Chromecast api.
pip install casttube
- Play video
- Add video to the end of the play queue
- Play next
- Remove video
from casttube import YouTubeSession session = YouTubeSession(screen_id) # YouTube video id is http://youtube.com/watch?v=video_id session.play_video(video_id)
The library requires 2 things:
- screen id
- The Chromecast youtube app needs to be open
There is a small script in https://github.com/ur1katz/CastTube-Scripts to print the screen id and launch the app.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.