Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # USAGE
- # python lockvideo.py
- # DESCRIPTION
- # This will connect to the specifiec NVR, and lock the listed videos
- # import the necessary packages
- import requests
- import json
- import time
- from datetime import datetime
- def lock(files):
- #Basic vars
- base = "https://<ip-of-nvr>:7443/api/2.0/recording/"
- apiKey = "?apiKey=<nvr-api-key>"
- #Disable SSL warnings for now
- requests.packages.urllib3.disable_warnings()
- for record in files:
- record = record.split('-')
- record = record[1].split('.')
- recording = record[0]
- headers = {"Content-Type" : "application/json"}
- r = requests.put(base+recording+apiKey, data = json.dumps({'locked':'true'}), headers=headers, verify=False)
Add Comment
Please, Sign In to add comment