from app import get_component_data import httpx import huggingface_hub import asyncio import argparse spaces = huggingface_hub.list_spaces(filter="gradio-custom-component") spaces = list(spaces) spaces += list(huggingface_hub.list_spaces(filter="gradio custom component")) client = httpx.AsyncClient() async def main(url="http://127.0.0.1:7860"): for space in spaces: data = await get_component_data(space.id) req = await client.post(f"{url}/component", json=data) print(space.id, req.status_code) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--url", default="http://127.0.0.1:7860") args = parser.parse_args() asyncio.run(main(args.url))