Skip to content

Fixed: ValueError: min() arg is an empty sequence #9

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion fb_graphql_scraper/facebook_graphql_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ def check_progress(self, days_limit: int = 61, display_progress:bool=True):
tmp_creation_array.append(int(creation_time))
except Exception as e: # 可以直接略過, 表示此graphql內容並非貼文
pass
# **防止空列表错误**
if not tmp_creation_array:
print("Warning: No post timestamps found. Skipping progress check.")
return False

diff_days = days_difference_from_now(
tmp_creation_array=tmp_creation_array)
if self.pre_diff_days == diff_days:
Expand Down Expand Up @@ -346,4 +351,4 @@ def requests_flow(self, doc_id:str, fb_username_or_userid:str, days_limit:int, p
"fb_username_or_userid": fb_username_or_userid,
"profile": profile_feed,
"data": final_res,
}
}