INNER CODE UNIT · Python

is_obtainium_url

ImranR98/apps.obtainium.imranr.dev · scripts/generate_from_url.py:31

def is_obtainium_url(url):
    """Check if the URL is valid."""
    return APP_URL_PREFIX in url


def extract_json_from_obtainium_url(url):
    """Extract JSON from the URL."""
    raw_json = url.split(APP_URL_PREFIX, 1)[1]
    try:
        return json.loads(raw_json)
    except json.JSONDecodeError:
        print(Fore.RED + "Invalid JSON. Please check the URL and try again.")
        return None


def validate_app_config(app_config):
    """Check that the payload contains the required keys and a valid package id."""
    if not isinstance(app_config, dict):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…