From 53e2accbb04a768c0c678a9005b5d56b0d4fa42f Mon Sep 17 00:00:00 2001 From: derrod Date: Thu, 1 Sep 2022 02:28:40 +0200 Subject: [PATCH] [api] Add helper to get auth URL Not currently used, may be useful in the future. --- legendary/api/egs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/legendary/api/egs.py b/legendary/api/egs.py index d575a91..6c511cf 100644 --- a/legendary/api/egs.py +++ b/legendary/api/egs.py @@ -1,6 +1,8 @@ # !/usr/bin/env python # coding: utf-8 +import urllib.parse + import requests import requests.adapters import logging @@ -53,6 +55,11 @@ class EPCAPI: else: 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): # update user-agent if version := egs_params['version']: