fix: update vimeo regex to support private video hashes (#1956) #1975
+19
−3
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.
Description
Fixes #1956
The Problem:
Private Vimeo videos use a URL format like
vimeo.com/12345/abcde(whereabcdeis the privacy hash). The previous regex only captured the numeric ID (12345) and ignored the hash. Consequently, the embed player URL was missing the required?h=hashparameter, causing private videos to fail to load.The Fix:
getEditorToolsto capture the optional hash segment (Group 2).?h={hash}to the video ID if a hash is detected.Verification
Verified the regex logic against standard Vimeo URL formats:
vimeo.com/123456→ Returns123456vimeo.com/123456/abcde→ Returns123456?h=abcde