From 33e55bc4d102866aff92280dffea50992d062015 Mon Sep 17 00:00:00 2001 From: Auric Vente Date: Thu, 22 Feb 2024 10:52:59 -0600 Subject: [PATCH] Mods --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 05721b3..a62966f 100644 --- a/main.py +++ b/main.py @@ -208,9 +208,11 @@ async def gif_bird(who, room_id): await run_gifmaker(command, room_id) async def random_post(ws, room_id): - threads_url = "https://a.4cdn.org/g/threads.json" + boards = ["g", "an", "ck", "lit", "x", "tv", "v", "fit", "k", "o"] + board = random.choice(boards) try: + threads_url = f"https://a.4cdn.org/{board}/threads.json" async_client = httpx.AsyncClient() threads_response = await async_client.get(threads_url) threads_response.raise_for_status() @@ -219,7 +221,7 @@ async def random_post(ws, room_id): # Select a random thread id = threads[random_int(0, len(threads) - 1)]["no"] - thread_url = f"https://a.4cdn.org/g/thread/{id}.json" + thread_url = f"https://a.4cdn.org/{board}/thread/{id}.json" # Fetch the selected thread thread_response = await async_client.get(thread_url)