Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Moving images to new collection after download #44

Open
Richard-Weiss opened this issue Jan 26, 2024 · 1 comment
Open

Moving images to new collection after download #44

Richard-Weiss opened this issue Jan 26, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Richard-Weiss
Copy link
Owner

It would be nice to have an option to move images to a new collection after downloading them.
This could also be done iteratively, until no more images are in the original collection, thus enabling being able to download more than 1000 images.
Depending on the collection order, it might be necessary to "buffer" some unwanted collections into new collections until the desired collection is included in the collection get API response. They would be moved back to their original collection afterward, but this mechanism should be implemented at a later stage to reduce initial complexity.
The collection title can have more than 1000 characters and has to be unique, so it should have the pattern:
date_oc-copy
For example:
2024-01-26T1541+01:00_My collection-copy
The relevant end point is https://www.bing.com/mysaves/collections/create.

To move images, the endpoint is https://www.bing.com/mysaves/collections/items/move.
It requires the source collection id, the target collection id and the collection item ids.

  • The collection item id is available from the collection get API in the path:
    collection_dict['collections']['collectionPage']['items'][$index]['collectionItemId']

  • The source collection id is available from the collection get API in the path:
    collection_dict['collections'][$index]['id']

  • The target collection id gets returned when creating a new collection.

@Richard-Weiss Richard-Weiss added the enhancement New feature or request label Jan 26, 2024
@SSchuetrumpf
Copy link

There's also an endpoint https://www.bing.com/mysaves/collections/reorder which I believe could be used to address the issue of having to manually rearrange collections during bulk downloads. I've not been able to determine what to POST to it, though. I can't find any references to it being used, so I suspect it's being used by Edge internally.

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

No branches or pull requests

2 participants