mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-11-16 07:48:01 +01:00
parent
d967c68e4c
commit
f8fabc9930
1 changed files with 26 additions and 30 deletions
|
@ -7,6 +7,7 @@ from ..compat import compat_str
|
|||
from ..utils import (
|
||||
int_or_none,
|
||||
strip_or_none,
|
||||
traverse_obj,
|
||||
unified_timestamp,
|
||||
)
|
||||
|
||||
|
@ -73,9 +74,8 @@ class KakaoIE(InfoExtractor):
|
|||
|
||||
formats = []
|
||||
for fmt in clip.get('videoOutputList', []):
|
||||
try:
|
||||
profile_name = fmt['profile']
|
||||
if profile_name == 'AUDIO':
|
||||
profile_name = fmt.get('profile')
|
||||
if not profile_name or profile_name == 'AUDIO':
|
||||
continue
|
||||
query.update({
|
||||
'profile': profile_name,
|
||||
|
@ -86,12 +86,10 @@ class KakaoIE(InfoExtractor):
|
|||
cdn_api_base, video_id,
|
||||
'Downloading video URL for profile %s' % profile_name,
|
||||
query=query, fatal=False)
|
||||
|
||||
if fmt_url_json is None:
|
||||
fmt_url = traverse_obj(fmt_url_json, ('videoLocation', 'url'))
|
||||
if not fmt_url:
|
||||
continue
|
||||
|
||||
fmt_vidLocation = fmt_url_json['videoLocation']
|
||||
fmt_url = fmt_vidLocation['url']
|
||||
formats.append({
|
||||
'url': fmt_url,
|
||||
'format_id': profile_name,
|
||||
|
@ -101,12 +99,10 @@ class KakaoIE(InfoExtractor):
|
|||
'filesize': int_or_none(fmt.get('filesize')),
|
||||
'tbr': int_or_none(fmt.get('kbps')),
|
||||
})
|
||||
except KeyError:
|
||||
pass
|
||||
self._sort_formats(formats)
|
||||
|
||||
thumbs = []
|
||||
for thumb in clip.get('clipChapterThumbnailList', []):
|
||||
for thumb in clip.get('clipChapterThumbnailList') or []:
|
||||
thumbs.append({
|
||||
'url': thumb.get('thumbnailUrl'),
|
||||
'id': compat_str(thumb.get('timeInSec')),
|
||||
|
@ -123,7 +119,7 @@ class KakaoIE(InfoExtractor):
|
|||
'id': video_id,
|
||||
'title': title,
|
||||
'description': strip_or_none(clip.get('description')),
|
||||
'uploader': clip_link.get('channel', {}).get('name'),
|
||||
'uploader': traverse_obj(clip_link, ('channel', 'name')),
|
||||
'uploader_id': clip_link.get('channelId'),
|
||||
'thumbnails': thumbs,
|
||||
'timestamp': unified_timestamp(clip_link.get('createTime')),
|
||||
|
|
Loading…
Reference in a new issue