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
|
||||
|
||||
import requests
|
||||
import argparse
|
||||
import json
|
||||
import uuid
|
||||
import logging
|
||||
@ -272,10 +273,11 @@ def notify(sckey, status, message):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
secret = input().strip().split('#')
|
||||
secret.append('')
|
||||
cookie = secret[0]
|
||||
sckey = secret[1]
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-c', '--cookie', required=True, type=str, default='')
|
||||
parser.add_argument('-s', '--sckey', type=str, default='')
|
||||
args = parser.parse_args()
|
||||
sckey = args.sckey
|
||||
|
||||
Sign(cookie).run()
|
||||
Sign(args.cookie).run()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user