PixivUtil2
PixivUtil2 copied to clipboard
[http2] Endless loop with Artist Info: (<class 'TypeError'>, TypeError('list indices must be integers or slices, not str'), PixivException 1002 not properly caught
Prerequisites
- [x] Did you read FAQ section in readme.md?
- [x] Did you test with the latest releases or commit ?
- [x] Did you search for existing issues in Issues?
Description
Utility loops on Error at processing Artist Info: (<class 'TypeError'>, TypeError('list indices must be integers or slices, not str')
until forcefully closed if the page returns PixivException 1002
.
(It continuously attempts to retrieve information it cannot instead of skipping it with a dump like before.)
Steps to Reproduce
- Option 1, example artist 98192
- Wait until the utility loops then terminate it before it fills the log
Expected behavior: Download from artist/artist id list
Actual behavior: Endless loop, the utility must be terminated by the user, if a list is provided, the rest of the list will not be processed
Log file:
[...]
****,404 - PixivUtil20221029 - ERROR - Error at processing Artist Info: (<class 'TypeError'>, TypeError('list indices must be integers or slices, not str')
****,435 - PixivUtil20221029 - ERROR - Error at processing Artist Info: (<class 'TypeError'>, TypeError('list indices must be integers or slices, not str')
****,467 - PixivUtil20221029 - ERROR - Error at processing Artist Info: (<class 'TypeError'>, TypeError('list indices must be integers or slices, not str')
[...]
Versions
https://github.com/Nandaka/PixivUtil2/commit/2fe5bb1e4dddc7b80c7bd950d1cd1e5290c53397
edit: this only happens with artists returning exception 1002, title updated. If lists are used https://github.com/Nandaka/PixivUtil2/commit/b65b3f62d78f5a7b805de95f946ee581f4291d42 should be used instead.
weird, I tested it and I got the proper message in 2fe5bb1e4dddc7b80c7bd950d1cd1e5290c53397
Can you upload the log file?
Thank you for the reply.
Please try with example artist 98192. The error returned is different (artist not found), I guess this is because that one error isn't caught. I will edit the issue to reflect that it only applies to such artists.
I tried with https://github.com/Nandaka/PixivUtil2/commit/3d48f6c335829cefced7e45ea669211bb89c6ff1 and got this (same behavior):
Member Url: https://www.pixiv.net/ajax/user/98192/profile/all
Error at processing Artist Info: (<class 'TypeError'>, TypeError('list indices must be integers or slices, not str'), <traceback object at 0x0000018F9DDCC940>)
Traceback (most recent call last):
File "PixivArtistHandler.py", line 68, in process_member
(artist, list_page) = PixivBrowserFactory.getBrowser().getMemberPage(member_id, page, bookmark, tags, r18mode=config.r18mode, throw_empty_error=True)
File "PixivBrowserFactory.py", line 838, in getMemberPage
self.getMemberInfoWhitecube(member_id, artist, bookmark)
File "PixivBrowserFactory.py", line 764, in getMemberInfoWhitecube
artist.ParseBackground(info_ajax)
File "PixivArtist.py", line 138, in ParseBackground
self.artistId = root["userId"]
TypeError: list indices must be integers or slices, not str
The error from the browser is ユーザーが見つかりませんでした
instead of 該当ユーザーは既に退会したか、存在しないユーザーIDです。
The log was posted, it doesn't have any more information other than that error, should I put it on VERBOSE
?
edit: https://github.com/Nandaka/PixivUtil2/commit/b65b3f62d78f5a7b805de95f946ee581f4291d42 (master branch) correctly catches PixivException 1002
and then continues normally if a list of ids is provided:
Member ID (98192): PixivException(1002 ユーザーが見つかりませんでした, hasDumpPage=Y)