Skip to content

Instantly share code, notes, and snippets.

@dardo82
Last active August 13, 2016 23:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dardo82/f037908b4fb6b501bdfd to your computer and use it in GitHub Desktop.
Save dardo82/f037908b4fb6b501bdfd 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"
@raberto-nowhere
Copy link

Do you know what the numbers 340 and 492 are in your loop there?

@dardo82
Copy link
Author

dardo82 commented Aug 24, 2015

@raberto-nowhere
Copy link

That makes sense. Thank you! Was there ever a room that you couldn't stream because the video stream ($n) wasn't found?

@dardo82
Copy link
Author

dardo82 commented Oct 3, 2015

I don't use it very often, so i am not sure what the failure rate is... Sorry. :-/
Maybe if you use it more than me, you could tell me it... ;-)

@raberto-nowhere
Copy link

I can try :) Do you have documentation from where you learned to write the script?

@dardo82
Copy link
Author

dardo82 commented Aug 13, 2016

@dardo82
Copy link
Author

dardo82 commented Aug 13, 2016

chaturbate() { mplayer $(curl -q -s https://m.chaturbate.com/$1/ | awk -F"'" '/m3u8/{print $2}'); }

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