Posted 4 months ago · Author
Code
import asyncio
import requests
from requests import Request, Session
from xml.etree import ElementTree as ET
from colorama import Fore, Style, init

# Initialize colorama
init(autoreset=True)

async def get_id_async(username):
    # Construct the XML payload
    data = f"""
    <?xml version="1.0"?>
    <methodCall>
    <methodName>gateway.getUserIdForAvatarName</methodName>
    <params>
    <param>
    <value>
    <string>{username}</string>
    </value>
    </param>
    </params>
    </methodCall>"""

    # Target URL
    url = "http://secure.imvu.com/catalog/skudb/gateway.php?"

    # Headers for the request
    headers = {
        "Content-Type": "application/xml",
        "Accept": "application/xml"
    }

    try:
        # Perform the HTTP POST request
        with Session() as session:
            request = Request('POST', url, data=data.encode('utf-8'), headers=headers)
            prepped = session.prepare_request(request)
            response = session.send(prepped)

            # Check the HTTP status code
            if response.status_code == 200:
                # Parse the XML response to find the <int> tag
                root = ET.fromstring(response.text)
                id_element = root.find('.//int')
                if id_element is not None:
                    user_id = id_element.text
                    # Print the extracted User ID in green color
                    print(f"Extracted User ID: {Fore.GREEN}{user_id}{Style.RESET_ALL}")
                else:
                    print("ID not found in the response")
            else:
                print(f"Error: {response.reason} (Status Code: {response.status_code})")
    except Exception as e:
        print(f"An error occurred: {e}")

    return 0

async def main():
    # Prompt for the username input
    username = input("Put the username to convert to CID here: ")
    await get_id_async(username)

if __name__ == "__main__":
    asyncio.run(main())

Easy code to get someone's CID.

-- Sat Jun 08, 2024 4:56 pm --

P.S. Not working for deleted/disabled accounts