Search code examples
pythonbashimgur

Downloading file from imgur using python directly via url


Sometime, links to imgur are not given with the file extension. For example: http://imgur.com/rqCqA. I want to download the file and give it a known name or get it name inside a larger code. The problem is that I don't know the file type, so I don't know what extension to give it.

How can I achieve this in python or bash?


Solution

  • I just tried going to the following URLs:

    And they all worked. It seems that Imgur stores several types of the same image - you can take your pick.