Skip to content

Commit

Permalink
Treat submission as object
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-aguilar committed Feb 6, 2020
1 parent 8b151b0 commit 4d1ceb0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions imgextract.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

def main():
#TODO:
#scrub the list to find remove non img links
#check for duplicates
#allow user to define their own subreddit
#allow user to define their own search criteria(top/hot/recent/controversial)
Expand All @@ -22,7 +21,7 @@ def main():
for submission in earth_porn_sr.top(limit=10):
if CheckForNonImage(submission):
DownloadImage(submission)

def CheckForNonImage(sub):
#check to see if the passed in URL is a direct image
#returns True or False
Expand All @@ -36,9 +35,7 @@ def DownloadImage(sub):
#downloads and stores image as jpg
#TODO:
#Create dynamic filepath or create a folder for each time script is ran
#Done - 2/4/2020-BGA Create dynamic filename
#


try:
img_content = requests.get(sub.url).content
except Exception as e:
Expand Down

0 comments on commit 4d1ceb0

Please sign in to comment.