Quote:
Originally Posted by horacio
In my opinion, it would be necessary to analyze the python script ...
|
the python script gets the JSON model data directly from the websocket-server - thats the big different to all the other MFC recorders!
Code:
server = 0
print(" => Connecting to MFC Server <= ")
print ""
try:
xchat = [ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 39, 40, 41, 42, 43, 44, 45, 46,
47, 48, 49, 56, 57, 58, 59, 60, 61
]
host = "ws://xchat"+str(random.choice(xchat)) + ".myfreecams.com:8080/fcsl"
ws = create_connection(host)
ws.send("hello fcserver\n\0")
ws.send("1 0 0 20071025 0 guest:guest\n\0")
except:
print(colored(" => We're fucked <= ", 'yellow', 'on_red'))
sys.exit()
rembuf = ""
quitting = 0
while quitting == 0:
sock_buf = ws.recv()
sock_buf = rembuf+sock_buf
rembuf = ""
while True:
hdr = re.search (r"(\w+) (\w+) (\w+) (\w+) (\w+)", sock_buf)
if bool(hdr) == 0:
break
fc = hdr.group(1)
mlen = int(fc[0:4])
fc_type = int(fc[4:])
msg = sock_buf[4:4+mlen]
if len(msg) < mlen:
rembuf = ''.join(sock_buf)
break
msg = urllib.unquote(msg)
if fc_type == 1:
ws.send("10 0 0 20 0 %s\n\0" % camgirl)
elif fc_type == 10:
read_model_data(msg)
quitting = 1
sock_buf = sock_buf[4+mlen:]
if len(sock_buf) == 0:
break
ws.close()