Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shared user's url to post info #901

Merged
merged 1 commit into from
Sep 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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