PDA

View Full Version : Automated Cam4 downloading (script inside, need help for MFC)


yerman
07-09-2013, 08:07 AM
Hi All

Ive updated my scripts to automatically download cam4 files.

Requirements
Linux
Bash
Python
IPTables
vncserver
rtmp linux user
screen
firefox
patched rtmpsuck Link (http://stream-recorder.com/forum/customized-rtmpdump-binaries-patch-file-t16103.html)

Firstly set an iptables rule to capture traffic for the rtmp user

iptables -t nat -A OUTPUT -p tcp --dport 1935 -m owner --uid-owner rtmp -j REDIRECT

then create a session for the rtmp user
su rtmp -c "vncserver -geometry 1024x768 :1"

then create a screen session with rtmpsuck running in a temp directory of your choice:

screen -dmS RTMPSUCKSCREEN bash -c " cd /media/storage/dropbox/videos/temp/; /usr/local/sbin/rtmpsuck"

I wrote the follwowing simple bash script, it will


Open firefox on the models page
wait for rtmpsuck to create the Command.txt
kill firefox
spawn a screen session with rtmpdump



cam4.sh - call using cam4.sh <modelname>

#!/bin/bash
#clear the environment
rm /media/storage/dropbox/videos/temp/* UPDATE WITH YOUR TEMP PATH
#kill any hanging chrome sessions with cam in the process
id=`ps aux | grep firefox | grep cam | head -n 1 | awk -F ' ' '{print $2}'`
kill -9 $id
flag=false


#spawn a chrome session as the rtmp user so their traffic will be forwarded to rtmpsuck
su - rtmp -c "firefox -new-instance --display=:1 \"http://www.cam4.co.uk/$1\" &"

#while the command.txt file is missing keep waiting
while ! $flag
do
if [ -f /media/storage/dropbox/videos/temp/Command.txt ]; then UPDATE WITH YOUR TEMP PATH
flag=true
fi
done

#we have the file now kill firefox
id=`ps aux | grep firefox | grep cam | head -n 1 | awk -F ' ' '{print $2}'`
kill -9 $id

#grab the rtmpdump command
cmd=`cat /media/storage/dropbox/videos/temp/Command.txt` UPDATE WITH YOUR TEMP PATH
cmd=`echo $cmd | sed 's/-o \"2013.*//g'`
cmd="export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib;$cmd -o \"/media/storage/dropbox/videos/cam4/`date +"%m_%d_%y_%H_%M"`_$1.flv\""
echo $cmd
echo "running screen for" $1
screen -dmS capture_$1 bash -c "$cmd"

yerman
07-09-2013, 08:07 AM
I have tried to get the same for myfreecams but im getting the following error, I have another python script with checks if the cam4 model is online and will spawn the above script, ill be willing to trade if someone can help with the MFC version.

.
root@HIDEN> ./rtmpdump -r "rtmp://video261.myfreecams.com:1935/NxServer" -a "NxServer" -f "LNX 11,2,202,291" -W "http://www.myfreecams.com/mfc2/flash/MfcVideo130606.swf" -p "http://www.myfreecams.com" -C N:126525846.000000 -C S:dimjegyBP6Fai5VjI3ZDKhKGlSNAf8T8 -C N:105638205.000000 -C S:DOWNLOAD -C N:5638205.000000 -y "mp4:mfc_105638205.f4v" -o "/media/storage/dropbox/videos/mfc/07_09_13_14_53_Jessy89sweet.flv" -V
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
DEBUG: Protocol : RTMP
DEBUG: Hostname : video261.myfreecams.com
DEBUG: Port : 1935
DEBUG: Playpath : mp4:mfc_105638205.f4v
DEBUG: tcUrl : rtmp://video261.myfreecams.com:1935/NxServer
DEBUG: swfUrl : http://www.myfreecams.com/mfc2/flash/MfcVideo130606.swf
DEBUG: pageUrl : http://www.myfreecams.com
DEBUG: app : NxServer
DEBUG: flashVer : LNX 11,2,202,291
DEBUG: live : no
DEBUG: timeout : 30 sec
DEBUG: SWFSHA256:
DEBUG: 73 e9 d5 8b 09 d7 18 f8 a3 ab 77 a6 63 a4 ba 31
DEBUG: 26 d7 9c 0f e5 f6 05 92 3d 59 16 4d b5 95 bb 7f
DEBUG: SWFSize : 367813
DEBUG: Setting buffer time to: 36000000ms
Connecting ...
DEBUG: RTMP_Connect1, ... connected, handshaking
DEBUG: HandShake: Client type: 03
DEBUG: HandShake: Client digest offset: 417
DEBUG: HandShake: Initial client digest:
DEBUG: 69 ad 8d c1 0e 7f dc d2 59 f0 aa a0 be ea d7 d1
DEBUG: 52 cc bf f3 28 2a 8c 3f ae e1 b8 39 f3 bc 3f dd
DEBUG: HandShake: Type Answer : 03
DEBUG: HandShake: Server Uptime : 610135275
DEBUG: HandShake: FMS Version : 3.5.7.1
DEBUG: HandShake: Calculated digest key from secure key and server digest:
DEBUG: 54 40 f0 3f fd 40 a4 aa 49 39 ae e8 d3 d2 41 e0
DEBUG: 69 f0 1a 08 ea 55 4d 06 13 c1 6c fb 46 0d 57 42
DEBUG: HandShake: Client signature calculated:
DEBUG: b1 46 15 16 0b 30 1b 9e 39 2e c5 5c 05 39 11 d3
DEBUG: 20 d0 4d 39 09 7e 26 fd c8 57 d8 8e 6b 75 82 9c
DEBUG: HandShake: Server sent signature:
DEBUG: 17 91 24 ff 42 45 91 66 59 17 69 17 1f 42 ff 35
DEBUG: e2 0f e0 8a 16 96 e4 f0 ea a2 73 15 7e 8e c2 0c
DEBUG: HandShake: Digest key:
DEBUG: 25 41 54 41 96 19 01 fc 0e 74 5b 4f 79 53 6c 9b
DEBUG: 4d 14 db 8c 55 44 2b 30 33 08 85 07 7f 74 6d b3
DEBUG: HandShake: Signature calculated:
DEBUG: 17 91 24 ff 42 45 91 66 59 17 69 17 1f 42 ff 35
DEBUG: e2 0f e0 8a 16 96 e4 f0 ea a2 73 15 7e 8e c2 0c
DEBUG: HandShake: Genuine Adobe Flash Media Server
DEBUG: HandShake: Handshaking finished....
DEBUG: RTMP_Connect1, handshaked
DEBUG: Invoking connect
INFO: Connected...
DEBUG: HandleServerBW: server BW = 2500000
DEBUG: HandleClientBW: client BW = 2500000 2
DEBUG: RTMP_ClientPacket, received: invoke 242 bytes
DEBUG: (object begin)
DEBUG: Property: <Name: no-name, STRING: _result>
DEBUG: Property: <Name: no-name, NUMBER: 1.00>
DEBUG: Property: <Name: no-name, OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name: fmsVer, STRING: FMS/3,5,7,7009>
DEBUG: Property: <Name: capabilities, NUMBER: 127.00>
DEBUG: Property: <Name: mode, NUMBER: 1.00>
DEBUG: (object end)
DEBUG: Property: <Name: no-name, OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name: level, STRING: status>
DEBUG: Property: <Name: code, STRING: NetConnection.Connect.Success>
DEBUG: Property: <Name: description, STRING: Connection succeeded.>
DEBUG: Property: <Name: objectEncoding, NUMBER: 3.00>
DEBUG: Property: <Name: data, ECMA_ARRAY>
DEBUG: (object begin)
DEBUG: Property: <Name: version, STRING: 3,5,7,7009>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_result>
DEBUG: HandleInvoke, received result for method call <connect>
DEBUG: sending ctrl, type: 0x0003
DEBUG: Invoking createStream
DEBUG: RTMP_ClientPacket, received: invoke 524 bytes
DEBUG: (object begin)
DEBUG: Property: <Name: no-name, STRING: loginResult>
DEBUG: Property: <Name: no-name, NUMBER: 3488621.00>
DEBUG: Property: NULL
DEBUG: Property: <Name: no-name, OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name: Handle, NUMBER: 1.00>
DEBUG: Property: <Name: challenge, STRING: (function(){var a=102,b=126-100,c=251.1706189127|0,d=119.1924111063|0,e=174,f= 238-185,g=165.1801470184|0,h=158>>0,i=288-185,j=172>>0,k=84,l=42,m=356>>2,n=190,o=241,p=180.971235036|0,q=97.1178101264|0, r=112>>0,s=948>>2,t=223>>0,u=79,v=101,w=205-64>
DEBUG: Property: <Name: userID, NUMBER: 10865575.00>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <loginResult>
DEBUG: RTMP_ClientPacket, received: invoke 116 bytes
DEBUG: (object begin)
DEBUG: Property: <Name: no-name, STRING: UpdateSession>
DEBUG: Property: <Name: no-name, NUMBER: 0.00>
DEBUG: Property: NULL
DEBUG: Property: <Name: no-name, OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name: cmd, NUMBER: 20.00>
DEBUG: Property: <Name: cmdarg1, NUMBER: 126243113.00>
DEBUG: Property: <Name: cmdarg2, NUMBER: 5638205.00>
DEBUG: Property: <Name: cmdarg3, NUMBER: 0.00>
DEBUG: Property: <Name: cmdarg4, NUMBER: 0.00>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <UpdateSession>
DEBUG: RTMP_ClientPacket, received: invoke 29 bytes
DEBUG: (object begin)
DEBUG: Property: <Name: no-name, STRING: _result>
DEBUG: Property: <Name: no-name, NUMBER: 2.00>
DEBUG: Property: NULL
DEBUG: Property: <Name: no-name, NUMBER: 1.00>
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <_result>
DEBUG: HandleInvoke, received result for method call <createStream>
DEBUG: SendPlay, seekTime=0, stopTime=0, sending play: mp4:mfc_105638205.f4v
DEBUG: Invoking play
DEBUG: sending ctrl, type: 0x0003
DEBUG: HandleChangeChunkSize, received: chunk size change to 4096
DEBUG: HandleCtrl, received ctrl, type: 0, len: 6
DEBUG: HandleCtrl, Stream Begin 1
DEBUG: RTMP_ClientPacket, received: invoke 162 bytes
DEBUG: (object begin)
DEBUG: Property: <Name: no-name, STRING: onStatus>
DEBUG: Property: <Name: no-name, NUMBER: 0.00>
DEBUG: Property: NULL
DEBUG: Property: <Name: no-name, OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name: level, STRING: status>
DEBUG: Property: <Name: code, STRING: NetStream.Play.Reset>
DEBUG: Property: <Name: description, STRING: Playing and resetting RickRolled.>
DEBUG: Property: <Name: details, STRING: RickRolled>
DEBUG: Property: <Name: clientid, STRING: 8q0Y-zWp>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onStatus>
DEBUG: HandleInvoke, onStatus: NetStream.Play.Reset
DEBUG: RTMP_ClientPacket, received: invoke 156 bytes
DEBUG: (object begin)
DEBUG: Property: <Name: no-name, STRING: onStatus>
DEBUG: Property: <Name: no-name, NUMBER: 0.00>
DEBUG: Property: NULL
DEBUG: Property: <Name: no-name, OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name: level, STRING: status>
DEBUG: Property: <Name: code, STRING: NetStream.Play.Start>
DEBUG: Property: <Name: description, STRING: Started playing RickRolled.>
DEBUG: Property: <Name: details, STRING: RickRolled>
DEBUG: Property: <Name: clientid, STRING: 8q0Y-zWp>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onStatus>
DEBUG: HandleInvoke, onStatus: NetStream.Play.Start
Starting download at: 0.000 kB
DEBUG: HandleCtrl, received ctrl, type: 31, len: 6
DEBUG: HandleCtrl, Stream BufferEmpty 1
DEBUG: RTMP_SendPause, 1, pauseTime=0
DEBUG: Invoking pause
DEBUG: HandleCtrl, received ctrl, type: 32, len: 6
DEBUG: HandleCtrl, Stream BufferReady 1
DEBUG: RTMP_ClientPacket, received: notify 24 bytes
DEBUG: (object begin)
DEBUG: Property: <Name: no-name, STRING: |RtmpSampleAccess>
DEBUG: Property: <Name: no-name, BOOLEAN: FALSE>
DEBUG: Property: <Name: no-name, BOOLEAN: FALSE>
DEBUG: (object end)
DEBUG: HandleCtrl, received ctrl, type: 31, len: 6
DEBUG: HandleCtrl, Stream BufferEmpty 1
DEBUG: HandleCtrl, received ctrl, type: 32, len: 6
DEBUG: HandleCtrl, Stream BufferReady 1
DEBUG: HandleCtrl, received ctrl, type: 0, len: 6
DEBUG: HandleCtrl, Stream Begin 1
DEBUG: RTMP_ClientPacket, received: invoke 136 bytes
DEBUG: (object begin)
DEBUG: Property: <Name: no-name, STRING: onStatus>
DEBUG: Property: <Name: no-name, NUMBER: 4.00>
DEBUG: Property: NULL
DEBUG: Property: <Name: no-name, OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name: level, STRING: error>
DEBUG: Property: <Name: code, STRING: NetStream.Failed>
DEBUG: Property: <Name: description, STRING: Pause 1 failed, invalid arguments.>
DEBUG: Property: <Name: clientid, STRING: 8q0Y-zWp>
DEBUG: (object end)
DEBUG: (object end)
DEBUG: HandleInvoke, server invoking <onStatus>
DEBUG: HandleInvoke, onStatus: NetStream.Failed
ERROR: Closing connection: NetStream.Failed
0.000 kB / 0.00 sec
DEBUG: RTMP_Read returned: 0
Download complete
DEBUG: Closing connection.

itsme
07-17-2013, 09:40 AM
do the challenge they sent you. (use netcat/tcpflow/w/e or get wireshark and check the legit stream). and remove your hash from your post... just use guest, you do realize I can logon onto mfc with that and spent your tokens?

and even my cat knows how to record cam4