Python 3 Script to Bulk Download Imgur API Images From URL Using imgur-downloader Library Full Project For Beginners

You are currently viewing Python 3 Script to Bulk Download Imgur API Images From URL Using imgur-downloader Library Full Project For Beginners

 

Welcome folks today in this post we will be downloading imgur images using imgur api in python using imgur-downloader library. All the full source code of the application is shown below.

 

 

Get Started

 

 

In order to get started you need to install the following library using pip command as shown below

 

pip install imgur-downloader

 

After installing this library make an app.py file and copy paste the following code

 

app.py

 

 

 

  • Downloads imgur links with .gifv extension as a mp4 file

  • save_images & direct_download methods now return tuple of two integers. The first integer represent successful downloads and the second represent skipped download (either failed or Imgur DNE detected). For example the value on the the last line of the output is what’s returned from save_images method:

 

Init function parameter changes

  • Second optional parameter, dir_download=os.getcwd(), which allows for specific directory to download to (not adapted for cli), e.g.:

  • Third optional parameter, file_name=”, which allows user to specify name of file if input is single image or folder if input is album. Note this takes priority over the imgur key and the album webpage title e.g.:

 

 

Command Line Usage

Download all images from an album into the folder /Users/alex/images/downloaded

Downloads all images and puts them into an album in the current directory called “uOOju”

 

 

 

Leave a Reply