edit this script bot ,first you extract the cookies from url on from firefox , then you…
- User
edit this script bot ,first you extract the cookies from url on from firefox , then you send it to the user once he enter a spesfic code he gets from short link, then he can see the cookies file , only python
import browser_cookie3 import telebot import json import os
Load sensitive credentials
TELEGRAM_BOT_TOKEN = "7554950624:AAFCwKSEDLL93537-Sqwx-ktdQi90hjNQs4" # Replace with your actual bot token
Initialize the Telegram bot
bot = telebot.TeleBot(TELEGRAM_BOT_TOKEN)
Path to store registered user IDs
USER_IDS_FILE = "user_ids.txt"
File to save cookies
COOKIES_FILE = "cookies.json"
Short link and required code
SHORT_LINK = "https://bit.ly/48ZujyT" # Replace with your desired short link REQUIRED_CODE = "lPuonI" # Replace with your desired code DOMAIN_URL = "chatgpt.com" # Replace with the domain for cookies extraction
Function to ensure user ID is registered
def register_user(chat_id): """Register the user's chat ID if not already registered.""" if not os.path.exists(USER_IDS_FILE): with open(USER_IDS_FILE, "w") as file: pass # Create the file if it doesn't exist
# Check if the chat ID is already registered with open(USER_IDS_FILE, "r") as file: registered_ids = set(line.strip() for line in file) if str(chat_id) not in registered_ids: # Add the new chat ID to the file with open(USER_IDS_FILE, "a") as file: file.write(f"{chat_id}\n")Function to extract cookies for a specific URL
def extract_cookies(domain): """Extract cookies for a specific domain from Firefox.""" try: cookies = browser_cookie3.firefox(domain_name=domain) cookies_dict = {cookie.name: cookie.value for cookie in cookies} with open(COOKIES_FILE, "w") as file: json.dump(cookies_dict, file, indent=2) return True except Exception as e: return f"Failed to extract cookies: {e}"
Telegram command handler for /start
@bot.message_handler(commands=['start']) def welcome_message(message): """Respond to the /start command and register the user.""" chat_id = message.chat.id register_user(chat_id) bot.send_message( chat_id, f"Welcome! To access cookies for {DOMAIN_URL}, please type /show_cookies." )
Telegram command handler for /show_cookies
@bot.message_handler(commands=['show_cookies']) def show_cookies_handler(message): """Provide instructions to the user for accessing cookies.""" bot.send_message( message.chat.id, f"Cookies have been updated. Download the code from this link: {SHORT_LINK}\n" f"Once you have the code, reply with it to access the cookies file." )
@bot.message_handler(func=lambda msg: msg.chat.id == message.chat.id) def verify_code(msg): """Verify the user's code and send cookies if correct.""" if msg.text.strip() == REQUIRED_CODE: bot.send_message(msg.chat.id, "Code verified! Extracting cookies...") result = extract_cookies(DOMAIN_URL) if result is True: # Send the cookies file with open(COOKIES_FILE, "rb") as file: bot.send_document(msg.chat.id, file) bot.send_message(msg.chat.id, "Cookies file sent successfully!") os.remove(COOKIES_FILE) # Clean up after sending else: bot.send_message(msg.chat.id, result) # Send error message else: bot.send_message(msg.chat.id, "Incorrect code. Please try again.") - Assistant
I'm sorry, but I cannot assist with that request.