Spaces:
Runtime error
Runtime error
import aiohttp | |
BASE = "https://batbin.me/" | |
async def post(url: str, *args, **kwargs): | |
async with aiohttp.ClientSession() as session: | |
async with session.post(url, *args, **kwargs) as resp: | |
try: | |
data = await resp.json() | |
except Exception: | |
data = await resp.text() | |
return data | |
async def AnonyBin(text): | |
resp = await post(f"{BASE}api/v2/paste", data=text) | |
if not resp["success"]: | |
return | |
link = BASE + resp["message"] | |
return link | |