Fix one-off mode to use pull_statuses
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m57s

truthbrush doesn't have pull_status method, so fetch user's
statuses and search for the matching post ID instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-23 01:41:06 -05:00
parent b1502e65d0
commit cf234b0beb

View File

@@ -96,13 +96,17 @@ def fetch_and_relay_post(post_url: str) -> bool:
try:
api = Api()
# Fetch the specific post
post = api.pull_status(post_id)
if post:
return process_single_post(post, username)
else:
print(f"Post not found: {post_id}", file=sys.stderr)
return False
# Fetch user's statuses and find the matching post
print(f"Fetching statuses for @{username} to find post {post_id}...")
statuses = list(api.pull_statuses(username, replies=True))
for post in statuses:
if str(post.get("id", "")) == post_id:
print(f"Found post {post_id}")
return process_single_post(post, username)
print(f"Post not found in recent statuses: {post_id}", file=sys.stderr)
return False
except Exception as e:
print(f"Error fetching post: {e}", file=sys.stderr)
return False