From 11f239840b07b151a851656082bd8b3587d0f548 Mon Sep 17 00:00:00 2001 From: Andrew Udvare Date: Sat, 20 Oct 2018 22:03:52 -0400 Subject: [PATCH] [Minds] Ignore invalid thumbnails --- youtube_dl/extractor/minds.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/minds.py b/youtube_dl/extractor/minds.py index ca885d40f..73c3792d3 100644 --- a/youtube_dl/extractor/minds.py +++ b/youtube_dl/extractor/minds.py @@ -75,7 +75,8 @@ class MindsIE(InfoExtractor): if thumbnail_api_url: req = sanitized_Request(thumbnail_api_url, method='HEAD') res = self._request_webpage(req, video_id) - thumbnail = getattr(res, 'url', None) + if res.headers.get('content-type', '').startswith('image/'): + thumbnail = getattr(res, 'url', None) tags = data.get('tags', '').strip() if isinstance(tags, compat_str): tags = [x.strip() for x in tags.split(',')]