-
Notifications
You must be signed in to change notification settings - Fork 22
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
Can't delete .RAW photos #32
Comments
I modified the item loading code to log items found and captured a few samples. It looks like the initial results don't include filenames. Another function
Note the filename So from my limited understanding of what's going on here, the media key points to the "main" image for a photo stack. This script doesn't seem to support photo stacks, and doesn't "understand" that there are other files in the same stack. Looking at From what I see so far the script doesn't seem to support media stacks, and further reverse-engineering of Photos' internal JavaScript/web-services API would be needed to handle media stacks. The mediaKey is definitely the same as what's in the photo URL. But I have no idea how to debug the minified JavaScript from photos to figure out how Photos discovers whether a media item is a stack, and how it enumerates the items in the stack. This is the first time I've ever done interactive JavaScript debugging in a browser. So I'm pretty much stuck at this point. It's unclear whether the script needs to use a different endpoint to request info on stacks, use different arguments to an existing endpoint, or what. Photos makes a truly amazing number of requests on page load for a photo stack, so picking it out of the request/responses doesn't look simple either. |
I tried using Firefox's network view, loading a media media key The request
So it's making an RPC call Parameter, expanded, are
The POST data was
so it's asking for details on an item "20241003_033933062" by the looks, presumably listing stack elements for it. Request headers, with
Response headers with __Secure and set-cookie redacted were:
Response payload was
I've saved the whole request/response as "HAR" on disk, in case that's needed, but it's trivial to repro anyway. (I'm aware this data reveals the timestamp these images were taken, their geolocation, etc, and I don't really care). |
I tried loading the main photo list view with network recording on, and scrolling down to the relevant image/period. Firefox's search doesn't seem to find the media key for the known DNG though, nor the media key for the associate cover JPEG. I think this might be a search issue rather than anything else as the search seems to hang indefinitely. The thumb URL for the above cover-image
I eventually dug the request/response out of the network traffic. It was a request
with decoded POST data
(POST text and a strange response format consistent with these other API requests, that contains text with some escaped json and other non-json content like the RPC ID The response item for this specific image, after decoding and unescaping from
This has the media-key, the thumbnail URI, and ... other stuff. There are some "2"s in there that might indicate a stack-size, but it is hard to tell for sure. So far I haven't been able to figure out how to go from the listed media key for the cover image to the media key and filename for the DNG. I saved a bunch of I've hit my limit for trying to decode this, as I don't really understand how this API works or how the fields are interpreted, and the script doesn't really explain the fields. Hopefully the data collected helps someone else. I might see if I can do this with the photos application API instead ... before they shut it down in March next year, by restricting it to only photos managed by that app. Sigh. Thanks Google, user friendly as always. |
Pro Pixel phones have a feature to maintain the "RAW" version of a file, meaning that I can see two versions of each photo in Google Photos - the standard ".jpg" and a "RAW" file, usually with extension ".dng".
These photos are huge (>40 MB) and have distinct names, but I have been unable to delete these photos using the size or filename filter.
For instance, here are two photo names of the exact same picture:
I would expect that if I filter by size > 40000000 bytes or by filename ".dng" it would delete this photo, but neither finds this photo.
The text was updated successfully, but these errors were encountered: