Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Run a script to fix image links

Omni, Is there some script you can run on the back end to fix the broken image links?
I am talking about images that have http:// instead https://?

Have it find http:// inside [img] tags and have the script replace http:// with https://.

A lot if image hosts support the use of https://.
I guess this would mainly work for imgur but even as http my images from imgur load. Anywhere else might not have https so you would have to find those particular sites and then work from there. I guess my main concern was tutorial threads missing images.
Url to this image https://i.imgur.com/h4xIiqJ.png
[Image: h4xIiqJ.png]
this wouldn't work as the majority of image sites tend to not support https.
[Image: DreddSig.gif]
He did this with a few sites. Did he not?
Wouldn't work since some of them don't allow SSL.
Wouldn't an operation like this take super long? Also seems pretty resource intensive to go through every post made here that has a link in it.
(Oct 11, 2016 07:13 AM)⁠Cammy Wrote:  Wouldn't an operation like this take super long? Also seems pretty resource intensive to go through every post made here that has a link in it.

regular expressions my friend 🤝
[Image: DreddSig.gif]
Just change it on your end. HTTPSEverywhere is your friend.
Regular expressions are better! A script looping thought all posts would take years...

(Oct 4, 2016 12:23 PM)Omniscient Wrote:  For convenience I have added a word filter for i.imgur.com which automatically converts the link to HTTPS.

If you know of other popular image upload sites that support HTTPS please post them and I can add them to the filter.
Omni already added some rules for the most common images hosting providers.
Motocross is a lifestyle!
(Oct 11, 2016 07:13 AM)⁠Cammy Wrote:  Wouldn't an operation like this take super long? Also seems pretty resource intensive to go through every post made here that has a link in it.

Perhaps. Hard to say how long it'd take but I imagine it's no short task. MySQL's REPLACE() could do the trick decently, I think, but there's a LOT of rows.
still lurkin. still bitcoin cashin.
The problem is that many sites may not support the HTTPS image so then it will be a broken image instead of how it's posted IMG.

IMGUR already is converted by Cloudflare and my own word censor.

If you've found another large image provider LMK but it won't work for sites that use multiple subdomains in order to serve static content.

Quote: MySQL's REPLACE() could do the trick decently, I think, but there's a LOT of rows.

That's what I ran for avatars and signatures. I could run it for posts but prefer not to do so because I just don't think we need it.
I know gyazo and Flickr support HTTPS.
[Image: Pi0HBk0.gif]
(Oct 11, 2016 06:24 AM)Mr. Robot Wrote:  I guess this would mainly work for imgur but even as http my images from imgur load. Anywhere else might not have https so you would have to find those particular sites and then work from there. I guess my main concern was tutorial threads missing images.
Url to this image https://i.imgur.com/h4xIiqJ.png
[Image: h4xIiqJ.png]

Photobucket also supports linking the image as https://.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Egregious Jr.Apr 25, 2017 09:19 AM 5 184 Apr 25, 2017 09:19 AM
Last Post: Omniscient
by CastleApr 1, 2014 11:33 AM 5 309 Apr 1, 2014 11:33 AM
Last Post: Positive
by r00tyu0rm0msb0xNov 10, 2013 01:01 AM 7 396 Nov 10, 2013 01:01 AM
Last Post: Omniscient