MCPcopy Create free account
hub / github.com/TechifyBots/File-Stream-Bot / get_shortlink

Function get_shortlink

biisal/bot/plugins/stream.py:28–34  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

26 return random_chars
27
28def get_shortlink(url):
29 rget = requests.get(f"https://{Var.SHORTLINK_URL}/api?api={Var.SHORTLINK_API}&url={url}&alias={generate_random_alphanumeric()}")
30 rjson = rget.json()
31 if rjson["status"] == "success" or rget.status_code == 200:
32 return rjson["shortenedUrl"]
33 else:
34 return url
35
36MY_PASS = os.environ.get("MY_PASS", None)
37pass_dict = {}

Callers 2

private_receive_handlerFunction · 0.85
channel_receive_handlerFunction · 0.85

Calls 1

Tested by

no test coverage detected