-
Notifications
You must be signed in to change notification settings - Fork 1
/
accountsetup.py
53 lines (42 loc) · 1.63 KB
/
accountsetup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import os
import json
# Function to save account details to a JSON file
def save_account_to_file(data, filename):
with open(filename, 'w') as file:
json.dump(data, file, indent=4)
print(f"Account saved in {filename}.")
# Function to check if a filename exists, and create new numbered files if needed
def get_available_filename(base_name="account", max_accounts=15):
for i in range(1, max_accounts + 1):
filename = f"{base_name}{i}.json"
if not os.path.exists(filename):
return filename
return None
def account_setup():
# Prompt for Apple ID
apple_id = input("Enter your Apple ID: ")
# Prompt for Password
password = input("Enter your Password: ")
# Prompt for 2FA
two_factor = input("Do you have Two-Factor Authentication enabled? (yes/no): ").strip().lower()
# Validation for 2FA input
if two_factor not in ['yes', 'no']:
print("Invalid input. Please answer with 'yes' or 'no'.")
return account_setup()
# Prompt for App Store Country
app_store_country = input("What is the App Store country (ex. US, UK): ").strip().upper()
# Prepare account data
account_data = {
"Apple ID": apple_id,
"Password": password, # Password stored in plain text
"2FA Enabled": two_factor.capitalize(),
"App Store Country": app_store_country
}
# Check for an available filename
filename = get_available_filename()
if filename:
save_account_to_file(account_data, filename)
else:
print("Account limit reached. You can only save up to 15 accounts.")
if __name__ == "__main__":
account_setup()