Use nsz base
This commit is contained in:
parent
8dc804a6e8
commit
f64c87732a
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@ -20,13 +21,13 @@ for json_title in json_titles:
|
|||||||
titles.append(json_titles[json_title]["id"])
|
titles.append(json_titles[json_title]["id"])
|
||||||
print("Titles OK")
|
print("Titles OK")
|
||||||
|
|
||||||
proc_xczs = subprocess.run(
|
proc_bases = subprocess.run(
|
||||||
["rclone", "lsf", f"{remote}:xcz"],
|
["rclone", "lsf", f"{remote}:nsz/base"],
|
||||||
check=True,
|
check=True,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
)
|
)
|
||||||
xczs = proc_xczs.stdout.decode().split("\n")
|
bases = proc_bases.stdout.decode().split("\n")
|
||||||
print("XCZ OK")
|
print("Base OK")
|
||||||
|
|
||||||
proc_dlcs = subprocess.run(
|
proc_dlcs = subprocess.run(
|
||||||
["rclone", "lsf", f"{remote}:nsz/dlc"],
|
["rclone", "lsf", f"{remote}:nsz/dlc"],
|
||||||
@ -44,8 +45,20 @@ proc_updates = subprocess.run(
|
|||||||
updates = proc_updates.stdout.decode().split("\n")
|
updates = proc_updates.stdout.decode().split("\n")
|
||||||
print("Updates OK")
|
print("Updates OK")
|
||||||
|
|
||||||
for xcz in xczs:
|
|
||||||
re_id = re.search(r"\[([0-9A-F]*)\]", xcz)
|
def download(path, file):
|
||||||
|
if os.path.isfile(os.path.join(path, file)):
|
||||||
|
return
|
||||||
|
|
||||||
|
subprocess.run(
|
||||||
|
["rclone", "copy", "-P", "-v", f"{remote}:{path}/{base}", f"{path}/"],
|
||||||
|
check=True,
|
||||||
|
stdout=sys.stdout,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
for base in bases:
|
||||||
|
re_id = re.search(r"\[([0-9A-F]*)\]", base)
|
||||||
|
|
||||||
if not re_id:
|
if not re_id:
|
||||||
continue
|
continue
|
||||||
@ -57,31 +70,12 @@ for xcz in xczs:
|
|||||||
|
|
||||||
id = id[0:-4]
|
id = id[0:-4]
|
||||||
|
|
||||||
subprocess.run(
|
download("nsz/base", base)
|
||||||
["rclone", "copy", "-P", "-v", f"{remote}:xcz/{xcz}", "xcz/"],
|
|
||||||
stdout=sys.stdout,
|
|
||||||
check=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
for dlc in dlcs:
|
for dlc in dlcs:
|
||||||
if id in dlc:
|
if id in dlc:
|
||||||
subprocess.run(
|
download("nsz/dlc", dlc)
|
||||||
["rclone", "copy", "-P", "-v", f"{remote}:nsz/dlc/{dlc}", "nsz/dlc/"],
|
|
||||||
stdout=sys.stdout,
|
|
||||||
check=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
for update in updates:
|
for update in updates:
|
||||||
if id in update:
|
if id in update:
|
||||||
subprocess.run(
|
download("nsz/updates", update)
|
||||||
[
|
|
||||||
"rclone",
|
|
||||||
"copy",
|
|
||||||
"-P",
|
|
||||||
"-v",
|
|
||||||
f"{remote}:nsz/updates/{update}",
|
|
||||||
"nsz/updates/",
|
|
||||||
],
|
|
||||||
stdout=sys.stdout,
|
|
||||||
check=True,
|
|
||||||
)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user