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

Add 'delete' and 'delete all' endpoints to library #417

Open
ossumpossum opened this issue Jan 21, 2021 · 6 comments
Open

Add 'delete' and 'delete all' endpoints to library #417

ossumpossum opened this issue Jan 21, 2021 · 6 comments
Labels
feature-request Something that would be nice to have, or expands functionality help-wanted Assistance required due to lack of resources for testing or complexity

Comments

@ossumpossum
Copy link

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.

@fronzbot fronzbot added the feature-request Something that would be nice to have, or expands functionality label Jan 22, 2021
@fronzbot fronzbot changed the title implement the delete and deleteall endpoints Add 'delete' and 'delete all' endpoints to library Jan 22, 2021
@MrToWy
Copy link

MrToWy commented Feb 8, 2021

maybe add a parameter to download_videos(), which deletes a video after a successful (!) download

@fronzbot
Copy link
Owner

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 😞

@fronzbot fronzbot added the help-wanted Assistance required due to lack of resources for testing or complexity label Feb 12, 2021
@ruby-dev
Copy link
Contributor

ruby-dev commented Jul 16, 2022

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;
  }

@Zw012d
Copy link

Zw012d commented Nov 23, 2022

can we delete videeos before a particlular datetime from cloud and sync module with this. for ex -

  1. i want to delete vidoes before "2022-11-23 00:00" from cloud
  2. 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 ?

@arbuilder
Copy link

@fronzbot @ruby-dev will it be possible ?

@mkmer
Copy link
Contributor

mkmer commented Jan 7, 2024

I think we have solved for item 2:

async def delete_video(self, blink, max_retries=4) -> bool:
"""Delete video from sync module."""
delete_url = blink.urls.base_url + self.url()
delete_url = delete_url.replace("request", "delete")
for retry in range(max_retries):
delete = await api.http_post(
blink, delete_url, json=False
) # Delete the video
if delete.status == 200:
return True
seconds = backoff_seconds(retry=retry, default_time=3)
_LOGGER.debug("[retry=%d] Retrying in %d seconds", retry + 1, seconds)
await asyncio.sleep(seconds)
return False

You can poll the videos, create a list and delete them with this function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Something that would be nice to have, or expands functionality help-wanted Assistance required due to lack of resources for testing or complexity
Projects
None yet
Development

No branches or pull requests

7 participants