Reddit gallery links #124
Replies: 3 comments 3 replies
-
Looking at the initial html in devtools network panel when opening the gallery link I see that the response doesn't have images inside those This works for me: {"u": "||reddit.com/gallery/", "g": {"image": "figure a"}}
|
Beta Was this translation helpful? Give feedback.
-
I clearly still have a lot to learn about how this stuff works, especially that just "figure a" works Well regardless, here's that but with a fix function that essentially just, cleans the image preview urls into the {"u": "||reddit.com/gallery/",
"g": {
"image": "figure a",
"fix": "return isURL ? (result = s.match(/.*redd\\.it\\/(\\w+\\.\\w+).*/))?.[1] ? \"https://i.redd.it/\" + result[1] : s : s"
}
} It did seem to work fine without it, though I kinda assume that all the extraneous bits at the end of the |
Beta Was this translation helpful? Give feedback.
-
The code in the rule gallery was working great until this morning and now I'm getting "Empty gallery" for every gallery on reddit. |
Beta Was this translation helpful? Give feedback.
-
I believe this works for all reddit galleries, as according to the uploader they can only have images and gifs. the only minor complication is images use
preview.redd.it/(filename)?(extra stuff)
and the gifs just do directi.redd.it/(filename)
, but the regex works all the same to correct both toi.redd.it
I took a quick peak at making one for reddit videos (
v.redd.it
links) and decided it was out of my wheelhouse, dash player stuff. If you know anything about that, you could maybe try to find how RES does itHonestly, I'm a little confused as to why just
... doesn't just work. It grabs the first image, but none of the extras. (You can test this on this post: https://old.reddit.com/r/TheOdysseyHadAPurpose/comments/1h4vdgj/fishmael_toeiki_c/) I find the docs around "g" to be a bit, lacking.
Beta Was this translation helpful? Give feedback.
All reactions