mirror of
https://github.com/thelittlerocket/CAM4Recorder.git
synced 2025-01-31 10:08:56 +08:00
Update CAM4Recorder.py
This commit is contained in:
parent
0750e8faa8
commit
efdd29a212
1 changed files with 34 additions and 31 deletions
|
@ -30,6 +30,7 @@ i = 1
|
||||||
|
|
||||||
|
|
||||||
def startRecording(model):
|
def startRecording(model):
|
||||||
|
try:
|
||||||
req = urllib.request.Request('https://www.cam4.com/' + model)
|
req = urllib.request.Request('https://www.cam4.com/' + model)
|
||||||
req.add_header('UserAgent', UserAgent)
|
req.add_header('UserAgent', UserAgent)
|
||||||
resp = urllib.request.urlopen(req)
|
resp = urllib.request.urlopen(req)
|
||||||
|
@ -61,6 +62,8 @@ def startRecording(model):
|
||||||
data = fd.read(1024)
|
data = fd.read(1024)
|
||||||
f.write(data)
|
f.write(data)
|
||||||
except:
|
except:
|
||||||
|
pass
|
||||||
|
if model in recording:
|
||||||
recording.remove(model)
|
recording.remove(model)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue