Skip to content

Instantly share code, notes, and snippets.

@moondev
Last active March 31, 2021 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moondev/2fde11e7734f52d7e7fe484667cad20a to your computer and use it in GitHub Desktop.
Save moondev/2fde11e7734f52d7e7fe484667cad20a to your computer and use it in GitHub Desktop.
ChromeCast
ChromeCast v1
gobin -run github.com/rliebz/tusk@v0.6.1 -f <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)
ChromeCast init
#!/usr/bin/env bash
# curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd | bash
set -e
set -x
ARGS=$@
gobin -run github.com/rliebz/tusk@v0.6.1 -f <(cat <<-------
$(curl -sL https://gist.githubusercontent.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)
------) ${ARGS}
---
interpreter: gobin -run mvdan.cc/sh/v3/cmd/gosh@latest -c
options:
shell:
default:
value: gobin -run mvdan.cc/sh/v3/cmd/gosh@latest
bash:
default:
value: bash
neofetch:
default:
value: curl -sL https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch > /tmp/neofetch.sh && bash /tmp/neofetch.sh
go-chromecast:
default:
value: gobin -run github.com/vishen/go-chromecast@v0.2.9
cast:
default:
value: gobin -run github.com/barnybug/go-cast/cmd/cast@latest
yq3:
default:
value: gobin -run github.com/mikefarah/yq/v3/cmd@latest
tasks:
gosh:
run:
- ${shell}
neofetch:
run:
- ${neofetch}
screenfetch:
run:
- screenfetch
cast:
options:
url:
short: u
default:
value: https://www.youtube.com/watch?v=3D_n6-Qv6wI
run:
- ${go-chromecast} --first stop
# - ${cast} --name hd url load 'https://www.youtube.com/watch?v=wKxsKaYOHHc'
- ${cast} --name hd url load '${url}'
- task: events
events:
options:
device:
short: d
default:
value: hd
run:
# - ${go-chromecast} --device-name ${device} watch --output json
# -
# - ${go-chromecast} --first watch --output json | while read line; do echo $line | ${yq3} r - -PC
- gobin -run github.com/vishen/go-chromecast@v0.2.9 --first watch --output json | while read line; do echo $line | gobin -run github.com/mikefarah/yq/v3@latest r - -PC; done
volume:
level: 0.7
muted: false
application:
appId: 32EAB1DF
displayName: YouTube TV
isIdleScreen: false
statusText: YouTube
media:
mediaSessionId: 2136213666
playerState: PLAYING
currentTime: 36.662
idleReason: ""
volume:
level: 0.7
muted: false
currentItemId: 0
loadingItemId: 0
media:
contentId: uOF9lXPU6yQ
contentType: x-youtube/video
streamType: BUFFERED
duration: 2604.0251
metadata:
MetadataType: 0
artist: ""
title: Vanderpump Rules TV-14 • S8 E1 • There Goes the Neighborhood
subtitle: ""
images:
- url: https://yt3.ggpht.com/Rpz3xRJk6iqk_hzvTdzLWEdL4gSdRoTpMpgxrrDVazylvI6v780Rqk7Y10-DcrPYboPDyIRwgxA=ns-nd
height: 400
width: 400
releaseDate: ""
volume:
level: 0.7
muted: false
application:
appId: 621A7B1E
displayName: NBC One App Receiver
isIdleScreen: false
sessionId: 4a5755c0-97a7-4d33-ab09-2de5262a5418
statusText: 'Casting: The No Good, Very Bad Rosé Day'
transportId: 4a5755c0-97a7-4d33-ab09-2de5262a5418
media:
mediaSessionId: 4
playerState: PLAYING
currentTime: 1556.225
idleReason: ""
volume:
level: 1
muted: false
currentItemId: 7
loadingItemId: 0
media:
contentId: "3478985"
contentType: application/x-mpegurl
streamType: BUFFERED
duration: 2604.078
metadata:
MetadataType: 2
artist: ""
title: The No Good, Very Bad Rosé Day
subtitle: ""
images:
- url: https://img.nbc.com/sites/nbcunbc/files/images/2021/1/20/7b7a8379-16cc-3f11-86af-998bd8f4c91d.jpg
height: 0
width: 0
releaseDate: ""
volume:
level: 0.7
muted: false
volume:
level: 0.7
muted: false
application:
appId: 5CB45E5A
displayName: URL Cast Receiver
isIdleScreen: false
sessionId: 2b781040-b5f9-43f7-85f3-882a2d638472
statusText: "MK Live Set @ ULTRA Music Festival Miami 2015 \☀ - YouTube"
transportId: 2b781040-b5f9-43f7-85f3-882a2d638472
media: null
volume:
level: 0.7
muted: false
gobin -run github.com/rliebz/tusk@v0.6.1 -f <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml) neofetch
ChromeCast krew plugin
#!/usr/bin/env bash
set -e
set -x
go install -v github.com/myitcv/gobin@latest
gosh="gobin -run mvdan.cc/sh/v3/cmd/gosh@latest"
yq3="gobin -run github.com/mikefarah/yq/v3/cmd@latest"
gochromecast="gobin -run github.com/vishen/go-chromecast@v0.2.9"
cast="gobin -run github.com/barnybug/go-cast/cmd/cast@latest"
cat <<------- > /tmp/ytid && ${gochromecast} --first stop && ${cast} --name hd url load $(cat /tmp/ytid) && ${gochromecast} --first --watch --output json
https://www.youtube.com/watch?v=HDkCCxzVmfk
------
${gochromecast} --first --watch --output json | while read line; do echo $line | ${yq4} r - -PC; done
cat --name hd url load https://www.youtube.com/watch?v=dAVyKuS_noI
gobin -run github.com/rliebz/tusk@v0.6.1 -f <(cat <<-------
tasks:
neofetch:
run:
- neofetch
------)
gobin -run github.com/rliebz/tusk@v0.6.1 -f <(cat <<-------
$(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)
#$(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)
------)
@moondev
Copy link
Author

moondev commented Mar 31, 2021

@moondev
Copy link
Author

moondev commented Mar 31, 2021

$SHELL <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd)
$SHELL <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd) neofetch
curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/run | $SHELL
$SHELL -c (curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/run)
bash <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/run) neofetch

@moondev
Copy link
Author

moondev commented Mar 31, 2021

$SHELL <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd) -h
$SHELL <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd) neofetch

@moondev
Copy link
Author

moondev commented Mar 31, 2021

curl -sL https://gist.githubusercontent.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/387ad84fa9c048bae7663a1cfafcce145dce41ef/neofetch | $SHELL

@moondev
Copy link
Author

moondev commented Mar 31, 2021

$SHELL <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd)  cast -u 'https://www.youtube.com/watch?v=7EUVJaKJtBY'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment