Last active
August 29, 2015 14:24
-
-
Save dardo82/9acc36326316b10d70bd to your computer and use it in GitHub Desktop.
NowVideo on AppleTV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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