Takes coredumperror's script and removes the constant 300ms checks and adds an in-page way to adjust the filename_template.
< Opinie na Bluesky Image Download Button
I wouldn't really call it a massive improvement, but thank you xD
I hadn't really run through all your code, I only did the "at a glance" stuff that I would personally handle differently, but in no way could I have written this myself. I'm more of a tinkerer than a respectable creator, so I am grateful for all your hard work in laying down the foundation.
I hadn't run into that situation yet, so I wasn't aware of that bug, I'll see where I can spot an alternative method for obtaining the post data.
Spotted, L304 and L388, we do a check to see if we're on a post page and don't do any further verification. So this would apply to literally any reply to a post while on the page of a post. I'll try to think of a clever way to get the post id, probably some query shenanigans or stripping the entire post to raw HTML and matching the post regex to that.
Yeah, querying the root of the reply and doing a simple raw regex match just pops it out easy. When I get to actually testing the code (not at 1AM LMAO), I hope in practice it won't actually be straining on the browser at all.
To remind me later:
$(reply_root).innerHTML.match(post_url_regex)
Love it! Massive improvement to my original script. Use this one, folks!
That said, there's a bug in my original that persist in this one. If you go to a Bluesky post that has a self-reply with more images in it, the image files get named after the original post, rather than the reply they're actually in.
I'm not entirely sure how to deal with this, but I imagine that a different algorithm for determining the post ID is necessary.