webrecorder / wombat

Wombat.js client-side rewriting library
GNU Affero General Public License v3.0
81 stars 30 forks source link

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

Open benoit74 opened 3 months ago

benoit74 commented 3 months ago

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 https://github.com/webrecorder/wombat/issues/155#issuecomment-2183191941 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 commented 3 months ago

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 commented 2 months ago

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 commented 2 months ago

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.