INNER CODE UNIT · Python
create_new_config
ImranR98/apps.obtainium.imranr.dev · scripts/generate_from_url.py:131
def create_new_config():
"""Create a new app config file."""
url_input = input("Input URL to extract JSON from: ")
decoded_url = unquote(url_input)
if not is_obtainium_url(decoded_url):
print(Fore.RED + "Invalid URL. Please try again.")
return
app_config_json = extract_json_from_obtainium_url(decoded_url)
if app_config_json is None or not validate_app_config(app_config_json):
return
app_id = app_config_json["id"]
existing_files = find_existing_config_files(app_id)
if existing_files:
print(Fore.YELLOW + "A config for this app already exists:")