NightLancer / PixivPreview

Showing an enlarged preview of arts/manga, highlighting followed users, providing history better then premium on pixiv
https://www.pixiv.net/
MIT License
29 stars 3 forks source link

Coloring of followed artists not working on Chrome. #14

Closed drakom88 closed 3 years ago

drakom88 commented 3 years ago

No green coloring over followed artists for me in Chrome. Was working yesterday. Have tried refreshing page and disabling/re-enabling script on: Front page, Tags, and Related Works. Thanks in advance for your great advice/work!

NightLancer commented 3 years ago

@drakom88 Hello, thanks for reporting. So, coloring feature doesn't work at all(on any page)? I'll try to check it in coming days on Chrome, but it would be nice if you post some screenshots/logs of errors you have in your console[F12] (if you have such, of course).

drakom88 commented 3 years ago

Okay. I have shots of errors on first page of console, Pixiv homepage, and a related works portion. Let me know if anything else would be helpful. pixiv errors A Pixiv Related works APixiv home

NightLancer commented 3 years ago

@drakom88 Okay, I've updated my script in my Chrome on laptop (v 89.0.4389.114, 30 March 2021 - pretty fresh), and there was no script errors.

Related works section under some artwork: Screenshot_189

Main page: Screenshot_190

I was bit unsure the moment I saw yours log screen, and now I knew why - it is log from the "Network" tab(requests), not "Console" tab(debug & info). Below is sample for my case: Screenshot_191 Lines of my script are outlined with green - there no errors out there, only info logs(there are some errors of pixiv own modules, but they are always is, and doesn't correlate with script work, as you can ensure with screens above).

So, can you take screen of actual "Console" tab? Maybe "Network" is last/standard tab in your case, then you just need to click to console manually. And, please, specify version of browser and OS you are using(if it's not "Windows"). And script manager also ("Tampermokey"/etc), and it's version too.

Besides that, I can see others scripts work on the "Related works" screenshot(colored dimensions of artworks), so maybe there is some script conflicts? You can try to turn off all other script managers(if you have more than 1), and turn of all other scripts. Then restart page(and better - whole browser) and see does my script work or not? If yes, then there may be some conflicts with other scripts. If not - you can take screenshot of only my script log(and own pixiv errors, of course), without influence of other scripts.

Also, when this issue occurred? 4 days ago, after some browser/addon update, or you didn't noticed when? Anyway, if there some errors - it should be fired in console by browser/script manager, or by my own debugging code.

drakom88 commented 3 years ago

Apologies, I hope these images are proper. I am using Windows 7- 64bit.
Chrome- 89.0 Tampermonkey- 4.12 I disabled all other scripts and any extension that seemed linked to Pixiv, and restarted browser; highlight still not working. Beginning a couple weeks back it began taking longer for the highlighted effect to appear. 6 or so days ago no highlights. I don't recall adding more scripts or making OS changes then or now, but I believe Chrome did update.

I added two images of console, there were roughly 8 minutes between them. The "followed check start" took that length of time to complete. Let me know if I can do/supply anything else. Thank you for your assistance.

EDIT I just tried it on latest version of Firefox. It hangs at around 55 on "followed check" and then errors. The console is quite long, but I can post screenshots in a new message if that would be helpful.

Pixiv Preview only 1 Pixiv preveiw only 2

EDIT 2 I upgraded to Windows 10, carrying over settings, and the issue persists. I can wipe my HDD and do a fresh Windows 10 upgrade if you believe that would be the easiest solution.

drakom88 commented 3 years ago

Update: I installed only your script on another PC, logged into Pixiv with my account, no green on followed users. Then I made a new Pixiv account on my main PC and followed 2 accounts, this is the result:

Pixiv Home New

Pixiv main account is highlighted, but no others. So I then followed an account my main account follows, and indeed that one is now highlighted as well:

Pixiv Home New 1

If the followed data is stored locally, then perhaps I have hit a maximum number of followed accounts and/or a maximum file size?

NightLancer commented 3 years ago

@drakom88 Hello.

Sorry for such a long reply. Firstly I looked very closely for any errors in my script(referring by your screenshoots) - but hardly had found any(and browser adds extra line shift for code, so I can have only approximately position of errors). Then some problems from my work didn't let me to have last proper weekends... but less with that now. Now, with fresh look(and new clean install of portable Chrome on my PC) I have found all clues needed.

1 - Pixiv has removed 'old' bookmarks page entirely, that's why script was broken. (was https://www.pixiv.net/bookmark.php?type=user, now https://www.pixiv.net/en/users/******/following)

2 - there is a beta-testing program on pixiv, of which I remembered just now, and because of which our script runs gives us different results - you were 'lucky' to be in 10% of testing users for this update, that's why bookmarks page disappeared for you earlier than for other 90% of users(including me). I should somehow engrave this in my mind when reading next issue report... At the current time - this update has come to me as well, and I personally got the same errors you screenshotted(and can test solution for this problem a way faster, than like making some fixes and bothering you to test and send reports for every iteration of them...)

So, I'll make an update for this ASAP, and let you know when it's ready.

It is great honor to see such devotion(your suggestion to wipe HDD and resinstall windows just to help the script to work), but gladly there is no need in such extreme measures XD

If the followed data is stored locally, then perhaps I have hit a maximum number of followed accounts and/or a maximum file size?

Yes, data is stored locally, but no, you hardly hit the maximum of it's capacity) The limit is different for every browser and common for all data stored per one domain(so, other script's data and own pixiv's data are counting as well). For Chrome case, I was tested another script on my work for like 45k entries with 4 data fields, and all was fine. This gives us at least ~200k storage capacity for storing followed users ids(and I doubt someone could exhaust such an huge amount).

P.S. For other purposes for this free space, I was thinking of possibility of making free analogue of pixiv's premium "history" feature. Pixiv's own history have some limitations: 10000 works maximum, and only for last 180 days. My script will be limited only by a factor of browsers localStorage size(which can be increased by user! At least, it Firefox). I was thinking about 100k history records for the start(but this is already 10x more that pixiv can offer). I was looking for such an existing script - but have found none, so added this option to one of possible expansions of my script. How did you look at this? Will it be useful feature for you, for example?

UPD: the new layout of followed page is quite sophisticated for simple raw using... External API using with requesting users password is out of option, since no one would like such(despite it could be easier option for implementation). I will look for resolving this issue using regular query calls, and if I be lucky, I may find direct pixiv's api call that doesn't need extra users credentials.

NightLancer commented 3 years ago

@drakom88 Issue fixed. There was some bug with menu selector on some pages in Chrome - fixed it too(till next layout change, I suppose).

Tested new approach(with simultaneous loading of all request) at 10th requests in the same time - it works, but I have only ~300 followed users, so that was a light try. So, it should work for up to 1000 users followed, and I hope - for more as well.

Update the script and let me know if everything is fine. Now, with actual Chrome version on my PC I will be able to test and reproduce errors in it much quicker. Still, I can't test beta-testers layout, if I have not one... Quite sad for as for a developer, 'cause every time users encountering a new bug regarding new pixiv update I either can't even knew about it or can't reproduce it to make a quick solution... Although, one time I made successful "blind" fix for a bug I haven't, and even more - from first try! XD That was very lucky attempt, but still)

Thank you for reporting errors and feedback!

drakom88 commented 3 years ago

@NightLancer

Hello, Work must come first. Glad you have some spare time now. =) Ah, not a very lucky beta test at all haha.

Yes, this script saves me so much time/frustration it would easily be worth wiping C: drive for. (I would still love to make a donation for your excellent work, when possible / if desirable)

200k user IDs is comforting, I'm almost at 10k after quite a while so that seems fine.

As for Pixiv browsing history, I'm not very familiar with it. Does their history mode just show which images you have looked at, or does it have additional uses? I do not use it as far as I know, but I may be mistaken.

The way I typically use the site is: 1) Go to page of desired tag and sort by popularity. 2) Middle-click user names of interest, follow them to signify I have viewed their works 3) Download works of interest individually. ( I also use related works beneath an image to find more similar works)

