String link to rewrite.
A rewritten string if it's a compatible imgur one, else the passed url.
{ enum directURL = "https://i.imgur.com/URHe5og.jpg"; static immutable rewritten = rewriteDirectImgurURL(directURL); static assert((rewritten == "https://imgur.com/URHe5og"), rewritten); } { enum directURL = "http://i.imgur.com/URHe5og.jpg"; static immutable rewritten = rewriteDirectImgurURL(directURL); static assert((rewritten == "https://imgur.com/URHe5og"), rewritten); }
Takes a direct imgur link (one that points to an image) and rewrites it to instead point to the image's page.
Images (jpg, png, ...) can naturally not have titles, but the normal pages can.