[Feature Idea] Any way to search for all photos "Shared by a Google user"?
My library consist of photos that I saved from various shared album and partner account. Now, I have filtered photos not owned by me using gptk, can I futher filter them by ownership of specific person?
theoretically possible, but would require sending a request to get each file's info, so it would be slow
and be vary of the ownership filter, it produces inconsistent results
Ownership filter worked fine for me, it separated all files not owned by me in a separate album. Could you guide what request to send in order to get photos owned by specific people.
It would not be possible to just get all media owned by "x", the only way is to scan the library, then for each media item send a request to get that info, and filter based on it.
@jindalshreyansh @leocrawford
Here is a little POC script to find and delete "shared by x" items.
Goes over the whole library one item at a time.
If item's sharedByUserName matches sharedByName, moves the item to trash.
Paste it to your browser's console.
Reload the page to stop the script.
let nextPageId = null;
const ownerName = 'John';
do {
const page = await gptkApi.getItemsByUploadedDate(nextPageId);
for (const item of page.items){
if (item.isOwned) continue
const itemInfo = await gptkApi.getItemInfo(item.mediaKey);
if (itemInfo.owner.name == ownerName){
await gptkApi.moveItemsToTrash([itemInfo.dedupKey]);
console.log('item moved to trash', itemInfo);
}
}
nextPageId = page.nextPageId;
} while (nextPageId);
console.log("DONE")
04.07.24 - updated the script to work with the latest version of gptk
Thank you so much. That's really helpful. In the end I archived by date uploaded, restored those taken by my partners phone, and deleted those in archive - but this would have been much better, and is what I'll use next time (if there is a next time).
I'm also rebuilding my own library from scratch, using my own API key (rather than rclones) so I can share albums, rather than rely on partner sharing. SO much learnt. Your tool has been an invaluable part of fixing my own mistakes, so thank you.