Skip to content

Commit

Permalink
Made author field optional (#1099)
Browse files Browse the repository at this point in the history
Fixed issue where error is raised for some videos that are missing the "author" field
  • Loading branch information
trislee committed Feb 9, 2024
1 parent 9f2d222 commit f1e16a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TikTokApi/api/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit f1e16a0

Please sign in to comment.