SpartanJ / ImgurViewer

ImgurViewer is a little image viewer to open image links from external applications in the fastest way possible.
108 stars 7 forks source link

"Couldn't resolve album url" for some reddit albums #60

Open the-blank-x opened 1 year ago

the-blank-x commented 1 year ago

Example album: https://www.reddit.com/gallery/10b485x

It seems like some images can fail to upload/process, and ImgurViewer does not handle it gracefully. Opening the album from a web browser and going to the failed image (the last/12th one) would show you its caption but it doesn't try to show the image, while gallery-dl just skips it (it outputs [reddit][warning] gallery 10b485x: skipping item ayazbocqbvba1 ('status: failed') for the offending image).

Example of a failed image:

> curl -L --no-progress-meter "https://reddit.com/comments/10b485x.json?raw_json=1" --user-agent awoo | jq '.[0].data.children[0].data.media_metadata["ayazbocqbvba1"]'
{
  "status": "failed"
}

Example of a successful/valid image:

> curl -L --no-progress-meter "https://reddit.com/comments/10b485x.json?raw_json=1" --user-agent awoo | jq '.[0].data.children[0].data.media_metadata["9b305qzpbvba1"]'
{
  "status": "valid",
  "e": "Image",
  "m": "image/jpg",
  [...snip...]
}