forked from O-Isaac/FGO-Daily-Login
-
Notifications
You must be signed in to change notification settings - Fork 32
/
main.py
72 lines (59 loc) · 2.09 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
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 = 'JP'
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/DNNDHH/FGO-VerCode-extractor/JP/VerCode.json"
response = requests.get(endpoint).text
response_data = json.loads(response)
return response_data['verCode']
def get_latest_appver():
endpoint = "https://raw.githubusercontent.com/DNNDHH/FGO-VerCode-extractor/JP/VerCode.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(1)
logger.info(f"\n {'=' * 40} \n [+] 登录账号 \n {'=' * 40} " )
instance.topLogin()
time.sleep(2)
instance.topHome()
time.sleep(0.5)
instance.lq001()
time.sleep(0.5)
instance.Present()
time.sleep(0.5)
instance.lq002()
time.sleep(2)
instance.buyBlueApple()
time.sleep(1)
instance.lq003()
time.sleep(1)
instance.LTO_Gacha()
time.sleep(1)
instance.drawFP()
except Exception as ex:
logger.error(ex)
if __name__ == "__main__":
main()