• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
.var files checker v01

Plugins + Scripts .var files checker v01

Download [0 MB]

ruinousdeity

Member
Joined
Dec 20, 2022
Messages
14
Reactions
29
ruinousdeity submitted a new resource:

.var files checker v01 - var checker

View attachment 245503

Under normal circumstances, unless we decompress all our .var files or encounter errors when loading these .var files with VAM, we cannot understand whether the .var files were fully downloaded at the beginning or if the file content is actually damaged. We can use this simple script to understand if there are issues with the .var files. This script will display the current progress and the final check result list.

Let me clarify here that I am a user...

Read more about this resource...
 
Assuming anyone has concerns about the script content, here is the script. You can directly copy, check, and paste it into a text editor to generate the script:;)

# Coder: ruinousdeity
# Version: 01
import os
import glob
import argparse
import pathlib
import unicodedata
import py7zr
import zipfile
import sys
from tqdm import tqdm

def logerror(message):
print("ERROR: "+message, file=sys.stderr, flush=True)

argParser = argparse.ArgumentParser(description='Check completeness of VAR files in a given directory')
argParser.add_argument("-p", "--path", type=pathlib.Path, default='.', help="path to VAR folder")

args = argParser.parse_args()

vars = glob.glob(str(args.path) + "/**/*.var", recursive = True)
invalid_files = []

for var in tqdm(vars, desc="Checking files"):
# Normalize the file path
var = os.path.normpath(var)
var = os.path.normcase(var)

try:
with zipfile.ZipFile(var) as myzip:
pass
except zipfile.BadZipFile:
try:
with py7zr.SevenZipFile(var, mode='r') as z:
pass
except py7zr.exceptions.Bad7zFile as e:
logerror(var+": not a 7z file")
invalid_files.append(var)
except Exception as e:
logerror(var+": "+str(e))
invalid_files.append(var)
except Exception as e:
logerror(var+": "+str(e))
invalid_files.append(var)

print(f'Total invalid .var files: {len(invalid_files)}')
for file in invalid_files:
print(file)
 
is there an install instruction?
1717645713929.png
 
Back
Top Bottom