KonradIT / gopro-py-api

Unofficial GoPro API Library for Python - connect to GoPro via WiFi.
MIT License
1.4k stars 211 forks source link

File / Folder Parameters are transposed in examples/tagging-save.py, causing script to fail #154

Closed munroebot closed 3 years ago

munroebot commented 3 years ago

Describe the bug The file / folder parameters are transposed in examples/tagging-save.py script, which causes the script to throw an exception.

To Reproduce

  1. Connect to GP network
  2. cd gopro-py-api/examples
  3. python3 tagging-save.py
  4. See error

Expected behavior A JSON file should be written to disk containing the timestamps of the video highlights

Screenshots

(gopro-py-api) bmmunroe@186590d99453 examples % python tagging-save.py
Waking up...
Camera successfully connected!
Connected to 10.5.5.9
Traceback (most recent call last):
  File "tagging-save.py", line 11, in <module>
    tags_in_video=gpCam.getVideoInfo("tags", filename, folder)
  File "/Users/bmmunroe/gopro-py-api/lib/python3.8/site-packages/goprocam/GoProCamera.py", line 140, in _request
    return urllib.request.urlopen(uri, timeout=_timeout, context=_context).read().decode("utf-8")
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
(gopro-py-api) bmmunroe@186590d99453 examples %

According to the getVideoInfo method signature, it is called with folder, filename, but in the in the example it is filename, folder

I'll create a pull request with the fix

KonradIT commented 3 years ago

Fixed in PR #155