I was using "I'm a Gentleman" extension to drag and save images, however that stopped functioning on Pixiv. I have now set up a mouse macro which is [Right click, V, 0.65 second delay, Enter]. Quite annoying but fairly functional.

A feature I think would help me would be: Tracking favorited tags, since Pixiv limits them to 10. (I would use this to track which tags I have "completed" rather than writing them down manually.) I don't know much about the site mechanics (even from a user standpoint) so this may be redundant given another feature set?

I'm sure my method of gathering images isn't the most preferred way, so if you have tips/suggestions in that regard I would appreciate it. Would you suggest my switching to Firefox for Pixiv? If so, any settings changes I should incorporate?

Thanks again for creating and maintaining this script, exceedingly helpful.

drakom88 commented 3 years ago

Updated script on Chrome and Firefox, both hang on "waiting for followed users" and then throw errors. "Error while EXPECTING for subscriptions list"

NightLancer commented 3 years ago

@drakom88

Updated script on Chrome and Firefox, both hang on "waiting for followed users" and then throw errors. "Error while EXPECTING for subscriptions list"

... Welp, it couldn't be so easy, could it?)

I set artificial following count to 10000(100 requests), and tried with several options in Chrome. Just refreshing a page with new count, writing wrong followedCheck status("1", exactly, because this is needed to go into a loop where you can get "waiting for followed users" message), wiping all localStorage for pixiv. All cases were successful with no errors... зображення

Possible causes of problem in your case:

I may edit current script, add more debug logs, remove 30sec time limit(or set it, say, 300sec), so the cause of problem may be more clear. Maybe clearing a localStorage may help you(but that must be "done" the moment you reinstalled the windows/browser, so doubtfully it will help...).

I did one. There is 300sec timeout instead of 30sec, and more debug information. Hope this may help to see the root of problem зображення I've uploaded it to other site to not mess up with current release version, you need to install it by this link: https://openuserjs.org/scripts/NightLancerX/Pixiv_Arts_Preview_Followed_Atrists_Coloring

