replace 'client_id' error with simple 'wrong username and / or password' message, asking for correct username and / or password add pcgw_page script to download PCGamingWiki page (source code only), not yet enabled in main script generate steam_emu.ini for CODEX and RUNE versions, update gse_generate_interfaces
24 lines
1012 B
Python
24 lines
1012 B
Python
import os
|
|
import urllib.request
|
|
|
|
# download PCGamingWiki page source code only
|
|
# to be parsed for additional game info, e.g. config and saved games files locations, extended developer and publisher info, etc
|
|
# not yet implemented in main script
|
|
def download_pcgw(base_out_dir : str, appid : int):
|
|
|
|
pcgw_link = f"https://www.pcgamingwiki.com/api/appid.php?appid={appid}"
|
|
|
|
if not os.path.exists(os.path.join(base_out_dir, 'steam_misc\\app_info')):
|
|
os.makedirs(os.path.join(base_out_dir, 'steam_misc\\app_info'))
|
|
|
|
with urllib.request.urlopen(pcgw_link) as f:
|
|
html = f.read().decode('utf-8')
|
|
|
|
file = os.path.join(base_out_dir, f"steam_misc\\app_info\\pcgw.tmp")
|
|
with open(file, 'w', encoding='utf-8') as f:
|
|
f.write(html)
|
|
|
|
if os.path.isfile(os.path.join(base_out_dir, 'steam_misc\\app_info\\pcgw.tmp')):
|
|
with open(os.path.join(base_out_dir, 'steam_misc\\app_info\\pcgw.tmp'), 'r', encoding='utf-8') as app_pcgw:
|
|
app_pcgw_line = app_pcgw.readlines()
|