From 5857d3e972519d738c1a959d582535fd17ed05a3 Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Fri, 23 Jan 2026 02:37:25 -0500 Subject: [PATCH] Use custom Firefox user agent to avoid Cloudflare blocking Monkey-patch truthbrush.api.USER_AGENT with Firefox 147 UA string. Co-Authored-By: Claude Opus 4.5 --- src/poller.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/poller.py b/src/poller.py index 11c4db2..b99ee62 100644 --- a/src/poller.py +++ b/src/poller.py @@ -7,8 +7,14 @@ import tempfile import time from typing import Optional +import truthbrush.api from truthbrush import Api +# Override the default user agent to avoid Cloudflare blocking +truthbrush.api.USER_AGENT = ( + "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0" +) + from .database import init_db, is_post_seen, mark_post_seen from .discord import send_post_to_discord from .media import process_media