openzim / warc2zim

Command line tool to convert a file in the WARC format to a file in the ZIM format
https://pypi.org/project/warc2zim/
GNU General Public License v3.0
41 stars 5 forks source link

JS URL rewriting: take into account that url might be an object #287

Closed benoit74 closed 1 month ago

benoit74 commented 1 month ago

In some occasions, url passed to JS rewriting function is an object instead of a string, causing problems like https://github.com/openzim/zim-requests/issues/1011#issuecomment-2135505415

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.72%. Comparing base (94c6900) to head (2e68138).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #287 +/- ## ======================================= Coverage 83.72% 83.72% ======================================= Files 13 13 Lines 1223 1223 Branches 232 232 ======================================= Hits 1024 1024 Misses 153 153 Partials 46 46 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

benoit74 commented 1 month ago

I honestly have no idea. This comes at least from wombat, but I strongly suspect it comes from the Youtube player itself which is setting the src of the image to an object instead of a String for some reason. Tests have shown it is indeed working once converted to a String, and value is really correct, so this value is "mostly" a string (otherwise the image won't load anyway) but has not yet been converted.

I'm not totally satisfied either, but since this is also specific to one kind of reader, I propose to merge as-is for now, and we will diagnose once we are bitten again (which I suppose won't happen, but I'm well aware I might be wrong)