-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
72 lines (57 loc) · 2.06 KB
/
main.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import os
import requests
import time
import json
import fgourl
import user
import coloredlogs
import logging
userIds = os.environ["userIds"].split(",")
authKeys = os.environ["authKeys"].split(",")
secretKeys = os.environ["secretKeys"].split(",")
webhook_discord_url = os.environ["webhookDiscord"]
device_info = os.environ.get("DEVICE_INFO_SECRET")
user_agent_2 = os.environ.get("USER_AGENT_SECRET_2")
fate_region = "NA"
userNums = len(userIds)
authKeyNums = len(authKeys)
secretKeyNums = len(secretKeys)
logger = logging.getLogger("FGO Daily Login")
coloredlogs.install(fmt="%(asctime)s %(name)s %(levelname)s %(message)s")
def get_latest_verCode():
endpoint = "https://raw.githubusercontent.com/xdeadboy666x/FGO-JP-NA-VerCode-Extractor/NA/na.json"
response = requests.get(endpoint).text
response_data = json.loads(response)
return response_data["verCode"]
def get_latest_appver():
endpoint = "https://raw.githubusercontent.com/xdeadboy666x/FGO-JP-NA-VerCode-Extractor/NA/na.json"
response = requests.get(endpoint).text
response_data = json.loads(response)
return response_data["appVer"]
def main():
if userNums == authKeyNums and userNums == secretKeyNums:
fgourl.set_latest_assets()
for i in range(userNums):
try:
instance = user.user(userIds[i], authKeys[i], secretKeys[i])
time.sleep(3)
logger.info(
"\n ======================================== \n [+]Signing in... \n ======================================== "
)
time.sleep(1)
instance.topLogin_s()
time.sleep(2)
instance.topHome()
time.sleep(2)
instance.lq001()
instance.lq002()
time.sleep(2)
instance.buyBlueApple()
time.sleep(1)
instance.lq003()
time.sleep(1)
instance.drawFP()
except Exception as ex:
logger.error(ex)
if __name__ == "__main__":
main()