Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Error if the youtube link is unvailable #46

Closed
Darkempire78 opened this issue Jan 15, 2021 · 3 comments
Closed

Error if the youtube link is unvailable #46

Darkempire78 opened this issue Jan 15, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Darkempire78
Copy link

video = Video.get(link, mode = ResultMode.json)
print(video)

If we give an unvailable link, it returns an error.

image

@alexmercerind alexmercerind self-assigned this Jan 15, 2021
@alexmercerind alexmercerind added the enhancement New feature or request label Jan 15, 2021
@alexmercerind
Copy link
Owner

Hi @Darkempire78 !

I've marked this issue as enhancement, because I don't see a reason behind why one is passing an "unavailable link".

You can make use of "try except" to deal with this I believe.
Should I raise some another exception according to your requirement?

What I can do on my behalf is add another fancy exception. Still you have to do "try except" stuff.
Let me know, if I misunderstood you or give me bit information like how you want it function in such case.

Greetings! 🍀

@Darkempire78
Copy link
Author

Darkempire78 commented Jan 15, 2021

Currently I use a try/except sytem, but i think that return None is better than return an error.
I use this code to check if the link exists, perhaps there is another system ?

@alexmercerind
Copy link
Owner

Hi @Darkempire78,

I hope latest commits make improvements for you.

Have a good day.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants