[api] Add helper to get auth URL

Not currently used, may be useful in the future.
This commit is contained in:
derrod 2022-09-01 02:28:40 +02:00
parent e111ae56fc
commit 53e2accbb0

View file

@ -1,6 +1,8 @@
# !/usr/bin/env python # !/usr/bin/env python
# coding: utf-8 # coding: utf-8
import urllib.parse
import requests import requests
import requests.adapters import requests.adapters
import logging import logging
@ -53,6 +55,11 @@ class EPCAPI:
else: else:
self.request_timeout = None self.request_timeout = None
def get_auth_url(self):
login_url = 'https://www.epicgames.com/id/login?redirectUrl='
redirect_url = f'https://www.epicgames.com/id/api/redirect?clientId={self._user_basic}&responseType=code'
return login_url + urllib.parse.quote(redirect_url)
def update_egs_params(self, egs_params): def update_egs_params(self, egs_params):
# update user-agent # update user-agent
if version := egs_params['version']: if version := egs_params['version']: