Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot download ring videos #350

Open
SergiuCip opened this issue Feb 17, 2024 · 4 comments
Open

Cannot download ring videos #350

SergiuCip opened this issue Feb 17, 2024 · 4 comments

Comments

@SergiuCip
Copy link

SergiuCip commented Feb 17, 2024

When trying to download a video i get the following error: Got error: RingError('HTTP error with status code 404 during query of url https://api.ring.com/clients_api/dings/

Please help

@sdb9696
Copy link
Collaborator

sdb9696 commented Feb 17, 2024

Can you provide a bit more information. How are you trying to download it? Do other queries work? Maybe post some logs etc?

@SergiuCip
Copy link
Author

SergiuCip commented Feb 17, 2024

Sure,
So I can run the following commands: ring-doorbell list, ring-doorbell motion-detection --device-name "DEVICENAME" --on, ring-doorbell history --device-name "Front Door" but when I try running the following command ring-doorbell videos --download-all command, I get the following error:

❯ ring-doorbell videos --download-all
---------------------------------
Ring CLI
	Getting videos linked on your Ring account.
	This may take some time....

	Downloading 70 videos linked on your Ring account.
	This may take some time....

	1/70 Downloading xxxx.mp4
Got error: RingError('HTTP error with status code 404 during query of url https://api.ring.com/clients_api/dings/xxxx/recording: 404 Client Error: Not Found for url: https://share-service-download-bucket.s3.amazonaws.com/xxxxx.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxSignedHeaders=host&X-Amz-Signature=xxxx')

Traceback (most recent call last):
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/ring_doorbell/auth.py", line 163, in query
    resp.raise_for_status()
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://share-service-download-bucket.s3.amazonaws.com/xxxmp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/ring_doorbell/cli.py", line 47, in __call__
    asyncio.run(self.main(*args, **kwargs))
  File "/Users/sergiu/miniforge3/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/Users/sergiu/miniforge3/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/asyncclick/core.py", line 1120, in main
    rv = await self.invoke(ctx)
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/asyncclick/core.py", line 1739, in invoke
    return await _process_result(await sub_ctx.command.invoke(sub_ctx))
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/asyncclick/core.py", line 1485, in invoke
    return await ctx.invoke(self.callback, **ctx.params)
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/asyncclick/core.py", line 824, in invoke
    rv = await rv
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/asyncclick/core.py", line 824, in invoke
    rv = await rv
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/ring_doorbell/cli.py", line 584, in videos
    device.recording_download(event["id"], filename=filename, override=False)
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/ring_doorbell/doorbot.py", line 387, in recording_download
    req = self._ring.query(url, timeout=timeout)
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/ring_doorbell/ring.py", line 142, in query
    return self._query(url, method, extra_params, data, json, timeout)
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/ring_doorbell/ring.py", line 155, in _query
    response = self.auth.query(
  File "/Users/sergiu/miniforge3/lib/python3.10/site-packages/ring_doorbell/auth.py", line 165, in query
    raise RingError(
ring_doorbell.exceptions.RingError: HTTP error with status code 404 during query of url https://api.ring.com/clients_api/dings/xxxx/recording: 404 Client Error: Not Found for url: https://share-service-download-bucket.s3.amazonaws.com/

unless python3 isn't supported?

@5E7EN
Copy link

5E7EN commented Feb 19, 2024

Encountering the same error now using Python 3.8 (albeit a different endpoint) - yesterday it worked fine:

ring_doorbell.exceptions.RingError: HTTP error with status code 404 during query of url 
https://api.ring.com/clients_api/doorbots/[...]/history: 404 Client Error: Not Found for url: 
https://api.ring.com/clients_api/doorbots/[...]/history?limit=50&older_than=[...]

This is thrown when invoking the recording_download() function only, in my case.
Other functions work fine and provide results properly, like update_data() and devices().

Related #242

@chrisnicholls
Copy link

I have noticed the same thing using the cli
ring-doorbell videos --download

By manually clicking on the link after getting the 404, I realized that it works, and if i re-run the same cli command, the first video then downloads and the 2nd fails, and this can be repeated for the rest of the videos.

I believe what's happening is the download process is an async process. It takes a few moments for the file to get exported to the s3 bucket before it is actually available to download.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants