瀏覽代碼

[youtube] Fix empty description extraction (#26575) (closes #26006)

tags/2020.09.14
Daniel Peukert GitHub 3 年之前
父節點
當前提交
ea74e00b3a
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 20 次插入2 次删除
  1. +20
    -2
      youtube_dl/extractor/youtube.py

+ 20
- 2
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'):


Loading…
取消
儲存