This commit is contained in:
Tanner Collin 2022-09-03 23:54:45 -06:00
parent 6730c67f7f
commit 80fd7f844b

View File

@ -26,7 +26,7 @@ filenames.sort(key=os.path.getsize, reverse=True)
print('Deduplicating by md5 hash...') print('Deduplicating by md5 hash...')
for filename in filenames: for filename in filenames:
# hash first 65536 bytes of each file first # hash first 65536 bytes of each file only
CHUNK_SIZE = 65536 CHUNK_SIZE = 65536
hasher = hashlib.md5() hasher = hashlib.md5()
@ -59,8 +59,8 @@ count = 0
total = len(filenames) total = len(filenames)
for filename in filenames: for filename in filenames:
print('Hashing file', count, '/', total, end='\r')
count += 1 count += 1
print('Hashing file', count, '/', total, end='\r')
if filename in delete: continue if filename in delete: continue
@ -85,4 +85,3 @@ print('Found', len(delete), 'total duplicate files.')
print('Deleting...') print('Deleting...')
for dupe in delete: for dupe in delete:
os.remove(dupe) os.remove(dupe)