Skip to content

Commit

Permalink
Set reaction_count in extract_likes
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-ninja committed Jul 28, 2022
1 parent c4ffccc commit 40c1e8a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions facebook_scraper/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ def extract_post_url(self) -> PartialPost:

# TODO: Remove `or 0` from this methods
def extract_likes(self) -> PartialPost:
return {
'likes': utils.find_and_search(
likes = (
utils.find_and_search(
self.element, 'footer', self.likes_regex, utils.convert_numeric_abbr
)
or self.live_data.get("like_count")
Expand All @@ -478,8 +478,10 @@ def extract_likes(self) -> PartialPost:
self.element.find(".like_def", first=True)
and utils.parse_int(self.element.find(".like_def", first=True).text)
)
or 0,
}
or 0
)

return {'likes': likes, 'reaction_count': likes}

def extract_comments(self) -> PartialPost:
return {
Expand Down

0 comments on commit 40c1e8a

Please sign in to comment.