Skip to content

Commit

Permalink
catch all random errors and exit while printing the profile causing t…
Browse files Browse the repository at this point in the history
…he error
  • Loading branch information
Donearm committed Mar 20, 2020
1 parent 0cf9ce0 commit d64ec29
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions instagram_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def massDownload(instance, startdate, enddate, operation):
except instaloader.exceptions.ConnectionException:
# Resource not available, maybe anymore. Skip it
pass
except TypeError as e:
print("Error while downloading profile " + profilename)
print("Error was: " + str(e))
sys.exit(1)

LASTCHECKFILE = profilename + "/lastcheck"
try:
Expand Down Expand Up @@ -141,6 +145,7 @@ def main():
for p in dropwhile(lambda p: p.date > TODAY, takewhile(lambda p: p.date > SINCEDATE, posts)):
L.download_post(p, options.action)


LASTCHECKFILE = options.action + "/lastcheck"
try:
with open(LASTCHECKFILE, "w") as t:
Expand Down

0 comments on commit d64ec29

Please sign in to comment.