Skip to content

Commit 53e2acc

Browse files
committed
[api] Add helper to get auth URL
Not currently used, may be useful in the future.
1 parent e111ae5 commit 53e2acc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

legendary/api/egs.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# !/usr/bin/env python
22
# coding: utf-8
33

4+
import urllib.parse
5+
46
import requests
57
import requests.adapters
68
import logging
@@ -53,6 +55,11 @@ def __init__(self, lc='en', cc='US', timeout=10.0):
5355
else:
5456
self.request_timeout = None
5557

58+
def get_auth_url(self):
59+
login_url = 'https://www.epicgames.com/id/login?redirectUrl='
60+
redirect_url = f'https://www.epicgames.com/id/api/redirect?clientId={self._user_basic}&responseType=code'
61+
return login_url + urllib.parse.quote(redirect_url)
62+
5663
def update_egs_params(self, egs_params):
5764
# update user-agent
5865
if version := egs_params['version']:

0 commit comments

Comments
 (0)