python-ring-doorbell
python-ring-doorbell copied to clipboard
get_snapshot() gives 405 error
get_snapshot responds with a 405 error even when using new auth method
405 Client Error: Method Not Allowed for url: https://api.ring.com/clients_api/snapshots/timestamps?api_version=9
Previously working 1/11 @ 8:46a EDT per #147
Got it to work and actually do snapshot with this change
def get_snapshot(self, retries=3, delay=1):
"""Take a snapshot and download it"""
try:
url = SNAPSHOT_TIMESTAMP_ENDPOINT
payload = {"doorbot_ids": [self._attrs.get("id")]}
self._ring.query(url, method="POST", json=payload)
request_time = time.time()
for _ in range(retries):
time.sleep(delay)
response = self._ring.query(url, method="POST", json=payload).json()
if response["timestamps"][0]["timestamp"] / 1000 > request_time:
return self._ring.query(
SNAPSHOT_ENDPOINT.format(self._attrs.get("id"))
).content
return False
except:
return False
I am not sure if #147 is related to the new Ring feature of taking ~5min still frame recordings? But that feature is/would be perfect for what I want, which is a continuous still frame feed. I used to compile timelapse of noon frames over a year for example, so having them at whatever frequency I can see in my app scrubber is great, once I determine how to fetch them all.
I am also seeing that the snapshots are always between 3 and 5 minutes old.
There hasn't been any activity on this issue recently. This issue has been automatically marked as stale because of that. It will be closed if no further activity occurs. Please make sure to update to the latest ring_doorbell version and check if that solves the issue. Thank you for your contributions.