kevincox / youtube-e2l

A Firefox addon to replace YouTube embeds with links to the video.
https://addons.mozilla.org/en-US/firefox/addon/youtube-embed2link/
Apache License 2.0
4 stars 3 forks source link

Thumbnail images not working #12

Closed JoshuaJSlone closed 9 years ago

JoshuaJSlone commented 9 years ago

Seems like very recently the thumbnail images have stopped showing, instead giving what seems like an error image. The links still work correctly, though. thumberror

kevincox commented 9 years ago

Yes, version 2 of the youtube API has been turned off. The extension will need to be updated to version 3. I will start working on it when I get the chance. If anyone wants to help they can feel free.

AlexVallat commented 9 years ago

Sadly, Google appear to have added a requirement for an API key to the v3 API, even to access such basic data as a title and a thumbnail. As API keys are rather unfriendly, and inherently unsuitable for open source client side applications, you might be better off using an alternative. Luckily, youtube provide an oEmbed API, which is good enough. The only thing you lose is the different qualities of thumbnail to pick from.

I've created a pull request with these changes - I've only done very limited testing, though.

If you can't live without thumbnail qualities, you could simply ignore the API provided thumbnail and fetch https://i.ytimg.com/vi/{VIDEO_ID}/{QUALITY}default.jpg where {QUALITY} is one of "", "mq", "hq", "sd", or "maxres", but who knows whether that might change in the future.

kevincox commented 9 years ago

Having the API key is not a problem, as Google provides "Browser Keys" that they know will not be kept secret. I am working on a version using v3 right now. I should have a test package up soon.

kevincox commented 9 years ago

Could you give this executable a try and see if it works for you? If it does I'll reaease it to AMO.

https://addons.mozilla.org/en-US/firefox/addon/youtube-embed2link/versions/?page=1#version-1.9.7pre

Thanks again for the patch for oEmbed but I decided it would be better to go for the officially supported API.

AlexVallat commented 9 years ago

Yes, that seems to work just fine for me, thanks. If you're happy with using an API key, then fair enough. I'll keep the oEmbed branch around a little while just in case e2l is too popular for google's liking, or the key is too public or anything - I really don't trust API keys!

AlexVallat commented 9 years ago

Oh, just to mention, I tested on Firefox 38 on Desktop and 37 on Andriod. The AMO listing states that it only works up to version 30.0a1 of Firefox for Android, but I can confirm it works fine in 37, if you'd like to update the listing.

kevincox commented 9 years ago

On May 11, 2015 3:17 AM, "AlexVallat" notifications@github.com wrote:

Yes, that seems to work just fine for me, thanks.

Awesome! I'll release it tonight.

If you're happy with using an API key, then fair enough. I'll keep the oEmbed branch around a little while just in case e2l is too popular for google's liking, or the key is too public or anything - I really don't trust API keys!

Yeah, it is kinda weird to use a key that is made public. But at least Google understands what is going on so it shouldn't be a problem.

Thanks for keeping that branch around, I'll probably pull it into a branch on my repo as well. It's good to have the fallback just in case.

kevincox commented 9 years ago

On May 11, 2015 3:23 AM, "AlexVallat" notifications@github.com wrote:

Oh, just to mention, I tested on Firefox 38 on Desktop and 37 on Andriod. The AMO listing states that it only works up to version 30.0a1 of Firefox for Android, but I can confirm it works fine in 37, if you'd like to update the listing.

Ok good to know. The version numbers are set by the packaging tool so sometimes they are wonky and sometimes AMO won't let me change them but I will see what I can do to get it marked as compatible.

kevincox commented 9 years ago

New version 1.8.9 has been uploaded to AMO pending review.