MCPcopy Create free account
hub / github.com/VJBots/VJ-File-Store / get_verify_shorted_link

Function get_verify_shorted_link

utils.py:15–37  ·  view source on GitHub ↗
(link)

Source from the content-addressed store, hash-verified

13VERIFIED = {}
14
15async def get_verify_shorted_link(link):
16 if SHORTLINK_URL == "api.shareus.io":
17 url = f'https://{SHORTLINK_URL}/easy_api'
18 params = {
19 "key": SHORTLINK_API,
20 "link": link,
21 }
22 try:
23 async with aiohttp.ClientSession() as session:
24 async with session.get(url, params=params, raise_for_status=True, ssl=False) as response:
25 data = await response.text()
26 return data
27 except Exception as e:
28 logger.error(e)
29 return link
30 else:
31 # response = requests.get(f"https://{SHORTLINK_URL}/api?api={SHORTLINK_API}&url={link}")
32 # data = response.json()
33 # if data["status"] == "success" or rget.status_code == 200:
34 # return data["shortenedUrl"]
35 shortzy = Shortzy(api_key=SHORTLINK_API, base_site=SHORTLINK_URL)
36 link = await shortzy.convert(link)
37 return link
38
39async def check_token(bot, userid, token):
40 user = await bot.get_users(userid)

Callers 1

get_tokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected