But Photobucket has turned its back on us. The website is crap (it used to be good) and now I get near-daily emails about "you've gone over your storage limit". I decided to find a way to get all my photos off this garbage website and actually put them somewhere good like Google Photos.
The Manual Approach
Since the website is crap, Photobucket has not made this easy. It is not possible to download an entire album with a single click. The only download option is on a photo. Each individual photo. I have thousands of photos uploaded to Photobucket and I will not be manually clicking through every single photo and clicking "Download".
I saw a reddit post on how to do this. Unfortunately, that method didn't work for me as the photos were corrupted when they downloaded to my phone. And the couple photos I got to work didn't have the same metadata as the uploaded ones (the "Date Taken" property wasn't preserved when downloading with my phone). Turns out not only the website is crap but also the Photobucket app.
The Automated Approach
As a programmer, my next thought was to try the API. Photobucket has an API but they tell you to go to http://developer.photobucket.com/ to get an API key and that just redirects back to your profile page (see "crap website" above). I emailed support for an API key and "Unfortunately, at this time we are not allowing outside parties to access the Photobucket API."
Ok, API is out. That leaves two approaches left: custom program using download links or autoclicker. See, my photos were taken with a DSLR and the filenames are almost always in the form "IMG_####.jpg" (where #### is a four-digit number). If the url for an image on Photobucket is like this:
http://s827.photobucket.com/user/derekantrican/media/Peru%20Trip/IMG_6055.jpg.html?sort=9&o=0
then its download link is like this:
http://s827.photobucket.com/component/Download-File?file=%2Falbums%2Fzz195%2Fderekantrican%2FPeru%20Trip%2FIMG_6055.jpg
(I am not sure if the "zz195" is unique to everyone but I found that it was the same value across all my photos and didn't change from album to album.)
Fun fact, if you open the source code of the image page (right-click > "View page source") there is actually a value for download url but it doesn't work:
"downloadUrl":"http:\/\/i827.photobucket.com\/download-albums\/zz195\/derekantrican\/Peru Trip\/IMG_6055.jpg~original"
So essentially I could sort my album by filename (something that the website can do), get the first #### image value, then make a program that counts up from that value, modifies the download url, and attempts to use that to download an image. The problem is that this url is not a publicly-facing url. Even if your album is public, you can not use the above download url unless you are logged into Photobucket. So my program would have to log in to Photobucket first. While that is possible with libraries like Selenium, I wanted a simpler approach.
So we're left with an autoclicker. I started to build one myself but after a small amount of Googling, I found Auto Mouse Click and it's exactly what I wanted.
I just need 3 actions: click on the download link, wait a little bit for the save file dialog to open up, click "Save", then press the right arrow key to go to the next image. So for each album I want to download, the workflow goes like this:
- Open the album on Photobucket's website
- Sort by filename
- Create a folder for the photos on your computer
- Click the first photo on Photobucket and download to that new folder (this will set that folder as the default download folder for future downloads)
- Open Auto Mouse Click and set the Repeat Count to the number of photos in the album (unfortunately, Photobucket's website yet again is crap and if you have over 1k photos in your album, it rounds to the nearest hundred photos. So I have to manually calculate the number of photos) minus one (because we downloaded the first photo in step 4)
- Click Start
(Here's a video where I show you how to set up Auto Mouse Click: https://youtu.be/PUmfAlOOYRU)
Theoretically, that should be it, right? Well unfortunately there are 2 problems left: the website is crap and the website is crap.
Basically sometimes you get an error screen (I got this about once every 100 downloads):
Which means you need to stop Auto Mouse Click (don't forget to set that "Start/Stop Script Execution" keyboard shortcut!), manually go back to the previous page, and start it again.
And sometimes the photo doesn't download correctly (the file is corrupted) or Auto Mouse Click misses the file altogether (maybe the website didn't respond in time, maybe AMC missed the click, who knows). So I wrote some short code to try to guess which photos got missed and also which are corrupted: https://github.com/derekantrican/MissingFilenames (worth noting that the "guess which photos got missed" part is very unique to my situation that I explained above: my photos follow the convenient naming of "IMG_####.jpg").
So now I follow all the steps above, then run my program a couple times and manually download any missed photos.