Skip to content

Commit

Permalink
Add shared user's url to post info (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ianneee authored Sep 30, 2022
1 parent a7e8ce2 commit 5a48303
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion facebook_scraper/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def make_new_post(self) -> Post:
'shared_time': None,
'shared_user_id': None,
'shared_username': None,
'shared_user_url': None,
'shared_post_url': None,
'available': None,
'comments_full': None,
Expand Down Expand Up @@ -1000,11 +1001,13 @@ def extract_share_information(self):
)
# We can re-use the existing parsers, as a one level deep recursion
shared_post = PostExtractor(raw_post, self.options, self.request)
shared_user_info = shared_post.extract_username()
return {
'shared_post_id': self.data_ft["original_content_id"],
'shared_time': shared_post.extract_time().get("time"),
'shared_user_id': self.data_ft["original_content_owner_id"],
'shared_username': shared_post.extract_username().get("username"),
'shared_username': shared_user_info.get("username"),
'shared_user_url': shared_user_info.get("user_url"),
'shared_post_url': shared_post.extract_post_url().get("post_url"),
}

Expand Down

0 comments on commit 5a48303

Please sign in to comment.