view sfv.py @ 133:0d8eabdd12ab default tip

create: write H:MM:SS timestamps, add option to fill with gaussian-blur instead of black many albums are longer than one hour so writing H:MM:SS is a necessity. if anything there will just be verbose info that isn't important for my use-case. however the gaussian-blur is simply broken. It works, and it plays locally just fine, but YouTube in particular elongates the video to fit the full width. I'm not entirely sure why it does this, but it makes it useless and ugly.
author Paper <paper@tflc.us>
date Sat, 03 Jan 2026 20:25:38 -0500
parents 2aa9614cb39a
children
line wrap: on
line source

import sys
import zlib


def crc(filename): return "%X" % (zlib.crc32(
    open(filename, "rb").read()) & 0xFFFFFFFF)


try:
    temp = sys.argv[1]
except Exception:
    print("No file specified!")
    sys.exit()

f = open(sys.argv[1])
lines = f.readlines()
f.close()

for line in lines:
    if not line[0] == ";":
        crc32 = line.strip()[-8:]
        name = line.strip()[:-8]
        if crc(name).zfill(8) == crc32:
            print(f"{name}: CRC hash match!")
        else:
            print(f"{name}: CRC hash does not match!")