Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
save image from link.
#1
Hi All,

I am trying to make a python script to download image from a link.
I always used this code:

import urllib.request
myImgLink = "http://www.digimouth.com/news/media/2011/09/google-logo.jpg"
urllib.request.urlretrieve(myImgLink , "local-filename.jpg")
now I try to download an image with a link this : "https://drive.google.com/viewerng/img?id=ACFrOgBC9Til2_hbTKxft4aetjJViSBVtjug1ilDi5seFcDl4sQCpuPas7RmqxFc3iDu8m0tgOYw0Lw5cmxaoKaIbIWQPrp5xKISVMSfSD_t8mMh0yvnJFkhMggeOEs%3D&u=0&authuser=0&page=5&w=800"

as you can see the link doesn't have extension of an image i.e. it doesn't end with .png , .jpg , ...

my code now doesn't work for these kind of links.

any suggestions on how to fix that?
Reply


Messages In This Thread
save image from link. - by mr_byte31 - Jan-22-2018, 01:31 PM
RE: save image from link. - by Larz60+ - Jan-22-2018, 07:21 PM
RE: save image from link. - by mr_byte31 - Jan-22-2018, 09:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to save to multiple locations during save cubangt 1 563 Oct-23-2023, 10:16 PM
Last Post: deanhystad
  Save image from outlook email cubangt 1 709 Jun-07-2023, 06:52 PM
Last Post: cubangt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020