Quickly pull the highest resolution thumbnail image available for a YouTube video.
-
Install the package from pypi:
pip install django-youtube-thumbnail
-
Add "youtube_thumbnail" your INSTALLED_APPS:
INSTALLED_APPS = ( ... 'youtube_thumbnail', )
-
Use the provided template tag to get the thumbnail
{% load youtube_thumbnail %}
<img src="{% youtube_thumbnail_url 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' %}">
If you have the django cache enabled, thumbnail results will be cached to avoid unnecessary lookups.