-
Notifications
You must be signed in to change notification settings - Fork 165
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
fix: handle YouTube URLs in any format to correctly extract video ID #77
Conversation
Can you please fix the lint |
Ideally this is a few line changes. Please open a new PR without the lints |
Sure |
8795e58
to
41d1b87
Compare
Hey @SujithThirumalaisamy ,I have fixed the lint Please review |
41d1b87
to
f3fd940
Compare
next-app/app/api/streams/route.ts
Outdated
@@ -55,7 +55,7 @@ export async function POST(req: NextRequest) { | |||
); | |||
} | |||
|
|||
const extractedId = data.url.split("?v=")[1]; | |||
const extractedId = data.url.split("?v=")[1].split("&")[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail for shorterned links like https://youtu.be/dQw4w9WgXcQ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @SujithThirumalaisamy ,Thanks for pointing that out.
This should now correctly handle both standard and shortened YouTube URLs. Please test it with different URL formats and let me know if there are any other issues.
Merging this for now. Can fix if there are something more. I think of nothing |
Fixes #12 , #32 , #33
This PR adds :
parameters
,shortened links
, orembedded formats
.