fix: Correct metadata parsing for forced playback speed#3836
Open
hkzo wants to merge 1 commit into
Open
Conversation
Fix an issue where ImprovedTube.speedException() is never called due to incorrect keyword retrieval. Exclude (name|itemprop) from capture groups to fix an index mismatch for property and value. Fix missing title updates from fetched content that cause the title to remain empty or outdated. Update regex to match "title" for extracting DATA.title from the fetched content.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes metadata extraction in
ImprovedTube.playerPlaybackSpeed()when "Permanent/Forced playback speed" is enabled and the playback speed is set above 1.Video title changes were not always detected correctly because fetched metadata was parsed with a faulty regex.
Details
Fixed an issue where video title changes were not being correctly detected due to a faulty regex.
The subsequent logic expects property/value in
match[1]andmatch[2], but the current regex captures them intomatch[2]andmatch[3]. This mismatch causesif (keywords) { ImprovedTube.speedException(); }to always evaluate to false, preventing music video detection.Additionally, the code failed to extract the title from fetched content, leading to evaluations based on outdated metadata from the previous video.
Changes:
(name|itemprop)from capture groups to fix an index mismatch for property and value.<meat name="title">for extractingDATA.titlefrom the fetched content.ImprovedTube.speedException()is never triggered due to failed keyword retrieval.Environment