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

Youtube player is not working when wombat is configured to not run inside a Service Worker #158

Closed
benoit74 opened this issue Jun 25, 2024 · 5 comments · Fixed by #178
Closed

Comments

@benoit74
Copy link

We have an issue in warc2zim where when I configure wombat.js to not run inside a Service Worker (isSW: false in call to _WBWombatInit), then the Youtube player is not working anymore.

Since we are not using anymore a service worker with warc2zim v2, this is however the recommended setting, as discussed in #155 (comment) and following comments.

The difference I see is that with SW mode, the player data is loaded from a URL like youtube.fuzzy.replayweb.page/youtubei/v1/player?videoId=hQXa6TkSeH0 while when SW is deactivated, the player data is loaded from a URL like www.youtube.com/youtubei/v1/player?prettyPrint=false. And for sure, we have data in the WARC / ZIM at first URL but not at second one (taking into account the fuzzy rewriting of course).

Does it ring any bells to you? Is it a problem in warc2zim? Thank you in advance!

@ikreymer
Copy link
Member

ikreymer commented Jul 5, 2024

Does it ring any bells to you? Is it a problem in warc2zim? Thank you in advance!

Hm, do you have an example ZIM? I think there maybe other rewriting issues, not sure that its related to wombat but can double check.

@benoit74
Copy link
Author

benoit74 commented Jul 8, 2024

Sure, thank you for investigating this!

I've uploaded a test WARC and corresponding ZIMs with the service worker setting set to true (player is working) and set to false (player is not working).

Sorry for not providing these files in the first place and making you context-switching ...

@benoit74
Copy link
Author

How can I help you investigate this a bit further. I'm struggling to understand what is going on here, and would definitely like to set this isSW: false setting to have proper operation overall ...

At the same time I totally understand it is far from your main concerns ... so no worries, I'm just trying to figure out a way forward.

@ikreymer
Copy link
Member

I'm pretty sure I found the issue: the convert-POST-to-get override in XHR requests was only being applied as part of the service worker-based override, so the fuzzy matching in wombatSetup that you have were not being matched, since it only works with GET requests.
This should be fixed with: https://github.com/webrecorder/wombat/tree/convert-to-get-fix-without-sw
Looks like warc2zim is already setting that to true, so should be good.
@benoit74 can you test it out with this branch to confirm?

@benoit74
Copy link
Author

@ikreymer thank you, tested successfully on our test website WARC, this works like a charm! (with isSW: false and convert_post_to_get:true, as suggested / expected)

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

Successfully merging a pull request may close this issue.

2 participants