1
This commit is contained in:
parent
8bdca45ba4
commit
e23b51ba8a
26
hlna.py
26
hlna.py
@ -364,17 +364,17 @@ def modinstall(g, m):
|
|||||||
if not os.path.isdir(dir_workshop_ark):
|
if not os.path.isdir(dir_workshop_ark):
|
||||||
create_dir(dir_workshop_ark)
|
create_dir(dir_workshop_ark)
|
||||||
id_mods_ark = input("""Укажите id модов через запятую
|
id_mods_ark = input("""Укажите id модов через запятую
|
||||||
:""")
|
:""").split(",")
|
||||||
os.environ.get('mod_branch', 'Windows')
|
for id_mod in id_mods_ark:
|
||||||
os.system(f"steamcmd +login anonymous +workshop_download_item {id_game_workshop} {id_mods_ark} +quit")
|
os.system(f"steamcmd +login anonymous +workshop_download_item {id_game_workshop} {id_mod} +quit")
|
||||||
modextract(id_mods_ark, id_game_workshop)
|
modextract(int(id_mod), id_game_workshop)
|
||||||
|
|
||||||
def modextract(id_mods_ark, id_game_workshop):
|
def modextract(id_mod, id_game_workshop):
|
||||||
mod_steam_workshop = "{}/content/{}/{}".format(dir_workshop_ark, id_game_workshop, id_mods_ark)
|
mod_steam_workshop = "{}/content/{}/{}".format(dir_workshop_ark, id_game_workshop, id_mod)
|
||||||
mod_ark_mods = "{}{}".format(dir_mods_ark, id_mods_ark)
|
mod_ark_mods = "{}{}".format(dir_mods_ark, id_mod)
|
||||||
modextractdir = mod_ark_mods
|
modextractdir = mod_ark_mods
|
||||||
|
|
||||||
if id_mods_ark == "111111111":
|
if id_mod == "111111111":
|
||||||
return
|
return
|
||||||
|
|
||||||
if os.path.isfile("{}/WindowsNoEditor/mod.info".format(mod_steam_workshop)):
|
if os.path.isfile("{}/WindowsNoEditor/mod.info".format(mod_steam_workshop)):
|
||||||
@ -400,7 +400,7 @@ def modextract(id_mods_ark, id_game_workshop):
|
|||||||
if not os.path.isfile(dstfile) or os.path.getmtime(srcfile) > os.path.getmtime(dstfile):
|
if not os.path.isfile(dstfile) or os.path.getmtime(srcfile) > os.path.getmtime(dstfile):
|
||||||
shutil.copy2(srcfile, dstfile)
|
shutil.copy2(srcfile, dstfile)
|
||||||
|
|
||||||
modname = subprocess.check_output(['curl', '-s', 'https://steamcommunity.com/sharedfiles/filedetails/?id={}'.format(id_mods_ark)]).decode('utf-8')
|
modname = subprocess.check_output(['curl', '-s', 'https://steamcommunity.com/sharedfiles/filedetails/?id={}'.format(id_mod)]).decode('utf-8')
|
||||||
modname = re.search(r'<div class="workshopItemTitle">(.+)</div>', modname)
|
modname = re.search(r'<div class="workshopItemTitle">(.+)</div>', modname)
|
||||||
modname = modname and modname.group(1)
|
modname = modname and modname.group(1)
|
||||||
|
|
||||||
@ -418,11 +418,11 @@ def modextract(id_mods_ark, id_game_workshop):
|
|||||||
pos = mapnamelen + 8
|
pos = mapnamelen + 8
|
||||||
modname = (modname + mapname + "\x00").encode('utf-8')
|
modname = (modname + mapname + "\x00").encode('utf-8')
|
||||||
modnamelen = len(modname)
|
modnamelen = len(modname)
|
||||||
modpath = ("../../../" + "ShooterGame" + "/Content/Mods/" + id_mods_ark + "\x00").encode('utf-8')
|
modpath = ("../../../" + "ShooterGame" + "/Content/Mods/" + id_mod + "\x00").encode('utf-8')
|
||||||
modpathlen = len(modpath)
|
modpathlen = len(modpath)
|
||||||
print(id_mods_ark, 0, modnamelen, modname, modpathlen, modpath)
|
print(id_mod, 0, modnamelen, modname, modpathlen, modpath)
|
||||||
print(type(id_mods_ark))
|
print(type(id_mod))
|
||||||
modfile_bytes += struct.pack('<L', id_mods_ark)
|
modfile_bytes += struct.pack('<L', id_mod)
|
||||||
for _ in range(nummaps):
|
for _ in range(nummaps):
|
||||||
mapfilelen = struct.unpack_from('<L', data, offset=pos)
|
mapfilelen = struct.unpack_from('<L', data, offset=pos)
|
||||||
mapfilelen = mapfilelen[0]
|
mapfilelen = mapfilelen[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user