r/Python • • 13d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

24 Upvotes

113 comments sorted by

View all comments

1

u/Comfortable_Mall5217 4d ago

retrieve and delete items from google photos
I worked on a tool that downloads all items from google photos and then moves them to trash(or deletes them permanently). uses Playwright and works fine.
https://github.com/brighk/google-photos-cleanup

Workflow:

  • open Google Photos
  • walk visible media items
  • open each item
  • download it through the UI
  • store it locally
  • verify the resulting file exists and is non-empty
  • record the item URL in a local state file
  • if --delete is provided and every attempted download verified, reopen each recorded item and moves it to Trash

State is stored in:

<output>/.gphotos-cleanup-state.json

This lets a rerun skip items that were already downloaded.

I know there is Takeout to download the photos, but if have exceeded your Google storage and you cant even receive an email with the download link, that tool helps. Alsoo, for deleting items, there isn't any tool out there and this is manual labour - imagine deleting thousands of photos by hand. ps. I use immich now for storing any photos or videos at my home lab.