print json, nicely ask mib ismath to give me real api

This commit is contained in:
Shihaam Abdul Rahman 2025-01-10 05:48:44 +05:00
parent e0684cb11e
commit 03ee1dec32
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

View File

@ -4,13 +4,14 @@ from urllib.parse import urlencode
from bs4 import BeautifulSoup
import requests
from dotenv import load_dotenv
import json
class MIBLogin:
def __init__(self):
self.session = requests.Session()
self.base_url = "https://faisanet.mib.com.mv"
self.headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36",
"User-Agent": "Mozilla/5.0 (give-api) ismath-owes-me-real-api/give-real-api AppleWebKit/537.36 (KHTML, like Gecko) Safari/537.36",
"Accept": "*/*"
}
@ -48,8 +49,9 @@ def main():
mib = MIBLogin()
mib.login(os.getenv('USERNAME'), os.getenv('PASSWORD'))
cookies = mib.auth_2fa(os.getenv('TOTP_SEED'))
for name in ['IBSID', 'ql_0']:
print(f"{name}={cookies.get(name, '')}")
# Print the cookies in JSON format
print(json.dumps(cookies, indent=4))
if __name__ == "__main__":
main()