mirror of
https://github.com/derrod/legendary.git
synced 2025-01-03 04:45:28 +00:00
[cli] Load JSON if user pastes full response rather than just SID
This commit is contained in:
parent
4e539c4fd5
commit
26715695d8
|
@ -150,7 +150,12 @@ class LegendaryCLI:
|
||||||
print('If web page did not open automatically, please manually open the following URL: '
|
print('If web page did not open automatically, please manually open the following URL: '
|
||||||
'https://www.epicgames.com/id/login?redirectUrl=https://www.epicgames.com/id/api/redirect')
|
'https://www.epicgames.com/id/login?redirectUrl=https://www.epicgames.com/id/api/redirect')
|
||||||
sid = input('Please enter the "sid" value from the JSON response: ')
|
sid = input('Please enter the "sid" value from the JSON response: ')
|
||||||
sid = sid.strip().strip('"')
|
sid = sid.strip()
|
||||||
|
if sid[0] == '{':
|
||||||
|
tmp = json.loads(sid)
|
||||||
|
sid = tmp['sid']
|
||||||
|
else:
|
||||||
|
sid = sid.strip('"')
|
||||||
exchange_token = self.core.auth_sid(sid)
|
exchange_token = self.core.auth_sid(sid)
|
||||||
elif args.session_id:
|
elif args.session_id:
|
||||||
exchange_token = self.core.auth_sid(args.session_id)
|
exchange_token = self.core.auth_sid(args.session_id)
|
||||||
|
|
Loading…
Reference in a new issue