Skip to content

Commit

Permalink
add references
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazar1ky committed May 8, 2024
1 parent 0688d4d commit 2bedbe0
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ def __init__(self):
self.console.print("[yellow bold]Epic Games Store Friends Remover")

self.console.print("[yellow]Creating Access Token...")

token = self.create_token()

auth_link, device_code = self.device_code(token)

self.console.input(f"[green bold]Verify login [/green bold][yellow](click enter to continue)[/yellow][green bold]:[/green bold] [red]{auth_link}")

data = self.device_code_verify(device_code)

if not data:
Expand All @@ -43,7 +41,7 @@ def run(self):

self.console.print(f"[green]Removed {friends_count} friends! [yellow]You can kill all sessions to reset token.")

def create_token(self):
def create_token(self): # Reference: https://github.com/MixV2/EpicResearch/blob/master/docs/auth/grant_types/client_credentials.md
headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": f"basic {self.client}",
Expand All @@ -56,12 +54,9 @@ def create_token(self):

data = response.json()

# if "errorCode" in data:
# return False, data["errorCode"], data["errorMessage"]

return data["access_token"]

def device_code(self, token):
def device_code(self, token): # Reference: https://github.com/LeleDerGrasshalmi/FortniteEndpointsDocumentation/blob/main/EpicGames/AccountService/Authentication/DeviceCode/Create.md
headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": f"bearer {token}",
Expand All @@ -73,7 +68,7 @@ def device_code(self, token):

return data["verification_uri_complete"], data["device_code"]

def device_code_verify(self, device_code):
def device_code_verify(self, device_code): # Reference: https://github.com/MixV2/EpicResearch/blob/master/docs/auth/grant_types/device_code.md
headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": f"basic {self.client}",
Expand All @@ -97,7 +92,7 @@ def device_code_verify(self, device_code):
"access_token": data["access_token"],
}

def get_friend_count(self):
def get_friend_count(self): # Reference: https://github.com/LeleDerGrasshalmi/FortniteEndpointsDocumentation/blob/main/EpicGames/FriendsService/Friends/FriendsList.md
headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": f"bearer {self.data['access_token']}",
Expand All @@ -108,7 +103,7 @@ def get_friend_count(self):
return len(data["friends"])


def delete_friends(self):
def delete_friends(self): # Reference: https://github.com/LeleDerGrasshalmi/FortniteEndpointsDocumentation/blob/main/EpicGames/FriendsService/Friends/Clear.md
headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": f"bearer {self.data['access_token']}",
Expand Down

0 comments on commit 2bedbe0

Please sign in to comment.