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,12 +96,16 @@ def fetch_and_relay_post(post_url: str) -> bool:
try: try:
api = Api() api = Api()
# Fetch the specific post # Fetch user's statuses and find the matching post
post = api.pull_status(post_id) print(f"Fetching statuses for @{username} to find post {post_id}...")
if post: 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) return process_single_post(post, username)
else:
print(f"Post not found: {post_id}", file=sys.stderr) print(f"Post not found in recent statuses: {post_id}", file=sys.stderr)
return False return False
except Exception as e: except Exception as e:
print(f"Error fetching post: {e}", file=sys.stderr) print(f"Error fetching post: {e}", file=sys.stderr)