This commit is contained in:
Tanner Collin 2023-10-17 13:49:24 -06:00
parent 230460c153
commit c226c3807a

View File

@ -12,6 +12,7 @@ from videohash.exceptions import FFmpegFailedToExtractFrames
hashes = set()
audio_hashes = []
delete = set()
hash_lookup = {}
filenames = [x for x in glob.glob('**', recursive=True) if os.path.isfile(x)]
@ -88,10 +89,14 @@ for filename in filenames:
if not digest: continue
hash_lookup[digest] = filename
if type(digest) == int:
for h in audio_hashes:
if bin(digest ^ h).count('1') <= 5: # TODO adjust?
delete.add(filename)
print()
print(digest, filename, 'close to', h, hash_lookup[h])
break
else: # for
audio_hashes.append(digest)