Test it with your profile, with clear profile (in other browser, to be to suitable, it's is nice to run localStorage.clear() on pixiv page in console[F12] in your non-primary browser(and better - non-primary account). Warning! All history will be deleted as well![tags and etc]), and make a screenshots such as mine above. You can wipe out the user ID(just be sure it is non-zero), but please unfold all of requests logs by clicking on the arrows near them(marked with green).

drakom88 commented 3 years ago

I made a new profile on Firefox and Pixiv, did localstorage clear on console page. No User ID field. Also, it has been loading followed users for around 15 minutes and is at around 700 loaded. Before I updated the script it was loading each follow twice, taking 3 seconds to do so, now it is loading each follow four times, taking around 4 seconds to do so. This means 8-11 hours to load 10k accounts? image

Here are chrome errors on my main account, I don't see a User ID field: image image image image

Hope this helps. I could also change my Pixiv password and loan you use of my account if that would be more helpful?

NightLancer commented 3 years ago

@drakom88

No way... It's really drops an error at first lines when trying to parse the user ID... I changed search mask with random crap and reproduced the same error: зображення

Next error isn't mine, it's something broken with pixivs "booth" thing, all works well despite this error if ID is retrieved. зображення

Before I updated the script it was loading each follow twice, taking 3 seconds to do so, now it is loading each follow four times, taking around 4 seconds to do so.

Are you speaking of "waiting for followed users..." messages? зображення There are so many of them depending of portions of arts was loading before following user IDs are obtained. And this part of code is just waiting for followed users, it doesn't represent it's progress(currently there is no such in release version, maybe I need to restore it with next update). There are 3 of them at the main page and 0 on the artworks page for my case. If you scroll down while id's are still loading - then there may be another load of arts awaiting to be colored(another line in the console). All possible delays may be only before first coloring is applied, and with script working properly it should not be so much of trouble...

This means 8-11 hours to load 10k accounts?

Nope, this is actual queries: зображення and as you can see from my first screenshot from the comment above - 100 queries took ~7 seconds in simulation case. Real case may be quite longer(depending on ping and internet speed), but not hours) Maybe not 7, but that 30 seconds(I hope it's faster, like 15sec max). I'm already thinking of coloring arts "as is" with first load, while awaiting for fresh ID's, for much quicker relative response of script work to user. It would be not so accurate, but there would be no delay(7, 30, or no matter ho many seconds) before actual followed ID's is retrieved. But, even so, such delay is encountered only once a day! All other checks within 23hours are using localStorage, which has only browser code execution delay(1-2 seconds). But still, I will look if I can get rid even of those first-per-day delay of coloring.

I could also change my Pixiv password and loan you use of my account if that would be more helpful?

Let it be the last line of solution. I appreciate your trust, but ID error seems not relative with specific account, and for now it is the first problem. If after fixing ID problem second step(request time) will be to big, and I can't half-blindly fix it from my side - let's consider this option only then.

Returning to the problem: There are next several thing to be clarified.

That would be enough for now. 1 - tell me do you receive a page like that above by opening bookmarks page, 2 - write/send me an ID of some user(if you want - yours) with as much public followed users as you have(10k). None of my artists have even 500 users followed... but maybe I can find some by occasion. Or just write a temporary(or whatever) mail, and send me your id after I send you a letter from mine unused mail box(if you concerned about privacy).

drakom88 commented 3 years ago

It takes me to https://www.pixiv.net/bookmark.php, no redirect. When I open https://www.pixiv.net/en/users/XXXXXXXXX/bookmarks/artworks with my ID it takes me to my user page -> Bookmarks -> Illustrations and Manga UID: 21887921

NightLancer commented 3 years ago

It takes me to https://www.pixiv.net/bookmark.php, no redirect.

Got it. Found user id in site cookie instead, works for me, hope will work for you as well.

UID

Thanks! I must admit, previously I was underestimating time for obtaining huge amount of followed users... I never expected someone would actually follow so many users, to be honest. Time for obtaining such amount in old way(prior to 2.46) must took almost 3 minutes(screenshot). зображення

Good thing that it's in the past now! With parallel requests, it takes less than 7 seconds!) зображення зображення

Made a new release update on github(2.46.1), please check if it works for you.

While then, I will try to minimize time for awaiting of coloring arts for error cases, when there is stored data in localStorage, and release another update soon.

drakom88 commented 3 years ago

Amazing! Works almost immediately for me now, and I'm on low quality WIFI at the moment. You are the best. Thank you, thank you, thank you!

NightLancer commented 3 years ago

Ohh, glad to hear that all is working at last! While opening the notification, I was like "Don't it dare to be a third one-sided bug!", and it was a relief to see that all is working now)

Yes, I was surprised not so less then you, when sent near 100 requests to pixiv and got a such quick successful replies for all of them! I was supposing I'll be banned by DOS-filter, but their site seems pretty strong, since they allowing me to do so many requests at ones.

Thank you too for the quick feedback.