diff --git a/PixivBrowserFactory.py b/PixivBrowserFactory.py index c270c14e..1ecfdd7a 100644 --- a/PixivBrowserFactory.py +++ b/PixivBrowserFactory.py @@ -642,11 +642,12 @@ def getImagePage(self, bookmark_count=-1, image_response_count=-1, manga_series_order=-1, - manga_series_parent=None) -> Tuple[PixivImage, str]: + manga_series_parent=None, + is_unlisted=False) -> Tuple[PixivImage, str]: image = None response = None PixivHelper.get_logger().debug("Getting image page: %s", image_id) - if isinstance(image_id, int): + if not is_unlisted: # https://www.pixiv.net/en/artworks/76656661 url = f"https://www.pixiv.net{self._locale}/artworks/{image_id}" else: diff --git a/PixivImageHandler.py b/PixivImageHandler.py index 53088831..aceb5e87 100644 --- a/PixivImageHandler.py +++ b/PixivImageHandler.py @@ -38,7 +38,8 @@ def process_image(caller, reencoding=False, manga_series_order=-1, manga_series_parent=None, - ui_prefix="") -> int: + ui_prefix="", + is_unlisted=False) -> int: # caller function/method # TODO: ideally to be removed or passed as argument db: PixivDBManager = caller.__dbManager__ @@ -54,9 +55,9 @@ def process_image(caller, parse_medium_page = None image = None result = None - if isinstance(image_id, int): + if not is_unlisted: # https://www.pixiv.net/en/artworks/76656661 - url = f"https://www.pixiv.net/artworks/{image_id}" + referer = f"https://www.pixiv.net/artworks/{image_id}" else: # https://www.pixiv.net/artworks/unlisted/SbliQHtJS5MMu3elqDFZ referer = f"https://www.pixiv.net/artworks/unlisted/{image_id}" @@ -88,7 +89,8 @@ def process_image(caller, from_bookmark=bookmark, bookmark_count=bookmark_count, manga_series_order=manga_series_order, - manga_series_parent=manga_series_parent) + manga_series_parent=manga_series_parent, + is_unlisted=is_unlisted) if len(title_prefix) > 0: caller.set_console_title(f"{title_prefix} ImageId: {image.imageId}") else: diff --git a/PixivUtil2.py b/PixivUtil2.py index 95a03333..58724fb3 100644 --- a/PixivUtil2.py +++ b/PixivUtil2.py @@ -747,7 +747,8 @@ def menu_download_by_unlisted_image_id(opisvalid, args, options): __config__, artist=None, image_id=image_id, - useblacklist=False) + useblacklist=False, + is_unlisted=True) except BaseException: PixivHelper.print_and_log('error', f"Image ID: {image_id} is not valid") global ERROR_CODE @@ -761,7 +762,8 @@ def menu_download_by_unlisted_image_id(opisvalid, args, options): __config__, artist=None, image_id=image_id, - useblacklist=False) + useblacklist=False, + is_unlisted=True) def menu_ugoira_reencode(opisvalid, args, options):