YouTube livestream embeds do not embed correctly if used with share link ( https://youtube.com/live/ )

(#5120) Bug Open: Needs triage embeds

Thread

Comment by Jiralite
JiraliteMod 1 vote 2 replies
What is that before and after supposed to represent? Before and after what?
Comment by Nsgr
Nsgr OP1 vote edited 1 reply
Before and after the fix I posted in the comments, sorry for not clarifying.
Comment by Nsgr
Nsgr OP1 vote
Thinking about the code repetitions, a for loop should actually be a better solution:
for prefix in ["/shorts/", "/v/", "/live/"] {
        if path.starts_with(prefix) {
            return path
                .strip_prefix(prefix)?
                .split('/')
                .next()
                .map(|s| s.to_owned());
        }
    }
Please let me know if I should / can PR this! :)