From f1e16a0c4fc7bd176ec215948fcff523a0263ede Mon Sep 17 00:00:00 2001 From: Tristan Lee Date: Fri, 9 Feb 2024 09:33:18 -0600 Subject: [PATCH] Made author field optional (#1099) Fixed issue where error is raised for some videos that are missing the "author" field --- TikTokApi/api/video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TikTokApi/api/video.py b/TikTokApi/api/video.py index 9cb1f9c8..552e26c8 100644 --- a/TikTokApi/api/video.py +++ b/TikTokApi/api/video.py @@ -218,7 +218,7 @@ def __extract_from_data(self) -> None: self.create_time = datetime.fromtimestamp(timestamp) self.stats = data["stats"] - author = data["author"] + author = data.get("author") if isinstance(author, str): self.author = self.parent.user(username=author) else: