If there a way to gracefully catch errors if a user enters a video link that is marked "private"?
Example: Client user uploads a video to Vimeo and accidentally leaves that video "Private", then enters the video url in the application. The template attempts to retrieve the thumbnail (as illustrated in the docs) and throws an internal server error.
I've replaced all my calls for thumbnails with a fault-tolerant method, but it might be a good idea to handle this out of the box. For anyone else in my situation, this works for me...
@property
def thumbnail_url(self):
"""Attempt getting the thumbnail url. If this doesn't work, return a "problem" graphic"""
try:
video = detect_backend(self.link)
return video.thumbnail
except VideoDoesntExistException:
return "/static/images/video-problem.png"
If there a way to gracefully catch errors if a user enters a video link that is marked "private"?
Example: Client user uploads a video to Vimeo and accidentally leaves that video "Private", then enters the video url in the application. The template attempts to retrieve the thumbnail (as illustrated in the docs) and throws an internal server error.
I've replaced all my calls for thumbnails with a fault-tolerant method, but it might be a good idea to handle this out of the box. For anyone else in my situation, this works for me...