import urllib.request
import json

from bs4 import BeautifulSoup

def get_ip(proxy_url=None):
    import subprocess
    import sys
    try:
        from curl_cffi import requests
        session = requests.Session()
        proxies = {"http": proxy_url, "https": proxy_url} if proxy_url else None
        resp = session.get("http://httpbin.org/ip", proxies=proxies, impersonate="chrome")
        return resp.json()["origin"]
    except Exception as e:
        return f"Error: {e}"

print("Direct IP:", get_ip())

