Skip to content

Commit dde0a68

Browse files
authored
Module not found handling
everyone using the py example had the module missing error, this should solve it
1 parent c373f15 commit dde0a68

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

keyauth.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,32 @@
44

55
import binascii # hex encoding
66

7-
import requests # https requests
7+
# https requests
88

99
from uuid import uuid4 # gen random guid
10-
11-
from Crypto.Cipher import AES
12-
from Crypto.Hash import SHA256
13-
from Crypto.Util.Padding import pad, unpad
14-
# aes + padding, sha256
15-
1610
import webbrowser
1711
import platform
1812
import subprocess
1913
import datetime
2014
import sys
2115
import os
2216

17+
try:
18+
from Crypto.Cipher import AES
19+
from Crypto.Hash import SHA256
20+
from Crypto.Util.Padding import pad, unpad
21+
from requests_toolbelt.adapters.fingerprint import FingerprintAdapter
22+
import requests
23+
except Exception as f:
24+
print("Exception when importing modules: " + str(f))
25+
print("installing necessary modules....")
26+
os.system("pip install pycryptodome")
27+
os.system("pip install requests_toolbelt")
28+
os.system("pip install requests")
29+
print("Modules installed!")
30+
time.sleep(1.5)
31+
exit(0)
32+
2333
from requests_toolbelt.adapters.fingerprint import FingerprintAdapter
2434

2535

0 commit comments

Comments
 (0)