]> jfr.im git - yt-dlp.git/commitdiff
[tiktok] Fix for when share_info is empty
authorpukkandan <redacted>
Thu, 14 Jan 2021 14:45:23 +0000 (20:15 +0530)
committerpukkandan <redacted>
Thu, 14 Jan 2021 14:45:36 +0000 (20:15 +0530)
(Related: https://github.com/blackjack4494/yt-dlc/pull/20)

youtube_dlc/extractor/tiktok.py

index 0f2b4acae7474bc8e43794aa61034763b898918c..b205887a2f40642ee38ad01275dd027789e0f293 100644 (file)
@@ -17,8 +17,8 @@ def _extract_aweme(self, props_data, webpage, url):
         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)