-
Notifications
You must be signed in to change notification settings - Fork 822
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
Fixed URL decection #984
Fixed URL decection #984
Conversation
Thanks for the PR! Good find on the first fix. |
Well, I cannot really think of any where it would break something, but it makes it behave like YouTube or Discord embeds would be handling it. |
Well then, the PR looks fine to merge. |
would be cool if you could add test cases for these 2 scenarios so that we don't break it again in the future else i can do it 😉 |
I think I added the tests, and hopefully correctly. I also fixed bug I introduced by the first commit. Check if everything is OK 😀 |
your new version failed with links like |
Sure. I am glad I could at least help with this. |
nice 👍 |
🎉 This PR is included in version 4.9.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hello, I noticed two bugs in URL detection and decided to fix them.
The first one was causing
validateURL
to betrue
with links like:https://youtubedcom/v/SBjQ9tuuTJQ
orhttp://www.youtube com/embed/SBjQ9tuuTJQ
. (Basically allowing any character between "youtube" and "com".)And the second one made
getURLVideoID
return different id than YouTube would use in links like:https://youtube.com/v/SBjQ9tuuTJQ/dQw4w9WgXcQ
orhttps://youtube.com/SBjQ9tuuTJQ/somethink/somethink/dQw4w9WgXcQ
. (Basically YouTube uses the first string after/v/
and ytdl was using the one after last/
.)I hope I made everything clear and actually helped instead of causing some problems. 😀