Created
August 4, 2019 23:04
-
-
Save umrashrf/9295a0160a6954c22ec01fa4f284c3f2 to your computer and use it in GitHub Desktop.
Kijiji photo downloader in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
photos = [ | |
'https://i.ebayimg.com/00/s/MTA2N1gxNjAw/z/kXAAAOSwqYxdHbfJ/$_59.JPG', | |
] | |
import re | |
import urllib | |
basename = re.compile('/z/(.*)') | |
def fname(url): | |
return basename.search(url).group(1).replace('/', '_') | |
def dr(url): | |
for photo in photos: | |
yield urllib.request.urlretrieve(url, fname(url)) | |
while True: | |
next(dr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment