All Projects → jtara1 → imgur_downloader

jtara1 / imgur_downloader

Licence: MIT license
Python script/class to download an entire Imgur album in one go into a folder of your choice.

Projects that are alternatives of or similar to imgur downloader

Ripme
Downloads albums in bulk
Stars: ✭ 2,748 (+7751.43%)
Mutual labels:  downloader, imgur
anime-scraper
[partially working] Scrape and add anime episode stream URLs to uGet (Linux) or IDM (Windows) ~ Python3
Stars: ✭ 21 (-40%)
Mutual labels:  downloader, webscraper
super-anime-downloader
A program which takes an Anime name or URL and downloads the specified range of episodes.
Stars: ✭ 26 (-25.71%)
Mutual labels:  downloader, webscraper
Liked-Saved-Image-Downloader
Save content you enjoy!
Stars: ✭ 80 (+128.57%)
Mutual labels:  downloader, imgur
saveddit
Bulk Downloader for Reddit
Stars: ✭ 130 (+271.43%)
Mutual labels:  downloader, imgur
SciDownl
An unofficial api for downloading papers from SciHub via DOI, PMID
Stars: ✭ 103 (+194.29%)
Mutual labels:  downloader
4scanner
Continuously search imageboards threads for images/webms and download them
Stars: ✭ 103 (+194.29%)
Mutual labels:  downloader
openMIC
Meter Information Collection System
Stars: ✭ 15 (-57.14%)
Mutual labels:  downloader
BocchiBot
BocchiBot is a multipurpose WhatsApp bot using wa-automate-nodejs library!
Stars: ✭ 228 (+551.43%)
Mutual labels:  downloader
Twitch-Clips-Compilation-Generator-TCCG-
A system of 3 programs that collects clips automatically from Twitch, lets you edit videos and combine clips, and puts them together into a compilation video ready to be uploaded straight to any social media platform. Full VPS support is provided, along with an accounts system so multiple users can use the bot at once.
Stars: ✭ 67 (+91.43%)
Mutual labels:  downloader
EFDownloader
DEPRECATED
Stars: ✭ 11 (-68.57%)
Mutual labels:  downloader
qobuz-dl
A complete Lossless and Hi-Res music downloader for Qobuz
Stars: ✭ 531 (+1417.14%)
Mutual labels:  downloader
multi-downloader-nx
Download videos from Funimation a nd Crunchyroll via cli.
Stars: ✭ 43 (+22.86%)
Mutual labels:  downloader
trivrost
A repurposable application-downloader and -launcher
Stars: ✭ 36 (+2.86%)
Mutual labels:  downloader
mtv dl
MediathekView Downloader
Stars: ✭ 49 (+40%)
Mutual labels:  downloader
TSdownloader
Template for downloading segmented video (.m3u8/.ts) from streaming websites
Stars: ✭ 17 (-51.43%)
Mutual labels:  downloader
hipposcraper
A Linux terminal tool for parsing and scraping Holberton project pages to automate repetitive tasks.
Stars: ✭ 32 (-8.57%)
Mutual labels:  webscraper
habbo-downloader
⚡A tiny script to download various files directly from Habbo.
Stars: ✭ 47 (+34.29%)
Mutual labels:  downloader
mythra
Music retrieval CLI and API using rust
Stars: ✭ 50 (+42.86%)
Mutual labels:  downloader
catimg
Print an image of a cat to the iTerm2 terminal
Stars: ✭ 13 (-62.86%)
Mutual labels:  imgur

Imgur Downloader

This is a simple Python script that contains a class and command line interface that allows you to download ann images at full resolution with any imgur link, all at once.

jtara1 Fork - Features

  • Here's some examples of the types of links that are now supported:
  • Name of album folder or image is determined by HTML <title> value or passed parameters.

  • Prevents downloading of Imgur Does Not Exist image by checking if direct link url got redirected & comparing the bytearrays of the direct link image with that of a local file.

  • Uses album/gallery/image title as folder title that's created and contains image(s) with key appended e.g.:

    We don't have a blue backdrop, just tint the whole photo blue. (SnkkAVU).png
    
  • Add --print-only option to print the direct link of the imgur url.

  • Prevents downloading of imgur does not exist image if it is encountered. It is implemented by comparing the bytes of the HTTP request to that of a local imgur dne file in program. This feature is toggleable in init parameter.

  • Added function is_imgur_dne_image(self, img_path), which returns True if the image from img_path is the same image as the Imgur does not exist image and return False otherwise.
  • Added function are_files_equal(self, file1, file2), which compares the bytes and returns True if the bytes are equal, and return False otherwise
ImgurDownloader(
    'http://i.imgur.com/removed.png', delete_dne=True, debug=True
).save_images()
  • Downloads imgur links with .gifv extension as a mp4 file
ImgurDownloader('http://i.imgur.com/A61SaA1.gifv').save_images()
  • 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:
# Code ran (url is an imgur Album with 5 images):
print(
    imguralbum.ImgurDownloader(
        url, dir1, file_name=rand_name, debug=False
    ).save_images()
)
# output: (5, 0)

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.:
ImgurDownloader('http://imgur.com/SnkkAVU', '/home/user/Downloads/')
  • 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.:
ImgurDownloader(
    'http://imgur.com/SnkkAVU', '/home/user/Downloads/', 'my-img')
  • Fourth optional parameter, delete_dne=True, which checks each image downloaded and deletes it if its bytes match that of imgur-dne.png, e.g.:
ImgurDownloader(
    'http://imgur.com/SnkkAVU', '/home/user/Downloads/', 'my-img', True)
  • Fifth optional parameter, debug=False, which prints a number of variables throughout the code as it runs
ImgurDownloader(
    'http://imgur.com/SnkkAVU', '/home/user/Downloads/', 'my-img', True, True)

Requirements

Python >= 3.3

Command Line Usage

$ imgur_downloader [album URL] [folder to save to]

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

$ imgur_downloader http://imgur.com/a/uOOju /Users/alex/images/downloaded

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

$ imgur_downloader http://imgur.com/a/uOOju

It can also be used with downloader such as wget using --print-only option.

$ imgur_downloader --print-only http://imgur.com/a/SVq41 | xargs wget

Class Usage

The class allows you to download imgur albums in your own Python programs without going through the command line. Here's an example of it's usage:

downloader = ImgurDownloader("http://imgur.com/a/uOOju")
print("This albums has {} images".format(downloader.num_images()))
downloader.save_images()

Callbacks

You can hook into the classes process through a couple of callbacks:

downloader.on_image_download()
downloader.on_complete()

You can see what params and such your callback functions get by looking at the docblocks for the on_* functions in the .py file.

Full docs

The whole shebang, class and CLI is fully documented using string-docblock things in the single .py file so please read through that rather than rely on this readme which could drift out of date.

License

MIT

Credits

Originally written by Alex Gisby (@alexgisby)

With Contributions from these amazing people!)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].