PixivUtil2
PixivUtil2 copied to clipboard
Fanbox stopped working
I get to the main menu but selecting f1 makes the program exit with the following error:
2023-05-01 15:12:31,057 - PixivUtil20230105 - INFO - Download FANBOX Supporting list mode (f1/f4/f5).
2023-05-01 15:12:32,948 - PixivUtil20230105 - INFO - Trying to log in FANBOX with saved cookie
2023-05-01 15:12:45,634 - PixivUtil20230105 - ERROR - Error at fanboxLoginUsingCookie(): (<class 'mechanize._response.get_seek_wrapper_class.<locals>.httperror_seek_wrapper'>, <httperror_seek_wrapper (urllib.error.HTTPError instance) at 0x231c278edd0 whose wrapped object = <HTTPError 302: 'The HTTP server returned a redirect error that would lead to an infinite loop.\nThe last 30x error message was:\nFound'>>, <traceback object at 0x00000231C2504280>)
2023-05-01 15:12:45,634 - PixivUtil20230105 - ERROR - Unknown Error: 'str' object has no attribute 'decode'
Traceback (most recent call last):
File "C:\Users\Admin\Downloads\PixivUtil2\PixivUtil2.py", line 1738, in main
np_is_valid, op_is_valid, selection = main_loop(ewd, op_is_valid, selection, np_is_valid, args, options)
File "C:\Users\Admin\Downloads\PixivUtil2\PixivUtil2.py", line 1467, in main_loop
menu_fanbox_download_from_list(op_is_valid, PixivModelFanbox.FanboxArtist.SUPPORTING, args, options)
File "C:\Users\Admin\Downloads\PixivUtil2\PixivUtil2.py", line 920, in menu_fanbox_download_from_list
ids = __br__.fanboxGetArtistList(via)
File "C:\Users\Admin\Downloads\PixivUtil2\PixivBrowserFactory.py", line 913, in fanboxGetArtistList
self.fanbox_is_logged_in()
File "C:\Users\Admin\Downloads\PixivUtil2\PixivBrowserFactory.py", line 420, in fanbox_is_logged_in
if not self.fanboxLoginUsingCookie(self._config.cookieFanbox):
File "C:\Users\Admin\Downloads\PixivUtil2\PixivBrowserFactory.py", line 403, in fanboxLoginUsingCookie
if '"user":{"isLoggedIn":true' in str(parsed.decode('utf-8')):
AttributeError: 'str' object has no attribute 'decode'
2023-05-01 15:12:45,634 - PixivUtil20230105 - ERROR - Unknown Error, please check the log file: (<class 'AttributeError'>, AttributeError("'str' object has no attribute 'decode'"), <traceback object at 0x00000231C279F180>)
I tried regenerating the cookies for both pixiv and fanbox but it's stuck at the same point. Network options:
[Network]
useProxy = False
proxyAddress =
useragent = Mozilla/5.0
useRobots = True
timeout = 60
retry = 3
retryWait = 5
downloadDelay = 5
checkNewVersion = True
notifyBetaVersion = True
openNewVersion = True
enableSSLVerification = True
Can confirm this same bug appears using f2 and specifying an artist ID as well. Appears any Fanbox operation fails.
I only use f5 and that still works for me. Most likely that they made fanbox site changes
Not for me, sadly:
Input: f5
End Page (default is 0) = 1
Found 2 artist(s) in custom list
['https://www.fanbox.cc/@fanbox1', 'https://www.fanbox.cc/@fanbox2']
Reading C:\Users\Admin\Downloads\PixivUtil2\config.ini ...
Configuration loaded.
Trying to log in FANBOX with saved cookie
Traceback (most recent call last):
File "C:\Users\Admin\Downloads\PixivUtil2\PixivUtil2.py", line 1738, in main
np_is_valid, op_is_valid, selection = main_loop(ewd, op_is_valid, selection, np_is_valid, args, options)
File "C:\Users\Admin\Downloads\PixivUtil2\PixivUtil2.py", line 1475, in main_loop
menu_fanbox_download_from_list(op_is_valid, PixivModelFanbox.FanboxArtist.CUSTOM, args, options)
File "C:\Users\Admin\Downloads\PixivUtil2\PixivUtil2.py", line 945, in menu_fanbox_download_from_list
PixivFanboxHandler.process_fanbox_artist_by_id(sys.modules[__name__],
File "C:\Users\Admin\Downloads\PixivUtil2\PixivFanboxHandler.py", line 20, in process_fanbox_artist_by_id
artist = br.fanboxGetArtistById(artist_id)
File "C:\Users\Admin\Downloads\PixivUtil2\PixivBrowserFactory.py", line 943, in fanboxGetArtistById
self.fanbox_is_logged_in()
File "C:\Users\Admin\Downloads\PixivUtil2\PixivBrowserFactory.py", line 420, in fanbox_is_logged_in
if not self.fanboxLoginUsingCookie(self._config.cookieFanbox):
File "C:\Users\Admin\Downloads\PixivUtil2\PixivBrowserFactory.py", line 403, in fanboxLoginUsingCookie
if '"user":{"isLoggedIn":true' in str(parsed.decode('utf-8')):
AttributeError: 'str' object has no attribute 'decode'
Unknown Error, please check the log file: (<class 'AttributeError'>, AttributeError("'str' object has no attribute 'decode'"), <traceback object at 0x0000018CFDD12240>)
press enter to exit.
Figured it out on my end. This happens because Fanbox has shortened their cookie expiration dates to 30 days. So this error happens when the supplied cookie value in config.ini has expired. Replacing the cookie value with my latest refreshed one resolved it.
That said, the error thrown here should still not happen just because the cookie is expired. So while updating your cookie will get you back up and running, I'd say there's still something code-wise that should be changed in pixivutil2 so that it handles an expired cookie more gracefully.
I've been using the same cookies for 6 months now, I'm still fine huh
Maybe it's a staggered rollout, or maybe it only affects users in certain regions, or something else.
All I can say is I was getting the same error as OP, then I decided to check my Fanbox cookie in my browser, saw the value had changed and that the cookie expiration was now 30 days, replaced the cookie in config.ini with the new value, and now it's working just fine.
I've used a vpn to confirm that region does matter. The cookie generated from Japan doesn't work, the cookie generated from Philippines does work.
I had to recently refresh my Fanbox cookie for the first time.