Skip to content

Instantly share code, notes, and snippets.

@LukeChannings
Created February 7, 2017 20:09
Show Gist options
  • Save LukeChannings/6ec328f92a85f7c4e2547682c619ab32 to your computer and use it in GitHub Desktop.
Save LukeChannings/6ec328f92a85f7c4e2547682c619ab32 to your computer and use it in GitHub Desktop.
play-video.py
#!/usr/bin/env python
import sys
import pychromecast
URL = sys.argv[1]
chromecasts = pychromecast.get_chromecasts()
cast = next(cc for cc in chromecasts if cc.device.friendly_name == "Living Room")
print(cast.device.model_name) # Chromecast Ultra
mc = cast.media_controller
mc.play_media(URL, 'video/mp4')
print(mc.status)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment