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

Support Youtube thumbnail URLs #2

Open
augbog opened this issue Jul 17, 2015 · 4 comments
Open

Support Youtube thumbnail URLs #2

augbog opened this issue Jul 17, 2015 · 4 comments

Comments

@augbog
Copy link

augbog commented Jul 17, 2015

Is there a way we can have it so this module supports Youtube thumbnail URLs? Here is a relevant Stackoverflow question.

Ideally the regex would support URLs such as

https://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg

Along with the other quality thumbnails.

@tunnckoCore
Copy link
Member

Hi and thanks for this issue. I will review it in the weekend or sooner

@tunnckoCore
Copy link
Member

@augbog hm, or it's pretty easy http://regexr.com/3bdh0 like this?

haha, it's going to be more and more better than ever and than every other implementation!

^ Nope, exactly, 🐈

// thumbnails
img.youtube.com/vi/0EWbonj7f18/default.jpg
i.ytimg.com/vi_webp/WijF8aivOo8/mqdefault.webp
i1.ytimg.com/vi/G0wGs3useV8/0.jpg
img.youtube.com/vi/G0wGs3useV8/3.jpg

that are with number like /3.jpg works, but not the others like /default.jpg, so yea... I can continue in weekend.

@augbog
Copy link
Author

augbog commented Jul 17, 2015

Yup that looks about right. I'm not sure what exactly the different urls are (all the ones listed in the Stackoverflow question are ones I go off of) and it seems to work fine. The regex you use for the youtube video id should be the same though in the middle part of the url.

Here's more info on Video thumbnails if it helps!

@tunnckoCore
Copy link
Member

/cc @regexps/owners thoughts? this change (?:ytimg|youtube) seems to fixes the issue partially what more?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants