Skip to content

Instantly share code, notes, and snippets.

@moondev
Last active March 31, 2021 20:46
Show Gist options
  • Select an option

  • Save moondev/2fde11e7734f52d7e7fe484667cad20a to your computer and use it in GitHub Desktop.

Select an option

Save moondev/2fde11e7734f52d7e7fe484667cad20a to your computer and use it in GitHub Desktop.

Revisions

  1. moondev revised this gist Mar 31, 2021. No changes.
  2. moondev revised this gist Mar 31, 2021. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -40,8 +40,7 @@ tasks:
    - ${go-chromecast} --first stop
    # - ${cast} --name hd url load 'https://www.youtube.com/watch?v=wKxsKaYOHHc'
    - ${cast} --name hd url load '${url}'
    - ${go-chromecast} --first watch --output json
    - ${go-chromecast} --first watch --output json | while read line; do echo $line | ${yq3} r - -PC; done
    - task: events
    events:
    options:
    device:
  3. moondev revised this gist Mar 31, 2021. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions examples.url.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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
  4. moondev revised this gist Mar 31, 2021. 1 changed file with 33 additions and 0 deletions.
    33 changes: 33 additions & 0 deletions examples.bravo.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    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: ""
  5. moondev revised this gist Mar 31, 2021. 1 changed file with 38 additions and 0 deletions.
    38 changes: 38 additions & 0 deletions examples.nbc.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    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
  6. moondev revised this gist Mar 31, 2021. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -50,5 +50,6 @@ tasks:
    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

    # -
    # - ${go-chromecast} --first watch --output json | while read line; do echo $line | ${yq3} r - -PC
    - gobin -run github.com/vishen/[email protected] --first watch --output json | while read line; do echo $line | gobin -run github.com/mikefarah/yq/v3@latest r - -PC; done
  7. moondev revised this gist Mar 31, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@ tasks:
    # - ${cast} --name hd url load 'https://www.youtube.com/watch?v=wKxsKaYOHHc'
    - ${cast} --name hd url load '${url}'
    - ${go-chromecast} --first watch --output json
    - ${go-chromecast} --first watch --output json | while read line; do echo $line | ${yq3} r - -PC
    - ${go-chromecast} --first watch --output json | while read line; do echo $line | ${yq3} r - -PC; done
    events:
    options:
    device:
  8. moondev revised this gist Mar 31, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -49,6 +49,6 @@ tasks:
    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
    # - ${go-chromecast} --device-name ${device} watch --output json
    - ${go-chromecast} --first watch --output json | while read line; do echo $line | ${yq3} r - -PC

  9. moondev revised this gist Mar 31, 2021. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -42,5 +42,13 @@ tasks:
    - ${cast} --name hd url load '${url}'
    - ${go-chromecast} --first watch --output json
    - ${go-chromecast} --first watch --output json | while read line; do echo $line | ${yq3} r - -PC
    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

    ---
  10. moondev revised this gist Mar 31, 2021. 1 changed file with 22 additions and 0 deletions.
    22 changes: 22 additions & 0 deletions cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,15 @@ options:
    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/[email protected]
    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:
    @@ -21,4 +30,17 @@ tasks:
    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}'
    - ${go-chromecast} --first watch --output json
    - ${go-chromecast} --first watch --output json | while read line; do echo $line | ${yq3} r - -PC

    ---
  11. moondev revised this gist Mar 31, 2021. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -19,5 +19,6 @@ tasks:
    run:
    - ${neofetch}
    screenfetch:
    - screenfetch
    run:
    - screenfetch
    ---
  12. moondev revised this gist Mar 31, 2021. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,6 @@ tasks:
    neofetch:
    run:
    - ${neofetch}
    screenfetch:
    - screenfetch
    ---
  13. moondev revised this gist Mar 31, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions neofetch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    gobin -run github.com/rliebz/[email protected] -f <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml) neofetch
  14. moondev revised this gist Mar 31, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ options:
    value: bash
    neofetch:
    default:
    value: curl -sL https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch | ${bash}
    value: curl -sL https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch > /tmp/neofetch.sh && bash /tmp/neofetch.sh

    tasks:
    gosh:
  15. moondev revised this gist Mar 31, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ options:
    value: gobin -run mvdan.cc/sh/v3/cmd/gosh@latest
    bash:
    default:
    command: which bash
    value: bash
    neofetch:
    default:
    value: curl -sL https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch | ${bash}
  16. moondev revised this gist Mar 31, 2021. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -3,10 +3,13 @@ interpreter: gobin -run mvdan.cc/sh/v3/cmd/gosh@latest -c
    options:
    shell:
    default:
    value: gobin -run mvdan.cc/sh/v3/cmd/gosh@latest -c
    value: gobin -run mvdan.cc/sh/v3/cmd/gosh@latest
    bash:
    default:
    command: which bash
    neofetch:
    default:
    value: curl -sL https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch | $SHELL
    value: curl -sL https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch | ${bash}

    tasks:
    gosh:
  17. moondev revised this gist Mar 31, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bin
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    gobin -run github.com/rliebz/[email protected] -f <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml) $@
    gobin -run github.com/rliebz/[email protected] -f <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)
  18. moondev revised this gist Mar 31, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bin
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    gobin -run github.com/rliebz/[email protected] -f <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)gobin -run github.com/rliebz/[email protected] -f
    gobin -run github.com/rliebz/[email protected] -f <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml) $@
  19. moondev revised this gist Mar 31, 2021. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions bin
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    gobin -run github.com/rliebz/[email protected] -f <(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)gobin -run github.com/rliebz/[email protected] -f
  20. moondev revised this gist Mar 31, 2021. 2 changed files with 3 additions and 3 deletions.
    3 changes: 1 addition & 2 deletions cmd
    Original file line number Diff line number Diff line change
    @@ -7,5 +7,4 @@ ARGS=$@

    gobin -run github.com/rliebz/[email protected] -f <(cat <<-------
    $(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)
    ------
    ) ${ARGS}
    ------) ${ARGS}
    3 changes: 2 additions & 1 deletion cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -14,4 +14,5 @@ tasks:
    - ${shell}
    neofetch:
    run:
    - ${neofetch}
    - ${neofetch}
    ---
  21. moondev revised this gist Mar 31, 2021. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions cmd
    Original file line number Diff line number Diff line change
    @@ -6,9 +6,6 @@ set -x
    ARGS=$@

    gobin -run github.com/rliebz/[email protected] -f <(cat <<-------
    tasks:
    neofetch:
    run:
    - neofetch
    $(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)
    ------
    ) ${ARGS}
  22. moondev revised this gist Mar 31, 2021. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions run
    Original file line number Diff line number Diff line change
    @@ -17,13 +17,14 @@ ${gochromecast} --first --watch --output json | while read line; do echo $line |

    cat --name hd url load https://www.youtube.com/watch?v=dAVyKuS_noI

    gobin -run github.com/rliebz/[email protected] -f -<-------
    gobin -run github.com/rliebz/[email protected] -f <(cat <<-------
    tasks:
    neofetch:
    run:
    - neofetch
    ------
    ------)
    gobin -run github.com/rliebz/[email protected] -f -<-------
    gobin -run github.com/rliebz/[email protected] -f <(cat <<-------
    $(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)
    ------
    #$(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)
    ------)
  23. moondev revised this gist Mar 31, 2021. 2 changed files with 20 additions and 1 deletion.
    17 changes: 17 additions & 0 deletions cmd.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    ---
    interpreter: gobin -run mvdan.cc/sh/v3/cmd/gosh@latest -c
    options:
    shell:
    default:
    value: gobin -run mvdan.cc/sh/v3/cmd/gosh@latest -c
    neofetch:
    default:
    value: curl -sL https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch | $SHELL

    tasks:
    gosh:
    run:
    - ${shell}
    neofetch:
    run:
    - ${neofetch}
    4 changes: 3 additions & 1 deletion run
    Original file line number Diff line number Diff line change
    @@ -24,4 +24,6 @@ tasks:
    - neofetch
    ------


    gobin -run github.com/rliebz/[email protected] -f -<-------
    $(curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd.yaml)
    ------
  24. moondev revised this gist Mar 31, 2021. 2 changed files with 3 additions and 0 deletions.
    1 change: 1 addition & 0 deletions cmd
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #!/usr/bin/env bash
    # curl -sL https://gist.github.com/moondev/2fde11e7734f52d7e7fe484667cad20a/raw/cmd | bash
    set -e
    set -x

    2 changes: 2 additions & 0 deletions run
    Original file line number Diff line number Diff line change
    @@ -23,3 +23,5 @@ tasks:
    run:
    - neofetch
    ------


  25. moondev revised this gist Mar 31, 2021. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions cmd
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/usr/bin/env bash
    set -e
    set -x

    ARGS=$@

    gobin -run github.com/rliebz/[email protected] -f <(cat <<-------
    tasks:
    neofetch:
    run:
    - neofetch
    ------
    ) ${ARGS}
  26. moondev revised this gist Mar 31, 2021. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions run
    Original file line number Diff line number Diff line change
    @@ -6,14 +6,14 @@ 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"
    go-chromecast="gobin -run github.com/vishen/[email protected]"
    gochromecast="gobin -run github.com/vishen/[email protected]"
    cast="gobin -run github.com/barnybug/go-cast/cmd/cast@latest"

    cat <<------- > /tmp/ytid && ${go-chromecast} --first stop && ${cast} --name hd url load $(cat /tmp/ytid) && ${go-chromecast} --first --watch --output json
    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
    ------

    ${go-chromecast} --first --watch --output json | while read line; do echo $line | ${yq4} r - -PC; done
    ${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

  27. moondev revised this gist Mar 31, 2021. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion run
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,15 @@ cast="gobin -run github.com/barnybug/go-cast/cmd/cast@latest"

    cat <<------- > /tmp/ytid && ${go-chromecast} --first stop && ${cast} --name hd url load $(cat /tmp/ytid) && ${go-chromecast} --first --watch --output json
    https://www.youtube.com/watch?v=HDkCCxzVmfk
    ------
    ------

    ${go-chromecast} --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/[email protected] -f -<-------
    tasks:
    neofetch:
    run:
    - neofetch
    ------
  28. moondev revised this gist Mar 31, 2021. 1 changed file with 14 additions and 0 deletions.
    14 changes: 14 additions & 0 deletions run
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/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"
    go-chromecast="gobin -run github.com/vishen/[email protected]"
    cast="gobin -run github.com/barnybug/go-cast/cmd/cast@latest"

    cat <<------- > /tmp/ytid && ${go-chromecast} --first stop && ${cast} --name hd url load $(cat /tmp/ytid) && ${go-chromecast} --first --watch --output json
    https://www.youtube.com/watch?v=HDkCCxzVmfk
    ------
  29. moondev revised this gist Mar 31, 2021. 2 changed files with 2 additions and 0 deletions.
    1 change: 1 addition & 0 deletions api.v1.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ChromeCast v1
    1 change: 1 addition & 0 deletions plugin.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ChromeCast krew plugin
  30. moondev created this gist Mar 31, 2021.
    1 change: 1 addition & 0 deletions ChromeCast
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ChromeCast init