abdullahtarawneh.com/content/code/photobucketgrabber/index.md

28 lines
1.4 KiB
Markdown
Raw Normal View History

2020-10-25 05:15:18 +00:00
---
title: "PhotoBucketGrabber"
summary: "Download all your photos from PhotoBucket using this Python script."
2020-10-26 05:51:15 +00:00
author: "Abdullah Tarawneh"
2020-10-25 05:15:18 +00:00
date: "2019-03-17"
tags: ["python", "photobucket", "automation", "scripting", "archive", "export", "download"]
2020-10-26 06:29:04 +00:00
category: "Code"
2021-12-20 11:27:10 +00:00
cover: "/code/photobucketgrabber/cover.png"
2020-10-25 05:15:18 +00:00
---
## 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.