add shortcuts
This commit is contained in:
parent
73eccc64b5
commit
a78c5bf7c3
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import pychromecast
|
||||
from pychromecast.controllers.youtube import YouTubeController
|
||||
|
||||
CC_IP = '192.168.178.22'
|
||||
|
||||
playing = True
|
||||
|
||||
video_id = sys.argv[1]
|
||||
|
||||
cast = pychromecast.Chromecast(CC_IP)
|
||||
cast.wait()
|
||||
yt = YouTubeController()
|
||||
cast.register_handler(yt)
|
||||
yt.play_video(video_id)
|
||||
|
||||
|
||||
|
||||
mc = cast.media_controller
|
||||
|
||||
for line in sys.stdin:
|
||||
if playing:
|
||||
mc.pause()
|
||||
else:
|
||||
mc.play()
|
||||
playing = not playing
|
|
@ -0,0 +1,2 @@
|
|||
python $HOME/chromeCast-py/das_erste.py
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
bash $HOME/db/ld-ka.sh
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import pychromecast
|
||||
|
||||
|
||||
CC_IP = '192.168.178.22'
|
||||
|
||||
cast = pychromecast.Chromecast(CC_IP)
|
||||
cast.wait()
|
||||
|
||||
|
||||
mc = cast.media_controller
|
||||
|
||||
# see https://github.com/mediathekview/zapp/blob/0df9ea4eccc3ddc9ca9d344f7d5c1916e19696e0/app/src/main/res/raw/channels.json
|
||||
mc.play_media(sys.argv[1], 'application/vnd.apple.mpegurl')
|
||||
mc.block_until_active()
|
|
@ -6,7 +6,7 @@ echo $url
|
|||
if [[ "$url" =~ "youtube" ]]; then
|
||||
video_id=$(echo $url | sed 's#https://www.youtube.com/watch?v=##g')
|
||||
echo $video_id
|
||||
youtube.py $video_id
|
||||
python $HOME/chromeCast-py/youtube.py $video_id
|
||||
exit 0
|
||||
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue