Remote Image Hosting Fix

Started by NFG, April 22, 2018, 08:30:05 AM

Previous topic - Next topic


Good morning, friends!

In light of imagebucket's Breaking of the Internet, I want to create a local mirror for all images posted or linked on this forum.  I've seen some forums that do this automatically, but I don't see such a function for this forum.

So, ideas time.  There are 465 posts with imagebucket links, and while it's easy enough to download them all manually, it's a massive PITA.

Anyone have suggestions?  How can we salvage what's left of images on the old wide internet?


The only time I've ever seen anything like this happen successfully is with some direct database access and a CSV file full of the Photobucket links. Basically you run a shell script with a loop that goes something like this:

* Write all of the Photobucket URLs to a CSV so that you have a master list.
* Grab the outdated Photobucket link from the spreadsheet and search for it in the forum DB.
* Download the associated image using a 'wget' command and write it to a dedicated directory in the forum Apache instance.
* Replace the string in the DB with the URL of the downloaded image.

The trick here is that if there are any duplicate filenames, there's a danger that you get a new link that points to the wrong file because a second image overwrote the original. Also, I'm willing to bet the SImple Machines forum auditing isn't so sophisticated that it'll log the direct DB change as an admin edit to the original post, so it'll look like that the post was always like that.