Skip to content

Instantly share code, notes, and snippets.

@dardo82
Last active August 29, 2015 14:24
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 dardo82/9acc36326316b10d70bd to your computer and use it in GitHub Desktop.
Save dardo82/9acc36326316b10d70bd to your computer and use it in GitHub Desktop.
NowVideo on AppleTV
#!/bin/zsh
URL=$1;URLMOB=${${URL/o\//o.php?id=}/i\//i\/mobile\/}
URLFLV=$(curl -s $URLMOB|awk -F\" '/.flv/{print $2}')
if [[ $URLFLV == *.mp4 ]];then
URLMP4=$URLFLV
else
curl -vO $URLFLV;FLV=${URLFLV##*/}
MP4=${FLV%.*}.mp4;ffmpeg -i $FLV $MP4;rm -frv $FLV;URLMP4=$PWD/$MP4
fi
URLENC=${"$(curl -sGw "%{url_effective}" --data-urlencode $URLMP4 "")":2:$}
open airflick://;sleep 10;open airflick://play-media\?MediaLocation=$URLENC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment