Created
August 26, 2018 12:20
-
-
Save Yuiki/86450bca93b0b0e8a74f3b2c3892cbc9 to your computer and use it in GitHub Desktop.
Play YouTube on Chrome Cast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pychromecast | |
from pychromecast.controllers.youtube import YouTubeController | |
CAST_NAME = "" | |
VIDEO_ID = "" | |
chromecasts = pychromecast.get_chromecasts() | |
cast = next(cc for cc in chromecasts if cc.device.friendly_name == CAST_NAME) | |
cast.wait() | |
yt = YouTubeController() | |
cast.register_handler(yt) | |
yt.play_video(VIDEO_ID) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment