aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/kakao.py
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2019-11-01 12:40:41 +0100
committerRemita Amine <remitamine@gmail.com>2019-11-01 12:40:41 +0100
commite987ce4bda476a387937e4af5b46f4a412a67830 (patch)
treeaaf817fba7ca21877934f3d00b942ff51f40453a /youtube_dl/extractor/kakao.py
parentd439989215fcb1672bc2ac18d4fb6206e12c387a (diff)
downloadyoutube-dl-e987ce4bda476a387937e4af5b46f4a412a67830.tar.xz
[kakao] remove raw request and extract format total bitrate
Diffstat (limited to 'youtube_dl/extractor/kakao.py')
-rw-r--r--youtube_dl/extractor/kakao.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/youtube_dl/extractor/kakao.py b/youtube_dl/extractor/kakao.py
index 96f918b75..32935bb28 100644
--- a/youtube_dl/extractor/kakao.py
+++ b/youtube_dl/extractor/kakao.py
@@ -69,7 +69,8 @@ class KakaoIE(InfoExtractor):
'-*', 'tid', 'clipLink', 'displayTitle', 'clip', 'title',
'description', 'channelId', 'createTime', 'duration', 'playCount',
'likeCount', 'commentCount', 'tagList', 'channel', 'name',
- 'clipChapterThumbnailList', 'thumbnailUrl', 'timeInSec', 'isDefault'])
+ 'clipChapterThumbnailList', 'thumbnailUrl', 'timeInSec', 'isDefault',
+ 'videoOutputList', 'width', 'height', 'kbps', 'profile', 'label'])
}
impress = self._download_json(
@@ -81,21 +82,14 @@ class KakaoIE(InfoExtractor):
title = clip.get('title') or clip_link.get('displayTitle')
- tid = impress.get('tid', '')
-
- query.update({
- 'fields': '-*,outputList,profile,width,height,label,filesize',
- 'tid': tid,
- 'profile': 'HIGH',
- })
- raw = self._download_json(
- api_base + 'raw', display_id, 'Downloading video formats info',
- query=query, headers=player_header)
+ query['tid'] = impress.get('tid', '')
formats = []
- for fmt in raw.get('outputList', []):
+ for fmt in clip.get('videoOutputList', []):
try:
profile_name = fmt['profile']
+ if profile_name == 'AUDIO':
+ continue
query.update({
'profile': profile_name,
'fields': '-*,url',
@@ -115,7 +109,8 @@ class KakaoIE(InfoExtractor):
'width': int_or_none(fmt.get('width')),
'height': int_or_none(fmt.get('height')),
'format_note': fmt.get('label'),
- 'filesize': int_or_none(fmt.get('filesize'))
+ 'filesize': int_or_none(fmt.get('filesize')),
+ 'tbr': int_or_none(fmt.get('kbps')),
})
except KeyError:
pass