abdullahtarawneh.com/content/code/photobucketgrabber/index.md
2021-12-20 05:27:10 -06:00

28 lines
1.4 KiB
Markdown

---
title: "PhotoBucketGrabber"
summary: "Download all your photos from PhotoBucket using this Python script."
author: "Abdullah Tarawneh"
date: "2019-03-17"
tags: ["python", "photobucket", "automation", "scripting", "archive", "export", "download"]
category: "Code"
cover: "/code/photobucketgrabber/cover.png"
---
## The problem
I had an old PhotoBucket account that I wanted to archive and delete. However, it would take an extremely long time to manually save each photo and recreate any albums' folder structure.
## The research
PhotoBucket allows copying direct image links, and it also allows copying multiple links at the same time. This is used to obtain a list of all photo direct URLs, which can be saved in a text file and read by a script.
Additionally, direct URLs maintain the folder and file names, so the path structure can be saved directly using Python's Path library.
## The solution
See my source code here: https://github.com/trwnh/PhotoBucketGrabber
Limitations:
- The prefix to be stripped is hardcoded, because it will always be the same for an account.
- There is no way to programmatically obtain a list of all photos or albums from Photobucket, as far as I know, so the selection step is still manual. I think for a one-time task, this is probably not an issue, as it would take more time to attempt to code a solution than it would to simply select all photos from the web dashboard.