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

HTTP cache? #2

Closed
Eglin opened this issue Aug 9, 2022 · 9 comments
Closed

HTTP cache? #2

Eglin opened this issue Aug 9, 2022 · 9 comments

Comments

@Eglin
Copy link

Eglin commented Aug 9, 2022

What's the /kamaji/api/pcnow/00_09_000/user/stores stuff? A local HTTP cache? Is the script useful without it? Your installation instructions don't mention generating this cache. Am I missing something obvious?

The inventor (or whatever title is appropriate) is now linking to your script with the suggestion to use it, but as far as I can tell nobody following your instructions would be able to. Was there a previous revision that pulled directly from Sony's website that "everyone else" is using?

Thanks

@MaciekBaron
Copy link
Owner

No, that's a remote location.

Could you actually explain if you're having an issue, and if so, what is the issue you're encountering? Is that a 404?

@Eglin
Copy link
Author

Eglin commented Aug 9, 2022

Hey, thanks. I just got "Search (loading)" or whatever in the searchbar indefinitely. I let it run for 15 minutes or more, but it never ended and search never became available. The alternative script finishes loading pretty quickly on the same installation. I believe I've followed your instructions to the letter and all the other changes (layout, floating headers, etc) all seem to work (nice job, that). But the critically important search feature is not working for me.

@MaciekBaron
Copy link
Owner

Thanks, I'll look into it, it's likely that the URL has changed.

@MaciekBaron
Copy link
Owner

MaciekBaron commented Aug 9, 2022

I think your API url might be different - I haven't had a chance to test this with a different account or locale, but if you open developer tools and look at XHR requests being made, the second one (to 'session') made will use the correct API call:

image

Could you have a look what it is in your app? You can open the dev tools with CTRL + SHIFT + i, then go to Network and click on the XHR tab.

(You might need to refresh the page so that it records the traffic again)

@MaciekBaron
Copy link
Owner

I figured out a hacky way to retrieve that URL automatically. I've updated the code - let me know if it works for you now.

@Eglin
Copy link
Author

Eglin commented Aug 10, 2022

Thanks very much for taking a look. I stepped through your code in the debugger and can see that the data array is being properly populated with the name/id/platform fields but then throwing an unhandled exception when trying to index into an apparently empty document.querySelectorAll(``[data-game="${id}"]``) structure.

Is it perhaps related to a 404 not found I get (even with the bone stock script shipping with the PS+ app) on startup (GET https://psnow.playstation.com/store/api/pcnow/00_09_000/container/US/en/XXXXXetc 404 - redacted because IDK if it's the URL is personal to me or not)? That error maps to something deep within vendor.js and IDK what fetches the page, but it happens between the fetch for "stores" and "psNowHome?country=blahblah." Is it possible that the data you're relying on is only present for your region?

@MaciekBaron
Copy link
Owner

Thanks for providing the extra info, this should help to figure out how to make it work for all regions. How many of those 404 errors do you get?

@Eglin
Copy link
Author

Eglin commented Aug 10, 2022

OK, sorry for sending you on a wild goose chase. HTML and Javascript are not in my wheelhouse and I don't learn as quickly as I used to. I should've just reported the issues and let you do the troubleshooting! Sorry.

Some of the titles (Strongbad 1,2,3) are missing the playable_platform element. These probably aren't available in your region. Temporary workaround of

tile.setAttribute('data-game-platform', playable_platform ? playable_platform.join('/') : 'PS3™');

suffices, though a better solution would probably not assume the malformed records were all for PS3 games.

Thanks for your great script. I'm glad to have it working for me now.

@MaciekBaron
Copy link
Owner

Nice one, thanks! I'll update the code to make sure it doesn't crash if that doesn't exist.

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

2 participants