From f477b12f4760dea53aa2d13f07c1bbcc6fd9cf35 Mon Sep 17 00:00:00 2001 From: rli99 Date: Sat, 11 Jul 2020 14:36:46 +1000 Subject: [PATCH] Add fallback for title and thumbnail --- youtube_dl/extractor/mildom.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/mildom.py b/youtube_dl/extractor/mildom.py index 3c5d42035..f93e24ede 100644 --- a/youtube_dl/extractor/mildom.py +++ b/youtube_dl/extractor/mildom.py @@ -26,11 +26,8 @@ class MildomIE(InfoExtractor): def _real_extract(self, url): channel_id, video_id = re.match(self._VALID_URL, url).groups() - webpage = self._download_webpage(url, video_id) - thumbnail = self._html_search_meta( - 'og:image', - webpage, 'thumbnail', default=None) + webpage = self._download_webpage(url, video_id) video_data = self._download_json( self._VIDEO_INFO_BASE_URL + '?v_id=%s' % video_id, video_id) playback_data = video_data['body']['playback'] @@ -39,6 +36,15 @@ class MildomIE(InfoExtractor): description = playback_data.get('video_intro') uploader = try_get(playback_data, lambda x: x['author_info']['login_name'], compat_str) title = playback_data.get('title') + if not title: + title = self._html_search_meta( + ['og:description', 'description'], + webpage, 'thumbnail', default=None) + thumbnail = playback_data.get('video_pic') + if not thumbnail: + thumbnail = self._html_search_meta( + 'og:image', + webpage, 'thumbnail', default=None) return { 'id': video_id,