[instagram] default posts like_count to zero

I don't know when/why this happens and for private account reasons can't
add an example here, but i had this error out and it feels like a safe
fix to default to `0` here.
This commit is contained in:
Martin Contento
2024-03-12 15:12:07 +00:00
parent 71cf08af4b
commit c210c7a4ed

View File

@@ -165,7 +165,7 @@ class InstagramExtractor(Extractor):
data = {
"post_id" : post["pk"],
"post_shortcode": post["code"],
"likes": post.get("like_count"),
"likes": post.get("like_count", 0),
"pinned": post.get("timeline_pinned_user_ids", ()),
"date": text.parse_timestamp(post.get("taken_at")),
}