From 1b49852550c96cb1ad1c36d4076625c3eb1da203 Mon Sep 17 00:00:00 2001 From: Nandaka Date: Thu, 11 Feb 2016 11:02:08 +0800 Subject: [PATCH] v20160211 --- PixivConstant.py | 2 +- PixivUtil2.py | 21 +++++++++++++-------- changelog.txt | 9 +++++---- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/PixivConstant.py b/PixivConstant.py index 8c1ce7a9..c5eabb4a 100644 --- a/PixivConstant.py +++ b/PixivConstant.py @@ -2,7 +2,7 @@ # pylint: disable=I0011, C, C0302 -PIXIVUTIL_VERSION = '20160210-beta1' +PIXIVUTIL_VERSION = '20160211' 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 e055eb8c..4344765b 100644 --- a/PixivUtil2.py +++ b/PixivUtil2.py @@ -891,7 +891,7 @@ def process_tags_list(mode, filename, page=1, end_page=0, wild_card=True, oldest raise -def process_image_bookmark(mode, hide='n', start_page=1, end_page=0): +def process_image_bookmark(mode, hide='n', start_page=1, end_page=0, tag=''): global np_is_valid global np try: @@ -900,12 +900,13 @@ def process_image_bookmark(mode, hide='n', start_page=1, end_page=0): image_count = 1 if hide == 'n': - totalList.extend(get_image_bookmark(False, start_page, end_page)) + totalList.extend(get_image_bookmark(False, start_page, end_page, tag)) elif hide == 'y': - totalList.extend(get_image_bookmark(False, start_page, end_page)) - totalList.extend(get_image_bookmark(True, start_page, end_page)) + # public and private image bookmarks + totalList.extend(get_image_bookmark(False, start_page, end_page, tag)) + totalList.extend(get_image_bookmark(True, start_page, end_page, tag)) else : - totalList.extend(get_image_bookmark(True, start_page, end_page)) + totalList.extend(get_image_bookmark(True, start_page, end_page, tag)) PixivHelper.printAndLog('info', "Found " + str(len(totalList)) + " image(s).") for item in totalList: @@ -921,7 +922,7 @@ def process_image_bookmark(mode, hide='n', start_page=1, end_page=0): __log__.exception('Error at process_image_bookmark(): ' + str(sys.exc_info())) raise -def get_image_bookmark(hide, start_page=1, end_page=0): +def get_image_bookmark(hide, start_page=1, end_page=0, tag=''): """Get user's image bookmark""" total_list = list() i = start_page @@ -933,6 +934,8 @@ def get_image_bookmark(hide, start_page=1, end_page=0): url = 'http://www.pixiv.net/bookmark.php?p=' + str(i) if hide: url = url + "&rest=hide" + if tag is not None and len(tag) > 0: + url = url + '&tag=' + encode_tags(tag) PixivHelper.printAndLog('info', "Importing user's bookmarked image from page " + str(i)) PixivHelper.printAndLog('info', "Source URL: "+ url) @@ -1424,10 +1427,11 @@ def menu_download_from_online_image_bookmark(mode, opisvalid, args): start_page = 1 end_page = 0 hide = False + tag = '' if opisvalid and len(args) > 0: arg = args[0].lower() - if arg == 'y' or arg == 'n': + if arg == 'y' or arg == 'n' or arg == 'o': hide = arg else: print "Invalid args: ", args @@ -1441,9 +1445,10 @@ def menu_download_from_online_image_bookmark(mode, opisvalid, args): else: print "Invalid args: ", arg return + tag = raw_input("Tag (default=All Images): ") or '' (start_page, end_page) = get_start_and_end_number() - process_image_bookmark(mode, hide, start_page, end_page) + process_image_bookmark(mode, hide, start_page, end_page, tag) def menu_download_from_tags_list(mode, opisvalid, args): diff --git a/changelog.txt b/changelog.txt index 219cb72c..3d98e5be 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,9 +1,10 @@ -20160210-beta1: -- Try to fix Issue #98. +20160211: +- Fix Issue #98: Fix error message when download fail. - Add option to filter image bookmark by tags. - Update parser. -- Try to fix Issue #103 -- Fix Issue #104. +- Fix Issue #103: Fix overwrite local file option. +- Fix Issue #104: Fix %artist% parser. +- Implement Feature #105: Download bookmarked image by tag. 20151112: - Fix Issue #96: page 100 is not downloaded for new illust page.