-
Notifications
You must be signed in to change notification settings - Fork 74
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
AD410 400 Error #177
Comments
You might want to try using Channel 1 (add ",1" to the file_find function). I've made some changes to media.py to get it working on my IP5M-B1186EW as there are some other issues against the latest API documentation, namely
@tchellomello, |
@wizmo2 , changing to action=close and action=destroy resolved the issue for me. What is weird, I definitely remember that factory.close and factory.destroy worked for me (~2 years ago). Does it make sense to do:
? |
@maximvelichko, This was I while ago that I looked at this. It would take me a while to go back and see what I did, so go ahead with your own PR. |
Hello,
Tried to use the get-files.py example, and it threw a 400 Client Error:
$ python3 /home/elliott/get-files.py
Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.2.145:80/cgi-bin/mediaFileFind.cgi?action=findFile&object=1831397672&condition.Channel=0&condition.StartTime=2021-07-10%2001:20:15.936236&condition.EndTime=2021-07-10%2007:20:15.936236')
Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.2.145:80/cgi-bin/mediaFileFind.cgi?action=findFile&object=1831397672&condition.Channel=0&condition.StartTime=2021-07-10%2001:20:15.936236&condition.EndTime=2021-07-10%2007:20:15.936236')
Trying again due to error: HTTPError('400 Client Error: Bad Request for url: http://192.168.2.145:80/cgi-bin/mediaFileFind.cgi?action=findFile&object=1831397672&condition.Channel=0&condition.StartTime=2021-07-10%2001:20:15.936236&condition.EndTime=2021-07-10%2007:20:15.936236')
Traceback (most recent call last):
File "/home/elliott/.local/lib/python3.8/site-packages/amcrest/http.py", line 204, in _command
resp.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://192.168.2.145:80/cgi-bin/mediaFileFind.cgi?action=findFile&object=1831397672&condition.Channel=0&condition.StartTime=2021-07-10%2001:20:15.936236&condition.EndTime=2021-07-10%2007:20:15.936236
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/elliott/get-files.py", line 23, in
for text in camera.find_files(start_time, end_time):
File "/home/elliott/.local/lib/python3.8/site-packages/amcrest/media.py", line 134, in find_files
search = self.media_file_find_start(
File "/home/elliott/.local/lib/python3.8/site-packages/amcrest/media.py", line 88, in media_file_find_start
ret = self.command(
File "/home/elliott/.local/lib/python3.8/site-packages/amcrest/http.py", line 169, in command
return self._command(*args, **kwargs)
File "/home/elliott/.local/lib/python3.8/site-packages/amcrest/http.py", line 209, in _command
raise CommError(error)
amcrest.exceptions.CommError: 400 Client Error: Bad Request for url: http://192.168.2.145:80/cgi-bin/mediaFileFind.cgi?action=findFile&object=1831397672&condition.Channel=0&condition.StartTime=2021-07-10%2001:20:15.936236&condition.EndTime=2021-07-10%2007:20:15.936236
The text was updated successfully, but these errors were encountered: