fix(youtube): remove non-shorts regex

This commit is contained in:
2025-10-21 08:50:54 +03:00
parent a83dff719f
commit 2d4a409b84

View File

@@ -13,10 +13,8 @@ static SHORTCODE_RE: OnceLock<Regex> = OnceLock::new();
fn shortcode_regex() -> &'static Regex { fn shortcode_regex() -> &'static Regex {
SHORTCODE_RE.get_or_init(|| { SHORTCODE_RE.get_or_init(|| {
Regex::new( Regex::new(r"https?://(?:www\.)?(?:youtube\.com/shorts/[A-Za-z0-9_-]+(?:\?[^\s]*)?")
r"https?://(?:www\.)?(?:youtube\.com/shorts/[A-Za-z0-9_-]+(?:\?[^\s]*)?|youtu\.be/[A-Za-z0-9_-]+(?:\?[^\s]*)?)", .expect("filed to compile regex")
)
.expect("filed to compile regex")
}) })
} }