Skip to content
This repository has been archived by the owner on Sep 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #7 from Trim21/master
Browse files Browse the repository at this point in the history
don't download files exist already
  • Loading branch information
XIAZY committed May 23, 2016
2 parents c67391d + bf40b36 commit 7eef795
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions driveit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from base import SharedBase

import os

def main_loop(ref_box):
for ref_tuple in ref_box:
Expand All @@ -8,8 +8,11 @@ def main_loop(ref_box):
for page in range(1, total_page + 1):
link = website_object.get_image_link(parent_link, page)
try:
website_object.down(comic_name, parent_link, link, parent_title, page)
print('%s page %d has been downloaded successfully' % (parent_title, page))
if os.path.exists(base.get_path(comic_name, parent_title, page, 'jpg')):
print('%s page %d has been downloaded before' % (parent_title, page))
else:
website_object.down(comic_name, parent_link, link, parent_title, page)
print('%s page %d has been downloaded successfully' % (parent_title, page))
except:
print('Error occurred when downloading %s, Page %d.' % (parent_title, page))

Expand Down

0 comments on commit 7eef795

Please sign in to comment.