Closed emyller closed 8 years ago
Great improvement, thank you.
It seems maxresdefault
is not available for all video.
https://img.youtube.com/vi/f-5wKbynvD0/maxresdefault.jpg https://img.youtube.com/vi/f-5wKbynvD0/hqdefault.jpg
Thanks for the change. :)
Sad fact. Do you think it's worthy to check HTTP status code on maxresdefault
- without downloading! - then fallback to hqdefault
?
I am not sure, if status code can be resolved without downloading whole response. If there is a way, feel free to implement it or give some information, how to do it. Downloading whole image is quite heavy solution for getting only thumbnail url.
Okay, I'll try to find/do something.
Hi How about this? http://stackoverflow.com/questions/6471275/python-script-to-see-if-a-web-page-exists-without-downloading-the-whole-page?answertab=active#tab-top
This is a way to check if status code is < 400 without downloading the whole page.
Hi again
I have found a better solution that works like this:
def checkUrl(url):
import requests
r = requests.head(url)
return int(r.status_code) < 400
Great! Can you create a pull request with this improvement?
I will as soon as i have some time. Got any ideia when a new release will be available?
As soon as the support for Django 1.9 will be added + this functionality, too.
By default, embed-video loads thumbnails from YouTube based on the following format:
'{protocol}://img.youtube.com/vi/{code}/hqdefault.jpg'
.It would be very good if I could load a higher-res thumbnail. The following string format could be used:
'{protocol}://img.youtube.com/vi/{code}/maxresdefault.jpg'
.