Skip to content

Commit

Permalink
Add is_sensitive and is_photosensitive columns to TikTok mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Nov 29, 2024
1 parent 8e660a4 commit 2f42113
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datasources/tiktok/search_tiktok.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@ def map_item(post):
"author_followers": post.get("authorStats", {}).get("followerCount", ""),
"author_likes": post.get("authorStats", {}).get("diggCount", ""),
"author_videos": post.get("authorStats", {}).get("videoCount", ""),
"author_avatar": post.get("avatarThumb", ""),
"author_avatar": user_thumbnail,
"body": post["desc"],
"timestamp": datetime.utcfromtimestamp(int(post["createTime"])).strftime('%Y-%m-%d %H:%M:%S'),
"unix_timestamp": int(post["createTime"]),
"is_duet": "yes" if (post.get("duetInfo", {}).get("duetFromId") != "0" if post.get("duetInfo", {}) else False) else "no",
"is_ad": "yes" if post.get("isAd", False) else "no",
"is_paid_partnership": "yes" if post.get("adAuthorization") else "no",
"is_sensitive": "yes" if post.get("maskType") == 3 else "no",
"is_photosensitive": "yes" if post.get("maskType") == 4 else "no",
"music_name": post["music"]["title"],
"music_id": post["music"]["id"],
"music_url": post["music"].get("playUrl", ""),
Expand Down

0 comments on commit 2f42113

Please sign in to comment.