1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-22 08:34:32 +01:00

Fix Kakao Extractor

Kakao has changed their API to return `null` for `clipChapterThumbnailList`, this change comments out the thumbnail extractor to fix the issue.
This commit is contained in:
wagwan piffting 2020-09-13 00:21:54 -05:00 committed by GitHub
parent 1f7675451c
commit 836f804256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,19 +116,19 @@ class KakaoIE(InfoExtractor):
pass pass
self._sort_formats(formats) self._sort_formats(formats)
thumbs = [] # thumbs = []
for thumb in clip.get('clipChapterThumbnailList', []): # for thumb in clip.get('clipChapterThumbnailList', []):
thumbs.append({ # thumbs.append({
'url': thumb.get('thumbnailUrl'), # 'url': thumb.get('thumbnailUrl'),
'id': compat_str(thumb.get('timeInSec')), # 'id': compat_str(thumb.get('timeInSec')),
'preference': -1 if thumb.get('isDefault') else 0 # 'preference': -1 if thumb.get('isDefault') else 0
}) # })
top_thumbnail = clip.get('thumbnailUrl') # top_thumbnail = clip.get('thumbnailUrl')
if top_thumbnail: # if top_thumbnail:
thumbs.append({ # thumbs.append({
'url': top_thumbnail, # 'url': top_thumbnail,
'preference': 10, # 'preference': 10,
}) # })
return { return {
'id': display_id, 'id': display_id,
@ -136,7 +136,7 @@ class KakaoIE(InfoExtractor):
'description': strip_or_none(clip.get('description')), 'description': strip_or_none(clip.get('description')),
'uploader': clip_link.get('channel', {}).get('name'), 'uploader': clip_link.get('channel', {}).get('name'),
'uploader_id': clip_link.get('channelId'), 'uploader_id': clip_link.get('channelId'),
'thumbnails': thumbs, # 'thumbnails': thumbs,
'timestamp': unified_timestamp(clip_link.get('createTime')), 'timestamp': unified_timestamp(clip_link.get('createTime')),
'duration': int_or_none(clip.get('duration')), 'duration': int_or_none(clip.get('duration')),
'view_count': int_or_none(clip.get('playCount')), 'view_count': int_or_none(clip.get('playCount')),