|
|
@ -7,6 +7,7 @@ from ..compat import compat_str
|
|
|
|
from ..utils import (
|
|
|
|
from ..utils import (
|
|
|
|
int_or_none,
|
|
|
|
int_or_none,
|
|
|
|
strip_or_none,
|
|
|
|
strip_or_none,
|
|
|
|
|
|
|
|
traverse_obj,
|
|
|
|
unified_timestamp,
|
|
|
|
unified_timestamp,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -73,40 +74,35 @@ class KakaoIE(InfoExtractor):
|
|
|
|
|
|
|
|
|
|
|
|
formats = []
|
|
|
|
formats = []
|
|
|
|
for fmt in clip.get('videoOutputList', []):
|
|
|
|
for fmt in clip.get('videoOutputList', []):
|
|
|
|
try:
|
|
|
|
profile_name = fmt.get('profile')
|
|
|
|
profile_name = fmt['profile']
|
|
|
|
if not profile_name or profile_name == 'AUDIO':
|
|
|
|
if profile_name == 'AUDIO':
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
query.update({
|
|
|
|
query.update({
|
|
|
|
'profile': profile_name,
|
|
|
|
'profile': profile_name,
|
|
|
|
'fields': '-*,url',
|
|
|
|
'fields': '-*,url',
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fmt_url_json = self._download_json(
|
|
|
|
|
|
|
|
cdn_api_base, video_id,
|
|
|
|
|
|
|
|
'Downloading video URL for profile %s' % profile_name,
|
|
|
|
|
|
|
|
query=query, fatal=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if fmt_url_json is None:
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fmt_vidLocation = fmt_url_json['videoLocation']
|
|
|
|
fmt_url_json = self._download_json(
|
|
|
|
fmt_url = fmt_vidLocation['url']
|
|
|
|
cdn_api_base, video_id,
|
|
|
|
formats.append({
|
|
|
|
'Downloading video URL for profile %s' % profile_name,
|
|
|
|
'url': fmt_url,
|
|
|
|
query=query, fatal=False)
|
|
|
|
'format_id': profile_name,
|
|
|
|
fmt_url = traverse_obj(fmt_url_json, ('videoLocation', 'url'))
|
|
|
|
'width': int_or_none(fmt.get('width')),
|
|
|
|
if not fmt_url:
|
|
|
|
'height': int_or_none(fmt.get('height')),
|
|
|
|
continue
|
|
|
|
'format_note': fmt.get('label'),
|
|
|
|
|
|
|
|
'filesize': int_or_none(fmt.get('filesize')),
|
|
|
|
formats.append({
|
|
|
|
'tbr': int_or_none(fmt.get('kbps')),
|
|
|
|
'url': fmt_url,
|
|
|
|
})
|
|
|
|
'format_id': profile_name,
|
|
|
|
except KeyError:
|
|
|
|
'width': int_or_none(fmt.get('width')),
|
|
|
|
pass
|
|
|
|
'height': int_or_none(fmt.get('height')),
|
|
|
|
|
|
|
|
'format_note': fmt.get('label'),
|
|
|
|
|
|
|
|
'filesize': int_or_none(fmt.get('filesize')),
|
|
|
|
|
|
|
|
'tbr': int_or_none(fmt.get('kbps')),
|
|
|
|
|
|
|
|
})
|
|
|
|
self._sort_formats(formats)
|
|
|
|
self._sort_formats(formats)
|
|
|
|
|
|
|
|
|
|
|
|
thumbs = []
|
|
|
|
thumbs = []
|
|
|
|
for thumb in clip.get('clipChapterThumbnailList', []):
|
|
|
|
for thumb in clip.get('clipChapterThumbnailList') or []:
|
|
|
|
thumbs.append({
|
|
|
|
thumbs.append({
|
|
|
|
'url': thumb.get('thumbnailUrl'),
|
|
|
|
'url': thumb.get('thumbnailUrl'),
|
|
|
|
'id': compat_str(thumb.get('timeInSec')),
|
|
|
|
'id': compat_str(thumb.get('timeInSec')),
|
|
|
@ -123,7 +119,7 @@ class KakaoIE(InfoExtractor):
|
|
|
|
'id': video_id,
|
|
|
|
'id': video_id,
|
|
|
|
'title': title,
|
|
|
|
'title': title,
|
|
|
|
'description': strip_or_none(clip.get('description')),
|
|
|
|
'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'),
|
|
|
|
'uploader_id': clip_link.get('channelId'),
|
|
|
|
'thumbnails': thumbs,
|
|
|
|
'thumbnails': thumbs,
|
|
|
|
'timestamp': unified_timestamp(clip_link.get('createTime')),
|
|
|
|
'timestamp': unified_timestamp(clip_link.get('createTime')),
|
|
|
|