blinkpy
blinkpy copied to clipboard
Add 'delete' and 'delete all' endpoints to library
It would be quite helpful to have the delete and deleteall endpoints implemented in order to effectively manage storage by being able to delete either specific videos or all the videos currently stored.
maybe add a parameter to download_videos(), which deletes a video after a successful (!) download
Just as an update, I took a look at this but there's more information needed in order to implement this. Performing a POST /api/v1/accounts/{AccountID}/media/delete
results in the following response: {'message': 'Invalid Media List Format', 'code': 706}
. I tried simple stuff like sending data in a format like {"media": [clips]}
but always got the same response.
So this will remain on the to-do list. I was hoping it would be an easy add 😞
Here is the relevant endpoint. If I have some time this weekend, I will give it a shot.
Call<Object> deleteMediaCall(@Body MediaIdListBody paramMediaIdListBody);
@SerializedName("lv_discard")
private final Boolean localViewDiscard;
@SerializedName("media_list")
private final List<Long> mediaIdList;
public MediaIdListBody(Boolean paramBoolean, List<Long> paramList) {
this.localViewDiscard = paramBoolean;
this.mediaIdList = paramList;
}
can we delete videeos before a particlular datetime from cloud and sync module with this. for ex -
- i want to delete vidoes before "2022-11-23 00:00" from cloud
- i want to delete vidoes before "2022-11-23 00:00" from sync module 2
will we able to both 1) and 2) from this ?
@fronzbot @ruby-dev will it be possible ?
I think we have solved for item 2: https://github.com/fronzbot/blinkpy/blob/e98a587f383f4245c2a753be0fc9fa13dade8b2b/blinkpy/sync_module.py#L707-L721 You can poll the videos, create a list and delete them with this function.