aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Peukert <dan.peukert@gmail.com>2020-09-13 16:23:21 +0200
committerGitHub <noreply@github.com>2020-09-13 21:23:21 +0700
commitea74e00b3afe604531419c17eb7291038115a271 (patch)
treef57f1fa8c1bd9d2f80b117e909573dcc44c897dd
parent06cd4cdb252a45da25ed75ea63b714bc3b9d691b (diff)
[youtube] Fix empty description extraction (#26575) (closes #26006)
-rw-r--r--youtube_dl/extractor/youtube.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 6ae2e58c1..02f3ab61a 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1264,7 +1264,23 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
'params': {
'skip_download': True,
},
- }
+ },
+ {
+ # empty description results in an empty string
+ 'url': 'https://www.youtube.com/watch?v=x41yOUIvK2k',
+ 'info_dict': {
+ 'id': 'x41yOUIvK2k',
+ 'ext': 'mp4',
+ 'title': 'IMG 3456',
+ 'description': '',
+ 'upload_date': '20170613',
+ 'uploader_id': 'ElevageOrVert',
+ 'uploader': 'ElevageOrVert',
+ },
+ 'params': {
+ 'skip_download': True,
+ },
+ },
]
def __init__(self, *args, **kwargs):
@@ -1931,7 +1947,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
''', replace_url, video_description)
video_description = clean_html(video_description)
else:
- video_description = video_details.get('shortDescription') or self._html_search_meta('description', video_webpage)
+ video_description = video_details.get('shortDescription')
+ if video_description is None:
+ video_description = self._html_search_meta('description', video_webpage)
if not smuggled_data.get('force_singlefeed', False):
if not self._downloader.params.get('noplaylist'):