Skip to content

Commit 8e43868

Browse files
committed
1.3.0 release
1 parent 6135b93 commit 8e43868

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ ___
7171
}
7272
}
7373
```
74-
## Want to compile it yourself?
75-
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:
74+
## Compiling:
75+
You can compile DeviceAuthGenerator yourself by installing the requirements and pyinstaller, then you can compiile it by the command:
7676
```
7777
pyinstaller --onefile -i icon.ico -n DeviceAuthGenerator generator.py
7878
```

generator.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@
3737
import pyperclip
3838

3939

40-
__version__ = "1.2.0"
40+
__version__ = "1.3.0"
4141

42-
# "Constants" ? I don't know.
4342
SWITCH_TOKEN = "OThmN2U0MmMyZTNhNGY4NmE3NGViNDNmYmI0MWVkMzk6MGEyNDQ5YTItMDAxYS00NTFlLWFmZWMtM2U4MTI5MDFjNGQ3"
4443
ANDROID_TOKEN = "M2Y2OWU1NmM3NjQ5NDkyYzhjYzI5ZjFhZjA4YThhMTI6YjUxZWU5Y2IxMjIzNGY1MGE2OWVmYTY3ZWY1MzgxMmU="
4544

@@ -93,14 +92,15 @@ async def start(self) -> None:
9392
)
9493
await asyncio.sleep(3)
9594

96-
os.system('cls' if sys.platform.startswith('win') else 'clear')
97-
9895
while True:
99-
print("Opening device code link in a new tab.")
96+
os.system('cls' if sys.platform.startswith('win') else 'clear')
10097

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

101+
print(f"Opening {device_code[0]} in a new tab.\n"
102+
f"Waiting for login...")
103+
104104
user = await self.wait_for_device_code_completion(code=device_code[1])
105105
device_auths = await self.create_device_auths(user)
106106

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

128128
await asyncio.sleep(1)
129129

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

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

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

252-
def run(self) -> None:
253-
loop = asyncio.get_event_loop()
254-
loop.run_until_complete(self.start())
255-
loop.run_forever()
256-
257252

258253
gen = EpicGenerator()
259-
gen.run()
254+
asyncio.run(gen.start())

0 commit comments

Comments
 (0)