Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Plugin request] Myfreecams #561

Open
TL447 opened this issue Oct 9, 2014 · 9 comments
Open

[Plugin request] Myfreecams #561

TL447 opened this issue Oct 9, 2014 · 9 comments

Comments

@TL447
Copy link

TL447 commented Oct 9, 2014

On their mobile site http://m.myfreecams.com/ some of the shows have mobile feeds, IIRC they are HLS. I've been able to get the RTMP URL by pressing the live feed button and inspecting the player area but now it says my browser doesn't support video playback.

@VackerSimon
Copy link

When you visit a room on the mobile site m.myfreecams.com it loads a URL that looks like this
http://video462.myfreecams.com:1935/NxServer/mfc_107253378.f4v_aac/playlist.m3u8?nc=1423603882490
which can be played in livestreamer with hlsvariant:// infront. It will play fine without the nc parameter so that can be skipped.

The information you need to fill out the URL can also be found on the desktop site.
In the object with id "fvideo" there are a few , the one with name="flashvars" has all the info you need. server=video463 and roomID=107253378 which you just put in http://$server.myfreecams.com:1935/NxServer/mfc_$roomID.f4v_aac/playlist.m3u8

I don't know how to make a plugin but the information above might help someone make one, I'm not sure how you go directly to a room tho.

@Sembiance
Copy link

I figured out how to do this with code.

Here is a node.js script that will take a myfreecams URL or model name, and output the correct livestreamer hlsvariant url: https://gist.github.com/Sembiance/df151de0006a0bf8ae54
Note: You need to run npm install websocket before running the node.js script.

Essentially the steps are:

  1. Connect to the myfreecams websocket chat server (with appropriate origin and cookie)
  2. Send appropriate hello and guest login message
  3. Wait for message type '005369' which contains a URL encoded 'fileno' field
  4. Fetch a javascript file from web: "http://www.myfreecams.com/mfc2/php/mobj.php?f=" + fileno + "&s=xchat20"
  5. Parse part of the JS file as JSON and then find the matching username (nm field) in the list of users and get the users 'uid' and 'camserv'
  6. Format the url as: hlsvariant://http://video" + (modelData.u.camserv-500) + ".myfreecams.com:1935/NxServer/mfc_" + (100000000+modelData.uid) + ".f4v_aac/playlist.m3u8?nc=1423603882490"

Now you can execute livestreamer with the outputed hlsvariant URL and it will work.

Should be fairly straightforward for someone to convert my nodejs script into a python plugin.

@dardo82
Copy link

dardo82 commented Jun 18, 2015

I have done that, related to MyFreeCams, if it can help:
http://gist.github.com/dardo82/f037908b4fb6b501bdfd
It is a simple script in bash to watch it on AppleTV... 8-)

#!/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://video4  .myfreecams.com:1935/NxServer/mfc_$PREFIX$ROOMID.f4v_aac/playlist.m3u8"
for n in $(seq 38 92); 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"

@Alexo88
Copy link

Alexo88 commented Sep 27, 2018

i need this but im new.

@dardo82
Copy link

dardo82 commented Sep 27, 2018

i need this

Then use it.

@Alexo88
Copy link

Alexo88 commented Sep 30, 2018

i need this

Then use it.

looks like rrly complex for me. it fis working?

@dardo82
Copy link

dardo82 commented Oct 1, 2018

i need this

Then use it.

looks like rrly complex for me. it fis working?

Your English isn’t working, fix it first.

@Alexo88
Copy link

Alexo88 commented Oct 1, 2018

i need this

Then use it.

looks like rrly complex for me. it fis working?

Your English isn’t working, fix it first.

sorry. looks like rrly complex for me. it is working?

@dardo82
Copy link

dardo82 commented Oct 2, 2018

i need this

Then use it.

looks like rrly complex for me. it fis working?

Your English isn’t working, fix it first.

sorry. looks like rrly complex for me. it is working?

...

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

No branches or pull requests

6 participants