예제 #1
0
파일: dropcam.py 프로젝트: lwneal/dropcam
def apiv1_request(url, params):
    response = requests.get(url=url, params=params, cookies=login.get_cookiejar())
    if not response.ok:
        print("Request failed: {0}".format(response.content))
        return None
    response_dict = response.json()
    if response_dict["status"] != 0 or not response_dict["items"]:
        print(response_dict)
        return None
    else:
        return response_dict["items"][0]
예제 #2
0
파일: dropcam.py 프로젝트: lwneal/dropcam
 def __init__(self, username=None, password=None):
     login.get_cookiejar(username, password)
     params = dict(group_cameras=True)
     self.data = apiv1_request(_CAMERAS_PATH, params)
예제 #3
0
파일: dropcam.py 프로젝트: lwneal/dropcam
def nexus_data_request(url, params):
    response = requests.get(url, params=params, cookies=login.get_cookiejar())
    if not response.ok:
        print("Request failed: {0}".format(response.content))
        return None
    return response.content