Author Topic: [Python] Photobucket scraper  (Read 1643 times)

0 Members and 1 Guest are viewing this topic.

Offline daxda

  • Peasant
  • *
  • Posts: 114
  • Cookies: 112
  • Not the guy you're looking for
    • View Profile
    • Daxda on Github
[Python] Photobucket scraper
« on: March 16, 2014, 01:59:54 pm »
I've quickly hacked together a Photobucket image/album downloader, the idea for this project came from Kulverstukas. Throw him a cookie if you like this script.

The script extracts meta information about the album/image as well as the direct image link which is used to download the image which is the main functionality of the script, downloading images.

The usage of the script is as follows:

Quote
usage: pb_shovel.py [-h] [-r] [-o OUTPUT_DIRECTORY] [--omit-existing]
                    [-v VERBOSE] (-f FILE | -u URLS [URLS ...])
                    [--images-only | --videos-only] [-n USERNAME]
                    [-p PASSWORD]

optional arguments:
  -h, --help            show this help message and exit
  -r, --recursive       Recursively extracts images and videos from all passed
                        sources.
  -o OUTPUT_DIRECTORY, --output-directory OUTPUT_DIRECTORY
                        The directory the extracted images getting saved in.
  --omit-existing
  -v VERBOSE, --verbose VERBOSE
  -f FILE, --file FILE  A file containing one or more Photobucket links which
                        you want to download.
  -u URLS [URLS ...], --urls URLS [URLS ...]
                        One or more links which point to an album or image
                        which is hosted on Photobucket.
  --images-only         Do not download any other filetype besides image.
  --videos-only         Do not download any other filetype besides video.

Authentication:
  -n USERNAME, --username USERNAME
                        The username or email which is used to authenticate
                        with Photobucket.
  -p PASSWORD, --password PASSWORD
                        The matching password for your account.


This script might break and nuke your computer into eternity and turn the world upside down, non the less if you encounter bugs or odd behaviour please let me know in this thread.

The script can be obtained from my Github repo, just clone it and you're good to go:
Code: [Select]
git clone https://github.com/Daxda/pb_shovel.git
Feel free to annoy me with your questions if you have any.
« Last Edit: April 23, 2014, 08:20:06 pm by daxda »

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: [Python] Photobucket scraper
« Reply #1 on: March 16, 2014, 04:55:37 pm »
Does it ignore existing files? what if I want to update a folder?
Should let the user select if he just wants videos OR image OR both.

Gonna try it out on some problematic albums and report :)

edit: it isn't "good to go" because you don't distribute the required libs with it.
« Last Edit: March 16, 2014, 05:03:08 pm by Kulverstukas »

Offline Phage

  • VIP
  • Overlord
  • *
  • Posts: 1280
  • Cookies: 120
    • View Profile
Re: [Python] Photobucket scraper
« Reply #2 on: March 16, 2014, 09:09:28 pm »
Your installation concerns have been addressed in the latest pull request Kulverstucks. All a user has to do now is type the following
Code: (bash) [Select]
pip -r requirements

And all dependancies will be installed

I see you found the Ruby equivalent to Ruby bundler  ;)
"Ruby devs do, in fact, get all the girls. No girl wants a python, but EVERY girl wants rubies" - connection

"It always takes longer than you expect, even when you take into account Hofstadter’s Law."

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: [Python] Photobucket scraper
« Reply #3 on: March 16, 2014, 09:17:15 pm »
derp herp done some stuff
Why all the workarounds? why not just distribute the libs with the script itself, so a user only has to extract shit and run it... my god man.
« Last Edit: March 16, 2014, 09:17:32 pm by Kulverstukas »