0

So I'm using PRAW, a python wrapper for reddit api (http://praw.readthedocs.io/en to find out more), and I have managed to print the URL's of my latest upvoted posts.

# start subreddit instance
subreddit = reddit.subreddit('dankmemes')

print("\n -> Current Subreddit: ")
print(subreddit.display_name)
redditor2 = reddit.redditor('me')
for upvoted in reddit.redditor('Kish_v').upvoted():
    print(upvoted.url)

This outputs a long list of imgur URLs etc. However, I want to be able to download those images to a folder and then reupload them as a sort of scraper. So I have got to the point where upvoted.url holds my URLs but would the best way to do the above be to put the links into an "array" and then download those images individually? - How would I go around doing this, sorry I am fairly new to python as I came from PHP to use this well documented API.

Thank you, Kish

LW001
  • 2,452
  • 6
  • 27
  • 36
Kish_v
  • 1
  • 1

1 Answers1

1

Check out the requests module, this SO question should get you pointed in the right direction with downloading the URLs you have on hand. I can't comment on the reuploading half. How to download image using requests

jxramos
  • 7,356
  • 6
  • 57
  • 105