Skip to content
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

getURLVideoID error behaviour #485

Closed
nfearnley opened this issue Sep 9, 2019 · 6 comments · Fixed by #520
Closed

getURLVideoID error behaviour #485

nfearnley opened this issue Sep 9, 2019 · 6 comments · Fixed by #520
Labels

Comments

@nfearnley
Copy link

Why does getURLVideoID() return an error instead of throwing an error? This is completely unintuitive, and is not documented.

@issue-label-bot
Copy link

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

@fent
Copy link
Owner

fent commented Sep 9, 2019

i think it used to throw before, and had people before ask why it throws, since throwing would break their node app if they hadn't wrapped it in a try/catch block.

ideally it would return null if it can't find the video id. but the error it returns are specific on why it wasn't able to find the video id: https://github.com/fent/node-ytdl-core/blob/master/lib/util.js#L272-L290

maybe it could work like

[id, err] = getUrlVideoID(url);

which is a pattern common in golang

@nfearnley
Copy link
Author

nfearnley commented Sep 9, 2019 via email

@stale
Copy link

stale bot commented Nov 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issues that were closed for inactivity label Nov 8, 2019
@fent fent added feature and removed stale Issues that were closed for inactivity labels Nov 8, 2019
@TimeForANinja
Copy link
Collaborator

<3 git blame
#121

@fent
Copy link
Owner

fent commented Nov 22, 2019

@nfearnley there's a PR for a solution to this now #520

implementation looks good to me, what do you think?

@fent fent closed this as completed in #520 Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants