civitai_mirror / move_nsfw.js
anonderpling's picture
add script to move nsfw files based on civitai.info.json
4c9638a unverified
raw
history blame
404 Bytes
var fs=require('fs');
var files=JSON.parse(fs.readFileSync('civitai.info.json'));
var moves=files.filter(file=>{
return file.model.nsfw==true && file.mirror_path.indexOf('nsfw') == -1
});
moves = moves.map(file=>{
m=file.mirror_path.replace(/\\/g,'/');
m=m.replace(/models\/([^/]+)\/(.+)/g,'git mv "models/$1/$2" "models/$1/nsfw/$2"');
return m;
}).join('\n')
fs.writeFileSync('move-nsfw.sh',moves);