34 lines
4.4 KiB
Plaintext
34 lines
4.4 KiB
Plaintext
"""Only necessary paths selected from already fixed exact trees, plus VHS1.7.7 Range text."""
|
|
from pathlib import Path
|
|
import json,subprocess,datetime,hashlib,zipfile,ast,urllib.request
|
|
R=Path.cwd();F=R/'docs/hel-892/animate-mask-reference';rows=json.loads((F/'sources.json').read_bytes())['sources']
|
|
def now():return datetime.datetime.now(datetime.timezone.utc).isoformat()
|
|
selected={
|
|
'frontend':['pnpm-lock.yaml','src/lib/litegraph/LICENSE','src/lib/litegraph/src/LGraphNode.ts','src/lib/litegraph/src/LGraph.ts','src/lib/litegraph/src/subgraph/SubgraphNode.ts','src/lib/litegraph/src/subgraph/Subgraph.ts','src/lib/litegraph/src/subgraph/SubgraphInput.ts','src/lib/litegraph/src/subgraph/SubgraphOutput.ts','src/core/graph/subgraph/proxyWidget.ts','src/core/graph/subgraph/proxyWidgetUtils.ts','docs/adr/0001-merge-litegraph-into-frontend.md'],
|
|
'sam2':['load_model.py','sam2/sam2_video_predictor.py','sam2/sam2_image_predictor.py'],
|
|
'kjpoints':['nodes/nodes.py','web/js/point_editor.js'],
|
|
'dw':['hint_image_enchance.py','LICENSE.txt','src/custom_controlnet_aux/dwpose/LICENSE'],
|
|
'core0360':['comfy_api/latest/_io.py']}
|
|
for key,paths in selected.items():
|
|
first=next(r for r in rows if r['id']==key);tree=json.loads((F/(key+'-tree.json')).read_bytes());cache=R/('.local-evidence/mask-'+key+'-git')
|
|
for path in paths:
|
|
ent=next(e for e in tree['tree']if e['path']==path);b=subprocess.check_output(['git','-C',str(cache),'show',first['commit']+':'+path],timeout=80);assert len(b)<3000000;acq=now();h=hashlib.sha1(b'blob '+str(len(b)).encode()+b'\0'+b).hexdigest();assert h==ent['sha'];name=key+'__'+path.replace('/','__');(F/name).write_bytes(b)
|
|
e={k:v for k,v in first.items()if k not in ['prior_exact_bytes_record','reuse_from']};e.update(file=path,local_file=name,url=f"https://raw.githubusercontent.com/{first['repo']}/{first['commit']}/{path}",sha256=hashlib.sha256(b).hexdigest(),git_blob_sha1=h,acquisition_time=acq,reverified_at=now())
|
|
if key=='frontend'and path.startswith('src/lib/litegraph/'):
|
|
e['license_file']='frontend__src__lib__litegraph__LICENSE';e['applicability']='准确前端1.32.1同树内置LiteGraph必要成员与独立许可;不借162外部0.15.15'
|
|
rows.append(e);print('EXTRA',key,path,flush=True)
|
|
if key=='dw':
|
|
for e in rows:
|
|
if e['id']==key:e['license_file']='dw__LICENSE.txt';e['license_resolution']='初次猜测LICENSE缺路径,准确树实际LICENSE.txt;原missing记录保留'
|
|
(F/'sources.json').write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n')
|
|
tool=(R/'.local-evidence/fetch-avatar-skills-release.py').read_text();node=next(n for n in ast.parse(tool).body if isinstance(n,ast.ClassDef)and n.name=='Remote');import io
|
|
exec(ast.get_source_segment(tool,node))
|
|
url='https://cdn.comfy.org/kosinkadink/comfyui-videohelpersuite/1.7.7/node.zip';archive=Remote(url);paths=['__init__.py','videohelpersuite/nodes.py','videohelpersuite/load_video_nodes.py','videohelpersuite/utils.py','videohelpersuite/server.py','videohelpersuite/logger.py','videohelpersuite/documentation.py','video_formats/h264-mp4.json','web/js/VHS.core.js','web/js/videoinfo.js','requirements.txt','pyproject.toml','LICENSE'];key='vhs177'
|
|
with zipfile.ZipFile(archive)as z:
|
|
members=[dict(name=i.filename,size=i.file_size,compressed_size=i.compress_size,crc=i.CRC)for i in z.infolist()];(F/(key+'-members.json')).write_text(json.dumps(members,indent=2)+'\n')
|
|
for path in paths:
|
|
if path not in z.namelist():print('RELEASEMISSING',path,flush=True);continue
|
|
i=z.getinfo(path);assert i.file_size<3000000;b=z.read(path);acq=now();name=key+'__'+path.replace('/','__');(F/name).write_bytes(b)
|
|
rows.append(dict(id=key,repo='Kosinkadink/ComfyUI-VideoHelperSuite',file=path,local_file=name,tag='1.7.7',commit='未知:准确发布成员到Git绑定未知',tree='未知',url=url,sha256=hashlib.sha256(b).hexdigest(),git_blob_sha1='未知:发布成员非Git身份',member_crc32=i.CRC,package_sha256='unknown-not-downloaded-whole-archive',acquisition_time=acq,reverified_at=now(),license_file=key+'__LICENSE',identity_root='.',identity_key=key,applicability='本图准确VHS1.7.7必要Range成员,SHA/CRC与中央目录可核,Git/整包未知;未执行'))
|
|
(F/(key+'-range-proof.json')).write_text(json.dumps(dict(size=archive.size,head_headers=archive.headers,ranges=archive.log),indent=2)+'\n');(F/'sources.json').write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n');print('TOTAL',len(rows),flush=True)
|