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

Unknown Error, please check the log file: (<class 'KeyError'>, KeyError('coverImageUrl'), <traceback object at 0x0419F228>) #1181

Open
Hecatom opened this issue Oct 24, 2022 · 9 comments

Comments

@Hecatom
Copy link

Hecatom commented Oct 24, 2022

Prerequisites

  • [y ] Did you read FAQ section in readme.md?
  • [y ] Did you test with the latest releases or commit ?
  • [y ] Did you search for existing issues in Issues?

Description

I am getting an unknown error when trying to download the list of all my supported artists with f1.
Just some hours ago it was working fine.

The only difference between some hours ago and now, is that I added a new artist to my support list, so dunno if that could be the cause

Steps to Reproduce

  1. Enter application
  2. select f1
  3. select 0 for end page
  4. Program gives error

Expected behavior: [What you expected to happen]
The expected behavior would be to download all the artists on the supported list

Actual behavior: [What actually happened]

Unknown Error, please check the log file: (<class 'KeyError'>, KeyError('coverImageUrl'), <traceback object at 0x036BE848>)
press enter to exit.

Log file: [Attach the pixivutil.log file in the application folder, recommended to delete the old file, reproduce the issue, and upload the newly generated file here]
pixivutil.log

Versions

v20220924
You can get this information from executing PixivUtil2.py --help.
Latest version available in https://github.com/Nandaka/PixivUtil2/releases

@Hecatom
Copy link
Author

Hecatom commented Oct 24, 2022

Something to take not is that downloading normal pixiv galleries work, so is only on the fanbox side that the error is happening

@nuke777
Copy link

nuke777 commented Oct 24, 2022

It basically does not recognize the key 'coverImageUrl'.
I think fanbox might've changed something. The key variable needs to be updated.

https://github.com/Nandaka/PixivUtil2/blob/master/PixivModelFanbox.py#L94

@nuke777
Copy link

nuke777 commented Oct 24, 2022

Well looks like the whole JSON structure changed

@shinji257
Copy link

(For reference)
Example artist: 2029329
Example post: 4654957

This artist creates NSFW content although I think the posts themselves are ok... probably. Access at your own risk. The example post is accessible by all users and does not require supporting them.

@DisasterInbound
Copy link

Hello, I can confirm I started receiving this message today.

I got the following error which seems to match with what alg-wiki said:

Traceback (most recent call last):
  File "PixivUtil2.py", line 1736, in main
  File "PixivUtil2.py", line 1468, in main_loop
  File "PixivUtil2.py", line 1000, in menu_fanbox_download_by_id
  File "PixivFanboxHandler.pyc", line 50, in process_fanbox_artist_by_id
  File "PixivBrowserFactory.pyc", line 1018, in fanboxGetPostsFromArtist
  File "PixivModelFanbox.pyc", line 566, in parsePosts
  File "PixivModelFanbox.pyc", line 67, in __init__
  File "PixivModelFanbox.pyc", line 94, in parsePost
KeyError: 'coverImageUrl'
Unknown Error, please check the log file: (<class 'KeyError'>, KeyError('coverImageUrl'), <traceback object at 0x009C0748>)

KamenReader added a commit to KamenReader/PixivUtil2 that referenced this issue Oct 27, 2022
Address issue that arises when cover is a type other than "cover_image"
Nandaka pushed a commit that referenced this issue Oct 28, 2022
* Fix issue with fanbox coverImageUrl

It looks like the post list and posts themselves use a different key for the cover image (I am assuming this is new, due to the error only showing up now) so calling ParsePost on the list (which uses a "cover" object which either has a url key or nothing) will break as it is expecting simply a coverImageUrl key.  The change here will handle it differently depending on whether it finds the coverImageUrl key or not.

* Update content_provider.json

Apparently the embed json uses cover.url instead of coverImageUrl now, similarly to the post list.

* Update PixivModelFanbox.py

While gross, this change is likely necessary to prevent problems with an embedded post that has no cover image.  If someone can come up with a better check, please provide one.  If the cover URL behaves similarly to the post list, in the event that there is no cover image for a post, the "cover" object will be empty, so trying to retrieve the value for the "url" key will fail and crash PixivUtil2.  This change verifies that the "url" key exists before retrieving the value.

* Update fanbox_urlembed.json

Update test data with new cover url format

* Update PixivModelFanbox.py

Address situation where embedded post's cover object is None

* Update PixivModelFanbox.py

break instead of redundant assignment of root = None, since it's not longer necessary

* Further fixes for issue #1181

Address issue that arises when cover is a type other than "cover_image"
@KamenReader
Copy link
Contributor

@Nandaka Sorry to be a bother, but now that there's a fix, could we get a new build? I know you don't use the Fanbox module much, but for those of us who do, it's basically dead in the water without the fix.

@shinji257
Copy link

As long as Nandaka is ok with it I can zip up a build using the latest code on this repo and post it here. It will have the same version as the current one already released as I'm not going to update the constant so when Nankada does update you can go grab the official one.

I will let you know it does build a bit differently for whatever reason but works fine otherwise.

@KamenReader
Copy link
Contributor

I'm fine running off my own build too. I meant it more for everyone else, like Hecatom who had issues getting it to run earlier or those who might not want to fiddle with python in general. I'm sure there are even others still who don't even go so far as to look at the Issues list and just check to see if a new release has been posted. More of a convenience thing for the end users to push out a release, even if it's beta or something.

@shinji257
Copy link

Nandaka got a new build up for everyone to use and get the fix.

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

5 participants