From 54adc66d893754945b7f49bad829af559fb57ff3 Mon Sep 17 00:00:00 2001 From: Nandaka Date: Wed, 27 Jan 2016 19:46:19 +0800 Subject: [PATCH] Try to fix #103 --- PixivConstant.py | 2 +- PixivUtil2.py | 10 +++++++++- changelog.txt | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/PixivConstant.py b/PixivConstant.py index 91515478..f00064b8 100644 --- a/PixivConstant.py +++ b/PixivConstant.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- # pylint: disable=I0011, C, C0302 -PIXIVUTIL_VERSION = '20160101-beta1' +PIXIVUTIL_VERSION = '20160127-beta1' PIXIVUTIL_LINK = 'https://nandaka.wordpress.com/tag/pixiv-downloader/' PIXIV_URL = 'http://www.pixiv.net' PIXIV_URL_SSL = 'https://www.secure.pixiv.net/login.php' diff --git a/PixivUtil2.py b/PixivUtil2.py index da9f026b..e055eb8c 100644 --- a/PixivUtil2.py +++ b/PixivUtil2.py @@ -67,7 +67,13 @@ def download_image(url, filename, referer, overwrite, max_retry, backup_old_file req = None try: try: - print 'Start downloading...', + if not overwrite and not __config__.alwaysCheckFileSize: + print 'Checking local filename...', + if os.path.exists(filename) and os.path.isfile(filename): + return PixivConstant.PIXIVUTIL_SKIP_DUPLICATE + + print 'Getting remote filesize...' + # open with HEAD method req = PixivHelper.createCustomRequest(url, __config__, referer, head=True) res = __br__.open_novisit(req) @@ -114,6 +120,7 @@ def download_image(url, filename, referer, overwrite, max_retry, backup_old_file # actual download + print 'Start downloading...', req = PixivHelper.createCustomRequest(url, __config__, referer) res = __br__.open_novisit(req) downloadedSize = PixivHelper.downloadImage(url, filename, res, file_size, overwrite) @@ -625,6 +632,7 @@ def process_image(mode, artist=None, image_id=None, user_dir='', bookmark=False, overwrite = False if mode == PixivConstant.PIXIVUTIL_MODE_OVERWRITE: overwrite = True + result = download_image(img, filename, referer, overwrite, __config__.retry, __config__.backupOldFile, image_id, page) mangaFiles[page] = filename diff --git a/changelog.txt b/changelog.txt index 8ccbda3d..88ef7b64 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,8 @@ -20160101-beta1: +20160127-beta1: - Try to fix Issue #98. - Add option to filter image bookmark by tags. - Update parser. +- Try to fix Issue #103 20151112: - Fix Issue #96: page 100 is not downloaded for new illust page.