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

Fix fuzzy rule for Youtube thumbnails in JS #285

Merged
merged 1 commit into from
May 30, 2024
Merged

Conversation

benoit74
Copy link
Collaborator

@benoit74 benoit74 commented May 28, 2024

While fuzzy rule is working well in Python, trailing characters after the ? from the querystring are not removed in Javascript causing the fuzzy rewriting to be incorrect.

E.g. 'i.ytimg.com/vi/-KpLmsAR23I/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGHIgTyg-MA8=&rs=AOn4CLDr-FmDmP3aCsD84l48ygBmkwHg-g is transformed into i.ytimg.com.fuzzy.replayweb.page/vi/-KpLmsAR23I/thumbnail.jpgsqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGHIgTyg-MA8=&rs=AOn4CLDr-FmDmP3aCsD84l48ygBmkwHg-g instead of i.ytimg.com.fuzzy.replayweb.page/vi/-KpLmsAR23I/thumbnail.jpg

This PR fixes the situation by updating the fuzzy rules and adding a minimal test set in Javascript.

Long term solution to test all fuzzy rules in JS is described in #284

@benoit74 benoit74 self-assigned this May 28, 2024
@benoit74 benoit74 added this to the 2.0.0 milestone May 28, 2024
Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.38%. Comparing base (1cffd0a) to head (a8c5232).

Current head a8c5232 differs from pull request most recent head f946842

Please upload reports for the commit f946842 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #285      +/-   ##
==========================================
- Coverage   83.72%   83.38%   -0.35%     
==========================================
  Files          13       13              
  Lines        1223     1216       -7     
  Branches      232      230       -2     
==========================================
- Hits         1024     1014      -10     
- Misses        153      155       +2     
- Partials       46       47       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benoit74 benoit74 marked this pull request as ready for review May 28, 2024 15:36
@benoit74 benoit74 requested a review from rgaudin May 28, 2024 15:37
@rgaudin
Copy link
Member

rgaudin commented May 30, 2024

I dont think I can be of much help here but the problem description is too vague IMO.

trailing characters are not removed in Javascript

@benoit74
Copy link
Collaborator Author

Good point, I added an example in first comment.

Add JS tests for fuzzy rules (only youtube thumbnails for now)
@benoit74 benoit74 merged commit 94c6900 into main May 30, 2024
5 checks passed
@benoit74 benoit74 deleted the fix_youtube_thumbnail branch May 30, 2024 08:44
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 this pull request may close these issues.

2 participants