This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 134
/
main.py
65 lines (51 loc) · 1.75 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
import os
import requests
import time
import json
import fgourl
import user
import coloredlogs
import logging
# Enviroments Variables
userIds = os.environ['userIds'].split(',')
authKeys = os.environ['authKeys'].split(',')
secretKeys = os.environ['secretKeys'].split(',')
fate_region = os.environ['fateRegion']
webhook_discord_url = os.environ['webhookDiscord']
UA = os.environ['UserAgent']
if UA != 'nullvalue':
fgourl.user_agent_ = UA
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 = ""
if fate_region == "NA":
endpoint += "https://raw.githubusercontent.com/O-Isaac/FGO-VerCode-extractor/NA/VerCode.json"
else:
endpoint += "https://raw.githubusercontent.com/O-Isaac/FGO-VerCode-extractor/JP/VerCode.json"
response = requests.get(endpoint).text
response_data = json.loads(response)
return response_data['verCode']
def main():
if userNums == authKeyNums and userNums == secretKeyNums:
logger.info('Getting Lastest Assets Info')
fgourl.set_latest_assets()
for i in range(userNums):
try:
instance = user.user(userIds[i], authKeys[i], secretKeys[i])
time.sleep(3)
logger.info('Loggin into account!')
instance.topLogin()
time.sleep(2)
instance.topHome()
time.sleep(2)
logger.info('Throw daily friend summon!')
instance.drawFP()
time.sleep(2)
except Exception as ex:
logger.error(ex)
if __name__ == "__main__":
main()