src / devgagan /modules /pingme.py
remainsalways's picture
Update devgagan/modules/pingme.py
04b72f3 verified
raw
history blame contribute delete
530 Bytes
import random
import requests
import asyncio
import os
HUGGING_TOKEN = os.getenv("HF_TOKEN")
async def hfv(api_url, timeout=10):
try:
headers = {
"Authorization": f"Bearer {HUGGING_TOKEN}",
"Content-Type": "application/json",
}
response = await async_searcher(api_url, headers=headers, re_json=True)
stat = response.get("message", "ded")
return stat
except requests.exceptions.RequestException as e:
print("Error occurred:", e)
return False