init
This commit is contained in:
commit
6f668fa9e0
3 changed files with 71 additions and 0 deletions
25
get_latest_voices.py
Normal file
25
get_latest_voices.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
from urllib.request import urlopen
|
||||
from json import load, dump
|
||||
from pathlib import Path
|
||||
from urllib.parse import urlparse
|
||||
from os.path import basename
|
||||
from sys import stderr
|
||||
|
||||
manifest = load(urlopen("https://arcsidian.com/xivv/manifest.json"))
|
||||
|
||||
get = []
|
||||
|
||||
for key in manifest.keys():
|
||||
p = Path(f"share/Data/{key}")
|
||||
if p.exists():
|
||||
s = sum(f.stat().st_size for f in p.glob('**/*') if f.is_file())
|
||||
if s == manifest[key]:
|
||||
continue
|
||||
# print(f"{p} {s} != {manifest[key]}", file=stderr)
|
||||
url = f"https://xivvoices.com/npcs/{key}.zip"
|
||||
fn = f"{basename(key)}.{manifest[key]}.zip"
|
||||
print(f"{url} {fn}")
|
||||
# print(f"curl --limit-rate 3M -o 'tmp/{fn}' '{url}' && rm -rf 'share/Data/{key}' && unzip -d share/Data -P '{manifest[key]}#Arc' tmp/{fn} && rm 'tmp/{fn}'")
|
||||
|
||||
with open("share/manifest.json", "w") as f:
|
||||
dump(manifest,f,indent=2)
|
||||
Loading…
Add table
Add a link
Reference in a new issue