refactor: use argparse to get args
This commit is contained in:
parent
ea76e7bc26
commit
1532a06cb4
12
genshin.py
12
genshin.py
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
import argparse
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
import logging
|
import logging
|
||||||
@ -272,10 +273,11 @@ def notify(sckey, status, message):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
secret = input().strip().split('#')
|
parser = argparse.ArgumentParser()
|
||||||
secret.append('')
|
parser.add_argument('-c', '--cookie', required=True, type=str, default='')
|
||||||
cookie = secret[0]
|
parser.add_argument('-s', '--sckey', type=str, default='')
|
||||||
sckey = secret[1]
|
args = parser.parse_args()
|
||||||
|
sckey = args.sckey
|
||||||
|
|
||||||
Sign(cookie).run()
|
Sign(args.cookie).run()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user