Skip to content

Instantly share code, notes, and snippets.

@c0ns0le
Forked from dardo82/MyFreeCams.sh
Created April 4, 2016 06:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save c0ns0le/e8628da78b5fa258be7a0bdb2fb9f297 to your computer and use it in GitHub Desktop.
Save c0ns0le/e8628da78b5fa258be7a0bdb2fb9f297 to your computer and use it in GitHub Desktop.
MyFreeCams on AppleTV
#!/bin/sh
ROOMID="$(curl -s $(echo "$1" | awk '{sub(/www/,"profiles"); sub(/#/,""); print $0}') | awk -F/ '/\/[0-9]{7,8}\//{print $6; exit}')"
if [ ${#ROOMID} -eq 7 ]; then
PREFIX="10"; else
PREFIX="1"
fi
MFCURL="http://video .myfreecams.com:1935/NxServer/mfc_$PREFIX$ROOMID.f4v_aac/playlist.m3u8"
for n in $(seq 340 492); do
STREAM=${MFCURL/ /$n}
if [ $(curl -s -Y1024 -y1 $STREAM | grep CODECS) ]; then
break
fi
done
echo $STREAM
ENCURL=$(curl -s -G -w %{url_effective} --data-urlencode $STREAM "" | awk '{print substr($0,3)}')
open "airflick://"; sleep 10; open "airflick://play-media?MediaLocation=$ENCURL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment