установка и удаление модов
This commit is contained in:
parent
335faca5a2
commit
05f9126b0d
4
hlna.py
4
hlna.py
@ -496,7 +496,7 @@ def modextract(id_mod, id_game_workshop, dir_ark_mods):
|
||||
os.system(f"mv -f {dir_steam_workshop} {dir_ark_mods}")
|
||||
|
||||
modname = subprocess.check_output(
|
||||
['curl', '-s', 'https://steamcommunity.com/sharedfiles/filedetails/?id={}'.format(id_mod)]).decode('utf-8')
|
||||
['curl', '-s', f'https://steamcommunity.com/sharedfiles/filedetails/?id={id_mod}']).decode('utf-8')
|
||||
modname = re.search(r'<div class="workshopItemTitle">(.+)</div>', modname)
|
||||
modname = modname and modname.group(1)
|
||||
|
||||
@ -515,7 +515,7 @@ def modextract(id_mod, id_game_workshop, dir_ark_mods):
|
||||
modpath = b"../../../" + dir_shooter.encode() + b"/Content/Mods/" + id_mod.encode() + b'\x00'
|
||||
modpathlen = len(modpath)
|
||||
with open(f"{dir_ark_mods}.mod", "wb") as mod:
|
||||
mod.write(struct.pack('<LLL{}sL{}sL'.format(modnamelen, modpathlen), int(id_mod), 0, modnamelen, modname,
|
||||
mod.write(struct.pack(f'<LLL{modnamelen}sL{modpathlen}sL', int(id_mod), 0, modnamelen, modname,
|
||||
modpathlen, modpath, nummaps))
|
||||
for mapnum in range(nummaps):
|
||||
mapfilelen = struct.unpack_from("<L", data, pos)[0]
|
||||
|
Loading…
Reference in New Issue
Block a user