Skip to content

Commit

Permalink
Fixes new Chrome bug. #13
Browse files Browse the repository at this point in the history
  • Loading branch information
qtchaos committed Nov 14, 2023
1 parent d0befad commit cc536a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def register(credentials):
browser = await pyppeteer.launch({
"headless": True,
"ignoreHTTPSErrors": True,
"userDataDir": "./tmp",
"userDataDir": f"{os.getcwd()}/tmp",
"args": args,
"executablePath": chromium_exec,
"autoClose": False,
Expand Down
13 changes: 6 additions & 7 deletions utilities/etc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import psutil
import sys

VERSION = "v1.3.0"
VERSION = "v1.4.0"
mega = Mega()

clear_attempts = 0

@dataclass
class Colours:
Expand All @@ -26,7 +26,7 @@ class Colours:

def clear_tmp():
"""Clears tmp folder."""

global clear_attempts
if os.path.exists("tmp"):
try:
shutil.rmtree("tmp")
Expand All @@ -37,7 +37,9 @@ def clear_tmp():
p_print(
"Failed to clear temporary files... killing previous instances.", Colours.FAIL)
kill_process(matches)

if clear_attempts >= 1:
return False
clear_attempts += 1
clear_tmp()


Expand All @@ -53,11 +55,8 @@ def check_for_updates():

def delete_default(credentials: dict):
"""Deletes the default welcome file."""

mega.login(credentials["email"], credentials["password"])
mega.destroy(mega.find(filename="Welcome to MEGA.pdf")[0])
p_print("Deleted welcome file.", Colours.OKGREEN)
return


def reinstall_tenacity(): # sourcery skip: extract-method
Expand Down

0 comments on commit cc536a3

Please sign in to comment.