print json, nicely ask mib ismath to give me real api
This commit is contained in:
parent
e0684cb11e
commit
03ee1dec32
@ -4,13 +4,14 @@ from urllib.parse import urlencode
|
|||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
import requests
|
import requests
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
import json
|
||||||
|
|
||||||
class MIBLogin:
|
class MIBLogin:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.session = requests.Session()
|
self.session = requests.Session()
|
||||||
self.base_url = "https://faisanet.mib.com.mv"
|
self.base_url = "https://faisanet.mib.com.mv"
|
||||||
self.headers = {
|
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": "*/*"
|
"Accept": "*/*"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,8 +49,9 @@ def main():
|
|||||||
mib = MIBLogin()
|
mib = MIBLogin()
|
||||||
mib.login(os.getenv('USERNAME'), os.getenv('PASSWORD'))
|
mib.login(os.getenv('USERNAME'), os.getenv('PASSWORD'))
|
||||||
cookies = mib.auth_2fa(os.getenv('TOTP_SEED'))
|
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__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user