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

Document Delete Media API #74

Closed
pyrat opened this issue Oct 9, 2021 · 14 comments
Closed

Document Delete Media API #74

pyrat opened this issue Oct 9, 2021 · 14 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@pyrat
Copy link

pyrat commented Oct 9, 2021

Hi,

Is it possible to delete media using the python connector?

I am testing taking many photos (every 5s) and would like to delete them to avoid filling up the SD card. I can see that its possible with the unofficial API but would be great if we can add support here. (maybe I have missed something if it is indeed possible.)

@pyrat pyrat added the enhancement New feature or request label Oct 9, 2021
@supperment
Copy link

I also need to know

tcamise-gpsw pushed a commit that referenced this issue Dec 15, 2021
* Added Global Behaviors settings/documentation/status, added General Format setting (TLP<-->TLV and NLP<-->NLV transition), changed some setting names for clarity, added .proto file for Global Behaviors set-camera-control-status command (#72)

Co-authored-by: Tim Camise <timothy.camise@gmail.com>

* Sfoley/add set camera control status proto (#74)

* Added proto file

* updating copyrights from pre merge check in github action

Co-authored-by: github-actions <github-actions@github.com>

* Updated Camera Capabilities table on Open GoPro v2.0 for Kongs Phase … (#76)

* Updated Camera Capabilities table on Open GoPro v2.0 for Kongs Phase 1.2 using cached Kongs JSON from v01.19.19
* Updated BLE Camera Capabilities table too... forgot to include in previous commit...derp

Co-authored-by: Sean Foley <sfoley@gopro.com>
Co-authored-by: Tim Camise <timothy.camise@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
@Trimeego
Copy link

I am also interested in this feature.

@KonradIT
Copy link
Contributor

KonradIT commented Mar 31, 2022

Seems to have been shipped in Hero10 v1.40 firmware.

Path: /gopro/media/delete/file

Param key: path

Param value: XXXGOPRO/$file

curl -x GET http://172.20.122.51/gopro/media/delete/file?path=100GOPRO/GOPR1464.JPG

@KonradIT
Copy link
Contributor

Pushed a PR: #165

@tcamise-gpsw tcamise-gpsw changed the title Delete media (feature?) Document Delete Media API Sep 15, 2022
@tcamise-gpsw tcamise-gpsw self-assigned this Sep 15, 2022
@tcamise-gpsw tcamise-gpsw added the documentation Improvements or additions to documentation label Nov 15, 2022
@robertgalo
Copy link

Seems to have been shipped in Hero10 v1.40 firmware.

Path: /gopro/media/delete/file

Param key: path

Param value: XXXGOPRO/$file

curl -x GET http://172.20.122.51/gopro/media/delete/file?path=100GOPRO/GOPR1464.JPG

Hello, tried with 11, but gives me nothing back but an Error 404.

@tony-gutierrez
Copy link

Still nothing?

@robertgalo
Copy link

Still nothing?

Seems, that this all is not really maintained 😪. I mean, these are basic features (file handling).

@tony-gutierrez
Copy link

Found out that there is a path for deleting a file on the 11 Black.

Added this to my sdk http_commands.py:

    @http_get_json_command(endpoint="gopro/media/delete/file", arguments=["path"])
    def delete_media_file(self, *, file: str) -> GoProResp:
        """Delete a file on the camera.

        Returns:
            GoProResp: Empty object
        """
        return {"path": f"100GOPRO/{file}"}  # type: ignore

Also added settings for some missing things:
photo output mode control: INTERNAL_125
Beeps on/off: INTERNAL_87
Sharpness: INTERNAL_117

Would be nice if these were officially added to the SDK

@The-Skunk
Copy link

Found out that there is a path for deleting a file on the 11 Black.

Added this to my sdk http_commands.py:

    @http_get_json_command(endpoint="gopro/media/delete/file", arguments=["path"])
    def delete_media_file(self, *, file: str) -> GoProResp:
        """Delete a file on the camera.

        Returns:
            GoProResp: Empty object
        """
        return {"path": f"100GOPRO/{file}"}  # type: ignore

Also added settings for some missing things: photo output mode control: INTERNAL_125 Beeps on/off: INTERNAL_87 Sharpness: INTERNAL_117

Would be nice if these were officially added to the SDK

Thank you, Tony. I implemented this in the http_commands.py (everywhere in the system) and it works. In my opinion, this should be a standard feature. Hope the maintainer will read and then do this within the next 100 years ...

@Coyne159
Copy link

Coyne159 commented Feb 2, 2024

Does anyone know if this work for a Go Pro Hero 10 black with firmware 1.5?

@The-Skunk
Copy link

Does anyone know if this work for a Go Pro Hero 10 black with firmware 1.5?

If you have your GoPro connected through USB, and you're able to access it through your browser (e.g. checking the state by: http://172.2[ID-3].1[ID-2][ID-1].51:8080/gopro/camera/state ), you can try to execute this command in your browser if you have e.g. 100GOPRO as the current working directory set:

http://172.2[ID-3].1[ID-2][ID-1].51:8080/gopro/version/gopro/media/delete/file?path=100GOPRO/[FILENAME].JPG

Replace the values in the brackets by your settings (last digits of your Cam-ID by position -3, -2 and -1 (see manual and openGoPro documentation as well) and make sure that you've disconnected your camera from the file system where it hangs in normally by MTP.

@tcamise-gpsw
Copy link
Collaborator

These endpoints have been added. There are 3 documented delete endpoints:

@The-Skunk
Copy link

These endpoints have been added. There are 3 documented delete endpoints:

* [Delete All Files](https://gopro.github.io/OpenGoPro/http#tag/Media/operation/GPCAMERA_DELETE_ALL_FILES_ID)

* [Delete Single File](https://gopro.github.io/OpenGoPro/http#tag/Media/operation/OGP_DELETE_SINGLE_FILE)

* [Delete Grouped Media Item](https://gopro.github.io/OpenGoPro/http#tag/Media/operation/GPCAMERA_DELETE_FILE_GROUP)

Thank you for solving this all, we'll check all these and let you stay informed about the outcome ;-)

@tony-gutierrez
Copy link

tony-gutierrez commented Apr 19, 2024

Be advised that the "delete all files" endpoint is very slow, even if there are no files to delete.

Also, there is absolutely nothing in the state to indicate it is still processing. Encoding is not set to true???

The best I have found is to do a "delete all", pause for a while, then do a "get media list" and wait for that call to complete. It will not complete until the delete is done.

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

No branches or pull requests

9 participants