Skip to content

Commit

Permalink
Merge branch 'releases-source' of https://github.com/KernelWanderers/…
Browse files Browse the repository at this point in the history
…OCSysInfo into releases-source
  • Loading branch information
kernel-dev committed Dec 23, 2022
2 parents ccec722 + 4e052a2 commit db116c4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
debugger.toggle(True)
print("=" * 25 + " BEGIN OF DEBUG " + "=" * 25)

# Fix ANSI escape codes not being registered
# in Windows's Command Prompt.
#
# Massive thank you to CorpNewt for pointing this out.
import os
import platform

if platform.system() == "windows":
os.system("color")

# Preliminary check for internet availability.
if "--offline" not in argv:
try:
Expand Down
7 changes: 5 additions & 2 deletions src/util/ark_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ def quick_search(
except Exception as e:
if isinstance(e, requests.ConnectionError):
return
elif isinstance(e, requests.exceptions.JSONDecodeError):
elif (
isinstance(e, requests.exceptions.JSONDecodeError) and
"fr_fr" not in url
):
return quick_search(search_term, url.replace('en_us', 'fr_fr').replace('%2Fus', '%2Ffr').replace('%2Fen', '%2Ffr'))
else:
raise e
return


def get_codename(ark_url, tried=False):
Expand Down

0 comments on commit db116c4

Please sign in to comment.