Skip to content

Commit

Permalink
1.3.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
xMistt committed Dec 13, 2024
1 parent 6135b93 commit 8e43868
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ ___
}
}
```
## Want to compile it yourself?
If you are uneasy about running a random executable, you can compile DeviceAuthGenerator yourself by installing the requirements and pyinstaller, then you can compiile it by the command:
## Compiling:
You can compile DeviceAuthGenerator yourself by installing the requirements and pyinstaller, then you can compiile it by the command:
```
pyinstaller --onefile -i icon.ico -n DeviceAuthGenerator generator.py
```
Expand Down
21 changes: 8 additions & 13 deletions generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@
import pyperclip


__version__ = "1.2.0"
__version__ = "1.3.0"

# "Constants" ? I don't know.
SWITCH_TOKEN = "OThmN2U0MmMyZTNhNGY4NmE3NGViNDNmYmI0MWVkMzk6MGEyNDQ5YTItMDAxYS00NTFlLWFmZWMtM2U4MTI5MDFjNGQ3"
ANDROID_TOKEN = "M2Y2OWU1NmM3NjQ5NDkyYzhjYzI5ZjFhZjA4YThhMTI6YjUxZWU5Y2IxMjIzNGY1MGE2OWVmYTY3ZWY1MzgxMmU="

Expand Down Expand Up @@ -93,14 +92,15 @@ async def start(self) -> None:
)
await asyncio.sleep(3)

os.system('cls' if sys.platform.startswith('win') else 'clear')

while True:
print("Opening device code link in a new tab.")
os.system('cls' if sys.platform.startswith('win') else 'clear')

device_code = await self.create_device_code()
webbrowser.open(device_code[0], new=1)

print(f"Opening {device_code[0]} in a new tab.\n"
f"Waiting for login...")

user = await self.wait_for_device_code_completion(code=device_code[1])
device_auths = await self.create_device_auths(user)

Expand All @@ -123,7 +123,7 @@ async def start(self) -> None:
break
else:
os.system('cls' if sys.platform.startswith('win') else 'clear')
print('Closing DeviceAuthGenerator...')
print('Restarting DeviceAuthGenerator...')

await asyncio.sleep(1)

Expand Down Expand Up @@ -160,7 +160,7 @@ async def create_device_code(self) -> tuple:
return data["verification_uri_complete"], data["device_code"]

async def wait_for_device_code_completion(self, code: str) -> EpicUser:
os.system('cls' if sys.platform.startswith('win') else 'clear')
# os.system('cls' if sys.platform.startswith('win') else 'clear')

while True:
async with self.http.request(
Expand Down Expand Up @@ -249,11 +249,6 @@ async def save_device_auths(self, device_auths: dict, user: EpicUser) -> None:
with open("device_auths.json", "w") as fp:
json.dump(current, fp, sort_keys=False, indent=4)

def run(self) -> None:
loop = asyncio.get_event_loop()
loop.run_until_complete(self.start())
loop.run_forever()


gen = EpicGenerator()
gen.run()
asyncio.run(gen.start())

0 comments on commit 8e43868

Please sign in to comment.