Coderja 1 month ago
Coderja #coding

Domain WHois

Domain WHois Another Version

import whois

def get_specific_whois_data(domain):
    try:
        whois_data = whois.whois(domain)
        data_to_extract = {
            "domain_name": domain,
            "registrar": whois_data.registrar if hasattr(whois_data, 'registrar') else "N/A",
            "expiration_date": whois_data.expiration_date[0].strftime("%Y-%m-%d") if (hasattr(whois_data, 'expiration_date') and isinstance(whois_data.expiration_date, list)) else whois_data.expiration_date.strftime("%Y-%m-%d") if (hasattr(whois_data, 'expiration_date') and whois_data.expiration_date is not None) else "N/A",
            "name_servers": ", ".join(whois_data.name_servers) if (hasattr(whois_data, 'name_servers') and isinstance(whois_data.name_servers, (list, tuple))) else "N/A"
        }
        return data_to_extract
    except whois.parser.PywhoisError:
        print(f"Error getting WHOIS for {domain}. Skipping...")
        return None

# Read domains from list.txt
with open("list.txt", "r") as file:
    domains = [line.strip() for line in file]

# Process domains and update files
processed_domains = []
for domain in domains:
    result = get_specific_whois_data(domain)
    if result:
        with open("results.txt", "a") as file:
            file.write(f"{result['domain_name']}, {result['registrar']}, {result['expiration_date']}, {result['name_servers']}\n")
        processed_domains.append(domain)
    
    # Remove processed domains from list.txt
    with open("list.txt", "w") as file:
        for remaining_domain in set(domains) - set(processed_domains):
            file.write(remaining_domain + "\n")

print("WHOIS lookup completed.")

Bulk Rename File by Powershell

Bulk Rename File by Powershell

defaultuser.png
Coderja
1 month ago
Wordpress adduser PHP script

Wordpress adduser PHP script

defaultuser.png
Coderja
1 month ago
Reverse Complex String Using Regex

Reverse Complex String Using Regex

defaultuser.png
Coderja
1 month ago
Logs Cleaner

Logs Cleaner

defaultuser.png
Coderja
1 month ago
Cara Merender dan menambahkan logo pake FFmpeg

Cara Merender dan menambahkan logo pake FFmpeg

defaultuser.png
Coderja
3 weeks ago