From 2e8d2629f3dc143446dc65c912c9405323e2b0c1 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Thu, 14 Jan 2021 20:15:23 +0530 Subject: [PATCH] [tiktok] Fix for when share_info is empty (Related: https://github.com/blackjack4494/yt-dlc/pull/20) --- youtube_dlc/extractor/tiktok.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dlc/extractor/tiktok.py b/youtube_dlc/extractor/tiktok.py index 0f2b4acae..b205887a2 100644 --- a/youtube_dlc/extractor/tiktok.py +++ b/youtube_dlc/extractor/tiktok.py @@ -17,8 +17,8 @@ class TikTokBaseIE(InfoExtractor): video_info = try_get( video_data, lambda x: x['itemInfo']['itemStruct'], dict) author_info = try_get( - video_data, lambda x: x['itemInfo']['itemStruct']['author'], dict) - share_info = try_get(video_data, lambda x: x['itemInfo']['shareMeta'], dict) + video_data, lambda x: x['itemInfo']['itemStruct']['author'], dict) or {} + share_info = try_get(video_data, lambda x: x['itemInfo']['shareMeta'], dict) or {} unique_id = str_or_none(author_info.get('uniqueId')) timestamp = try_get(video_info, lambda x: int(x['createTime']), int)