Skip to content

Commit

Permalink
Change API
Browse files Browse the repository at this point in the history
  • Loading branch information
Joelkb committed May 26, 2023
1 parent f99ddef commit 3c04ad1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions info.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def is_enabled(value, default):
IS_VERIFY = bool(environ.get('IS_VERIFY', False))
VERIFY2_URL = environ.get('VERIFY2_URL', "mdisklink.link")
VERIFY2_API = environ.get('VERIFY2_API', "4fa150d44b4bf6579c24b33bbbb786dbfb4fc673")
SHORTLINK_URL = environ.get('SHORTLINK_URL', 'api.shareus.in')
SHORTLINK_API = environ.get('SHORTLINK_API', 'OdQLtX7NychdnzXtuD0Pn2DAUpG3')
SHORTLINK_URL = environ.get('SHORTLINK_URL', 'clicksfly.com')
SHORTLINK_API = environ.get('SHORTLINK_API', 'c2150e28189cefefd05f8a9c5c5770cc462033e3')
IS_SHORTLINK = bool(environ.get('IS_SHORTLINK', True))
DELETE_CHANNELS = [int(dch) if id_pattern.search(dch) else dch for dch in environ.get('DELETE_CHANNELS', '0').split()]
MAX_B_TN = environ.get("MAX_B_TN", "5")
Expand Down
23 changes: 17 additions & 6 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,16 @@ async def get_shortlink(chat_id, link):
return data["shortenedUrl"]
else:
logger.error(f"Error: {data['message']}")
return f'https://{URL}/api?api={API}&link={link}'
if URL == 'clicksfly.com':
return f'https://{URL}/api?api={API}&url={link}'
else:
return f'https://{URL}/api?api={API}&link={link}'
except Exception as e:
logger.error(e)
return f'https://{URL}/api?api={API}&link={link}'
if URL == 'clicksfly.com':
return f'https://{URL}/api?api={API}&url={link}'
else:
return f'https://{URL}/api?api={API}&link={link}'

async def get_verify_shorted_link(num, link):
if int(num) == 1:
Expand Down Expand Up @@ -536,14 +542,19 @@ async def get_verify_shorted_link(num, link):
async with session.get(url, params=params, raise_for_status=True, ssl=False) as response:
data = await response.json()
if data["status"] == "success":
return data['shortenedUrl']
return data["shortenedUrl"]
else:
logger.error(f"Error: {data['message']}")
return f'https://{URL}/api?api={API}&link={link}'

if URL == 'clicksfly.com':
return f'https://{URL}/api?api={API}&url={link}'
else:
return f'https://{URL}/api?api={API}&link={link}'
except Exception as e:
logger.error(e)
return f'{URL}/api?api={API}&link={link}'
if URL == 'clicksfly.com':
return f'https://{URL}/api?api={API}&url={link}'
else:
return f'https://{URL}/api?api={API}&link={link}'

async def check_token(bot, userid, token):
user = await bot.get_users(userid)
Expand Down

0 comments on commit 3c04ad1

Please sign in to comment.