Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-interactive new illust from bookmarked members doesn't work without explicit count limit #1348

Open
3 tasks done
Hamuko opened this issue Jul 3, 2024 · 3 comments
Open
3 tasks done

Comments

@Hamuko
Copy link
Contributor

Hamuko commented Jul 3, 2024

Prerequisites

Description

Non-interactive bookmark downloading (option 8) is broken in 20240703 as it tries to run len() on an integer, most likely len(-1) as that seems to be the default for --bcl / --bookmark_count_limit, which is not a valid operation in Python.

This can be worked around by adding the bookmark count limit explicitly (for example --bcl=-1), as that will supply the value as a string instead, but there's really no way to figure it out without reading the source code.

Most likely broken by #1324.

Steps to Reproduce

  1. Run PixivUtil2 with -s 8 --ep=3 -x arguments.

Expected behavior:

Three first bookmarked pages are downloaded.

Login successful.
My User Id: xxxxxxx.
Premium User: False.
End Page = 3
Processing New Illust from bookmark
Page #1
Image #1
Processing Image Id: xxxxxxxxx
[...]
Limit or last page reached.
Done.

Actual behavior:

PixivUtil2 crashes immediately after login.

Login successful.
My User Id: xxxxxxx.
Premium User: False.
End Page = 3
Traceback (most recent call last):
  File "/PixivUtil2.py", line 1745, in main
    np_is_valid, op_is_valid, selection = main_loop(ewd, op_is_valid, selection, np_is_valid, args, options)
  File "/PixivUtil2.py", line 1422, in main_loop
    menu_download_new_illust_from_bookmark(op_is_valid, args, options)
  File "/PixivUtil2.py", line 648, in menu_download_new_illust_from_bookmark
    if bookmark_count is not None and len(bookmark_count) > 0:
TypeError: object of type 'int' has no len()
Unknown Error, please check the log file: (<class 'TypeError'>, TypeError("object of type 'int' has no len()"), <traceback object at 0x7f22113ff080>)

Versions

Broken in 20240703. Worked in 20230105.

I am running PixivUtil2 using my own Docker container, but it shouldn't really affect anything.

@Butterfly-Dragon
Copy link

Butterfly-Dragon commented Jul 15, 2024

2024-07-11 11:59:27,320 - PixivUtil20240703 - INFO - ###############################################################
2024-07-11 11:59:27,320 - PixivUtil20240703 - INFO - Starting with argument: [PixivUtil2.exe -s 5 -p y --ep 1 -x].
2024-07-11 11:59:27,320 - PixivUtil20240703 - INFO - Setting log level to: DEBUG
2024-07-11 11:59:27,320 - PixivUtil20240703 - INFO - No default cookie jar available, creating... 
2024-07-11 11:59:27,889 - PixivUtil20240703 - INFO - Using default DB Path: D:\Downloads\Downloader\!downloader\PixivUtil2\db.sqlite
2024-07-11 11:59:27,905 - PixivUtil20240703 - INFO - Only process members where the last update is >= 99999999999 days ago
2024-07-11 11:59:28,162 - PixivUtil20240703 - INFO - Using local timezone: +01:00
2024-07-11 11:59:28,162 - PixivUtil20240703 - INFO - Trying to log in with saved cookie
2024-07-11 11:59:29,608 - PixivUtil20240703 - INFO - Logging in, return url: https://www.pixiv.net/en/
2024-07-11 11:59:29,608 - PixivUtil20240703 - INFO - Login successful.
2024-07-11 11:59:29,608 - PixivUtil20240703 - INFO - Logged in using cookie
2024-07-11 11:59:29,609 - PixivUtil20240703 - INFO - My User Id: [REDACTED].
2024-07-11 11:59:29,610 - PixivUtil20240703 - INFO - Premium User: False.
2024-07-11 11:59:29,610 - PixivUtil20240703 - INFO - Locale = /en
2024-07-11 11:59:29,610 - PixivUtil20240703 - INFO - User Bookmarked Artist mode (5).
2024-07-11 11:59:29,611 - PixivUtil20240703 - ERROR - Unknown Error: object of type 'int' has no len()
Traceback (most recent call last):
  File "PixivUtil2.py", line 1745, in main
  File "PixivUtil2.py", line 1416, in main_loop
  File "PixivUtil2.py", line 531, in menu_download_from_online_user_bookmark
TypeError: object of type 'int' has no len()
2024-07-11 11:59:29,612 - PixivUtil20240703 - ERROR - Unknown Error, please check the log file: (<class 'TypeError'>, TypeError("object of type 'int' has no len()"), <traceback object at 0x0000016C8B0E8400>)
2024-07-11 11:59:29,613 - PixivUtil20240703 - INFO - EXIT: -1
2024-07-11 11:59:29,613 - PixivUtil20240703 - INFO - ###############################################################

i'm having this problem too, for option 5 instead of 8

@Nandaka
Copy link
Owner

Nandaka commented Jul 18, 2024

pass it using --bookmark_count_limit

image

@Butterfly-Dragon
Copy link

pass it using --bookmark_count_limit

currently i followed the original poster's advice by adding --bcl=-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants