mirror of
https://github.com/horacio9a/cam4-anonymous.git
synced 2024-09-20 15:06:00 +08:00
v.1.0.7 Cam4 Remote 24/7 Anonymous RTMP Recorder
This commit is contained in:
parent
3d6f35aacb
commit
21ef6202fd
101
c4rr.py
101
c4rr.py
|
@ -1,4 +1,4 @@
|
||||||
# Cam4 Remote Anonymous RTMP Recorder v.1.0.6 by horacio9a for Python 2.7.13
|
# Cam4 Remote Anonymous RTMP Recorder v.1.0.7 by horacio9a for Python 2.7.13
|
||||||
|
|
||||||
import sys, os, urllib, urllib3, ssl, re, time, datetime, command
|
import sys, os, urllib, urllib3, ssl, re, time, datetime, command
|
||||||
urllib3.disable_warnings()
|
urllib3.disable_warnings()
|
||||||
|
@ -24,10 +24,24 @@ url ='https://www.cam4.com/{}'.format(model)
|
||||||
user_agent = {'user-agent': 'Mozilla/5.0 (Android; Mobile; rv:14.0) ..'}
|
user_agent = {'user-agent': 'Mozilla/5.0 (Android; Mobile; rv:14.0) ..'}
|
||||||
http = urllib3.PoolManager(10, headers=user_agent)
|
http = urllib3.PoolManager(10, headers=user_agent)
|
||||||
r = http.urlopen('GET',url)
|
r = http.urlopen('GET',url)
|
||||||
dec = (r.data)
|
enc = (r.data)
|
||||||
#dec=urllib.unquote(enc).decode()
|
dec=urllib.unquote(enc).decode()
|
||||||
|
|
||||||
if "Trending Cams" not in dec:
|
state0 = dec.split("showState: '")[1]
|
||||||
|
state = state0.split("'")[0]
|
||||||
|
|
||||||
|
if len(state) == 0:
|
||||||
|
print(colored(" => Model is OFFLINE or wrong name<=", 'yellow','on_blue'))
|
||||||
|
print
|
||||||
|
print(colored(" => END <=", 'yellow','on_blue'))
|
||||||
|
sys.exit()
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
|
print (colored(' => Model State => {} <=', 'white', 'on_green')).format(state)
|
||||||
|
print
|
||||||
|
|
||||||
|
if len(state) > 0:
|
||||||
try:
|
try:
|
||||||
age0 = dec.split('Age:</')[1]
|
age0 = dec.split('Age:</')[1]
|
||||||
age1 = age0.split('</')[0]
|
age1 = age0.split('</')[0]
|
||||||
|
@ -61,61 +75,36 @@ if "Trending Cams" not in dec:
|
||||||
print (colored(' => Age:{} * Location:{} * Status:{} * Job:{} <=', 'yellow', 'on_blue')).format(age,loc,sta,occ)
|
print (colored(' => Age:{} * Location:{} * Status:{} * Job:{} <=', 'yellow', 'on_blue')).format(age,loc,sta,occ)
|
||||||
print
|
print
|
||||||
|
|
||||||
if "rtmp:" in dec:
|
vau0 = dec.split('rtmp://')[1]
|
||||||
vau0 = dec.split('rtmp://')[1]
|
vau = vau0.split('/')[0]
|
||||||
vau = vau0.split('/')[0]
|
print (colored(' => App URL => {} <=', 'yellow', 'on_blue')).format(vau)
|
||||||
|
print
|
||||||
if len(vau) > 30:
|
|
||||||
print(colored(" => TRY AGAIN <=", 'yellow','on_blue'))
|
|
||||||
sys.exit()
|
|
||||||
else:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if len(vau) > 1:
|
|
||||||
hlsurl0 = dec.split("hlsUrl: '")[1]
|
|
||||||
hlsurl = hlsurl0.split("'")[0]
|
|
||||||
|
|
||||||
vpu0 = dec.split('videoPlayUrl":"')[1]
|
|
||||||
vpu = vpu0.split('"')[0]
|
|
||||||
|
|
||||||
model0 = vpu.split('-')[0]
|
|
||||||
|
|
||||||
swf0 = dec.split('playerUrl":"')[1]
|
|
||||||
swf = swf0.split('"')[0]
|
|
||||||
|
|
||||||
print (colored(' => App URL => {} <=', 'yellow', 'on_blue')).format(vau)
|
|
||||||
print
|
|
||||||
print (colored(' => Play URL => {} <=', 'yellow', 'on_blue')).format(vpu)
|
|
||||||
print
|
|
||||||
|
|
||||||
timestamp = str(time.strftime("%d%m%Y-%H%M%S"))
|
|
||||||
stime = str(time.strftime("%H:%M:%S"))
|
|
||||||
path = config.get('folders', 'output_folder')
|
|
||||||
filename = model0 + '_C4_' + timestamp
|
|
||||||
rtmp = config.get('files', 'rtmpdump')
|
|
||||||
fn = filename + '.flv'
|
|
||||||
pf = (path + fn)
|
|
||||||
print (colored(' => RTMP-REC => {} <=', 'yellow', 'on_red')).format(fn)
|
|
||||||
print
|
|
||||||
command = '{} -r"rtmp://{}/cam4-edge-live" -a"cam4-edge-live" -W"{}" --live -y"{}" -o"{}"'.format(rtmp,vau,swf,vpu,pf)
|
|
||||||
os.system(command)
|
|
||||||
print(colored(" => END <=", 'yellow','on_blue'))
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
else:
|
|
||||||
print(colored(" => Model in PRIVATE or AWAY ", 'yellow','on_red'))
|
|
||||||
print
|
|
||||||
print(colored(" => END <=", 'yellow','on_blue'))
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
|
if len(vau) > 30:
|
||||||
|
print(colored(" => TRY AGAIN <=", 'yellow','on_blue'))
|
||||||
|
sys.exit()
|
||||||
else:
|
else:
|
||||||
print(colored(" => Model is OFFLINE <=", 'yellow','on_red'))
|
pass
|
||||||
print
|
|
||||||
print(colored(" => END <=", 'yellow','on_blue'))
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
else:
|
if len(vau) > 1:
|
||||||
print(colored(" => Page Not Found <=", 'yellow','on_red'))
|
vpu0 = dec.split('videoPlayUrl":"')[1]
|
||||||
|
vpu = vpu0.split('"')[0]
|
||||||
|
rname = vpu.split('-')[0]
|
||||||
|
print (colored(' => Play URL => {} <=', 'yellow', 'on_blue')).format(vpu)
|
||||||
print
|
print
|
||||||
|
|
||||||
|
swf0 = dec.split('playerUrl":"')[1]
|
||||||
|
swf = swf0.split('"')[0]
|
||||||
|
|
||||||
|
timestamp = str(time.strftime("%d%m%Y-%H%M%S"))
|
||||||
|
path = config.get('folders', 'output_folder')
|
||||||
|
filename = rname + '_C4_' + timestamp
|
||||||
|
rtmp = config.get('files', 'rtmpdump')
|
||||||
|
fn = filename + '.flv'
|
||||||
|
pf = (path + fn)
|
||||||
|
print (colored(' => RTMP-REC => {} <=', 'yellow', 'on_red')).format(fn)
|
||||||
|
print
|
||||||
|
command = '{} -r"rtmp://{}/cam4-edge-live" -a"cam4-edge-live" -W"{}" --live -y"{}" -o"{}"'.format(rtmp,vau,swf,vpu,pf)
|
||||||
|
os.system(command)
|
||||||
print(colored(" => END <=", 'yellow','on_blue'))
|
print(colored(" => END <=", 'yellow','on_blue'))
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
Loading…
Reference in a new issue