Created
November 20, 2024 21:10
-
-
Save Aircraft192/42237ae7b457a0ed62e6400fdc0085d4 to your computer and use it in GitHub Desktop.
Strato Domain Checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import requests | |
import os | |
# pip3 install tqdm colorama | |
from tqdm import tqdm | |
from colorama import Fore, Style, init | |
init() | |
def print_hyperlink(domain, status): | |
url = f"https://{domain}/" | |
color = Fore.GREEN if status == "available" else Fore.RED if status == "unavailable" else Fore.YELLOW | |
return f"{color}{url}{Style.RESET_ALL}" | |
def check_domains(user_input, tlds): | |
available = [] | |
taken = [] | |
unavailable = [] | |
base_url = "https://www.strato.de/orca/domain_name_search/get_domain_status/by_domain_name/strato/DE/" | |
with tqdm(total=len(tlds), desc="Checking domains", unit="domains", ncols=100) as progress_bar: | |
for tld in tlds: | |
try: | |
domain = f"{user_input}.{tld}" | |
url = f"{base_url}{domain}" | |
try: | |
response = requests.get(url, timeout=5) | |
response.raise_for_status() | |
data = response.json() | |
status = data.get("domain_status", {}).get(domain, -1) | |
if status == 0: | |
available.append(domain) | |
elif status == 1: | |
taken.append(domain) | |
elif status == 2: | |
unavailable.append(domain) | |
else: | |
print(f"Unexpected response for {domain}: {data}") | |
except Exception as e: | |
print(f"Error checking {domain}: {e}") | |
finally: | |
progress_bar.update(1) | |
except KeyboardInterrupt: | |
exit() | |
if(len(available) > 0): | |
tqdm.write("\nAvailable domains:") | |
for domain in sorted(available): | |
tqdm.write(print_hyperlink(domain, "available")) | |
if(len(taken) > 0): | |
tqdm.write("\nTaken domains:") | |
for domain in sorted(taken): | |
tqdm.write(print_hyperlink(domain, "taken")) | |
if(len(unavailable) > 0): | |
tqdm.write("\nUnavailable domains:") | |
for domain in sorted(unavailable): | |
tqdm.write(print_hyperlink(domain, "unavailable")) | |
if __name__ == "__main__": | |
if len(sys.argv) < 2: | |
print("Usage: python script.py <USER_INPUT>") | |
sys.exit(1) | |
user_input = sys.argv[1] | |
tlds = [ | |
"de", "com", "online", "org", "info", "cloud", "store", "io", "tech", "shop", "site", "gmbh", "eu", "me", "studio", "at", "berlin", "space", "fun", "life", "academy", "accountants", "actor", "ag", "agency", "ai", "airforce", "amsterdam", "apartments", "app", "archi", "army", "art", "asia", "associates", "attorney", "auction", "band", "bar", "barcelona", "bargains", "bayern", "be", "bet", "bike", "bingo", "bio", "biz", "black", "blog", "blue", "boutique", "brussels", "build", "builders", "business", "buzz", "cab", "cafe", "camera", "camp", "capital", "cards", "care", "careers", "cash", "casino", "catering", "cc", "center", "ch", "chat", "cheap", "church", "city", "claims", "cleaning", "click", "clinic", "clothing", "club", "co", "coach", "codes", "coffee", "cologne", "com.de", "community", "company", "computer", "condos", "construction", "consulting", "contact", "contractors", "cool", "coupons", "credit", "creditcard", "cruises", "dance", "dating", "de.com", "deals", "degree", "delivery", "democrat", "dental", "dentist", "dev", "diamonds", "digital", "direct", "directory", "discount", "doctor", "dog", "domains", "earth", "education", "email", "energy", "engineer", "engineering", "enterprises", "equipment", "es", "estate", "eus", "events", "exchange", "expert", "exposed", "express", "fail", "family", "fans", "farm", "finance", "financial", "fish", "fitness", "flights", "florist", "football", "forsale", "fr", "frl", "fund", "furniture", "futbol", "fyi", "gal", "gallery", "games", "gg", "gifts", "glass", "global", "gold", "golf", "graphics", "gratis", "green", "gripe", "group", "guide", "guru", "hamburg", "haus", "healthcare", "help", "hockey", "holdings", "holiday", "hospital", "host", "house", "icu", "immo", "immobilien", "industries", "institute", "insure", "international", "investments", "irish", "ist", "istanbul", "jetzt", "jewelry", "kaufen", "kim", "kitchen", "kiwi", "koeln", "land", "lawyer", "lease", "legal", "lgbt", "lighting", "limited", "limo", "link", "live", "loans", "london", "love", "ltd", "ltda", "maison", "management", "market", "marketing", "mba", "media", "memorial", "menu", "mobi", "moda", "money", "mortgage", "movie", "name", "navy", "net", "network", "news", "ninja", "nl", "nrw", "one", "onl", "partners", "parts", "pet", "photography", "photos", "pictures", "pink", "pizza", "plumbing", "plus", "poker", "press", "pro", "productions", "promo", "properties", "pub", "recipes", "red", "rehab", "reise", "reisen", "rentals", "repair", "report", "republican", "rest", "restaurant", "reviews", "rip", "rocks", "ruhr", "run", "saarland", "sale", "salon", "sarl", "school", "schule", "scot", "services", "shiksha", "shoes", "shopping", "show", "singles", "ski", "soccer", "social", "software", "solar", "solutions", "style", "supplies", "supply", "support", "surgery", "systems", "tax", "taxi", "team", "technology", "tennis", "theater", "tienda", "tips", "tires", "to", "today", "tools", "top", "tours", "town", "toys", "training", "tube", "tv", "university", "uno", "vacations", "vegas", "ventures", "versicherung", "vet", "viajes", "video", "villas", "vin", "vision", "vlaanderen", "vote", "voto", "voyage", "watch", "website", "wine", "works", "world", "wtf", "xyz", "zone" | |
] | |
check_domains(user_input, tlds) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment