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

Download files issue #42

Open
socpl425 opened this issue Mar 1, 2021 · 2 comments
Open

Download files issue #42

socpl425 opened this issue Mar 1, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@socpl425
Copy link

socpl425 commented Mar 1, 2021

Hi,
I'm using cam.get_file( .. ) to download from cam.get_motion_files(start=start, end=end, streamtype=streamtype) .

It works great, but sometimes it seems to just hang and never finish download. At that point it also looks like the Reolink android app has issues connecting to camera, at least the settings page. If I manually kill (ctrl C!) my program and start over again it works to download and back to normal.

Is it possible to add a timeout function to get_file operation? Just kill it if it does not work after N seconds..

Camera: RLC 410W 4MP

Thanks! love the api

@Benehiko
Copy link
Member

Benehiko commented Mar 2, 2021

Hi thank you for using the library! :)

So afaik the requests should auto timeout after about 1 second (the default state set in the code).
See

with requests.get(self.url, params=params, stream=True, verify=False, timeout=(1, None)) as req:

It might be an issue that the post requests don't have a specific timeout

r = requests.post(url, verify=False, params=params, json=data, headers=headers,

You could try add it in the code and see if the results change.

PR's are welcome! :)

@Benehiko Benehiko added the enhancement New feature or request label Mar 2, 2021
@socpl425
Copy link
Author

socpl425 commented Mar 4, 2021

Thanks! And thanks for all contributions

I can't consistently reproduce the issue, but I will try the timeout as suggested in post.

Also separately, I had a "get snap" program running continuously where I did not use logout function so maybe I inadvertently caused some of the issues on the reolink side. After I added a logout, seems like this non "timeout" issue is not occuring. But again, might be totally unrelated:)

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

No branches or pull requests

2 participants