-
Notifications
You must be signed in to change notification settings - Fork 75
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
Snapshot fails first time #232
Comments
broc@odroid:~$ python3 test.py
Traceback (most recent call last):
File "/home/broc/.local/lib/python3.10/site-packages/amcrest/http.py", line 150, in _generate_token
resp = self._command(cmd).content.decode()
File "/home/broc/.local/lib/python3.10/site-packages/amcrest/http.py", line 317, in _command
raise LoginError()
amcrest.exceptions.LoginError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/broc/test.py", line 18, in <module>
camera.snapshot(channel=1, path_file="/home/broc/snapshot_test.jpg")
File "/home/broc/.local/lib/python3.10/site-packages/amcrest/snapshot.py", line 84, in snapshot
ret = self.command(cmd, timeout_cmd=timeout, stream=stream)
File "/home/broc/.local/lib/python3.10/site-packages/amcrest/http.py", line 253, in command
self._generate_token()
File "/home/broc/.local/lib/python3.10/site-packages/amcrest/http.py", line 156, in _generate_token
resp = self._command(cmd).content.decode()
File "/home/broc/.local/lib/python3.10/site-packages/amcrest/http.py", line 317, in _command
raise LoginError()
amcrest.exceptions.LoginError |
Thinking this is because the http module tries Basic auth, then switches to Digest. Could probably set a preferred auth method in the class. That's what I see in wireshark and confirmed here: python-amcrest/src/amcrest/http.py Line 147 in 3c3fa58
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using the get-snapshot.py example I have to run it twice to actually get a snapshot. First time always fails then second and subsequent times will save the snapshot where I have specified. If I wait a minute or so and then try to run it again, the same process is repeated. How do I get it to grab a snapshot without having to run the code twice?
The text was updated successfully, but these errors were encountered: