Skip to content

Commit

Permalink
completed after gsathya's help
Browse files Browse the repository at this point in the history
  • Loading branch information
j605 committed Dec 18, 2011
1 parent d36d547 commit d286a06
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
18 changes: 17 additions & 1 deletion list_duplicate_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import os.path
from sys import argv
import collections

extension = 'mp3'
mp3 = []
Expand All @@ -27,4 +28,19 @@ def confirm(arg, directory, files):
except:
print "error"

print len(md5sums), ' ', len(mp3)
parsed_hash = {}
md5_list = list()
for item in md5sums:
md, path = item.split(' ',1)
if md in parsed_hash:
parsed_hash[md].append(path.strip())
else:
parsed_hash[md] = [path.strip()]
md5_list.append(md)

y = collections.Counter(md5_list)
md5_duplicates = [i for i in y if y[i] > 1]

print 'Duplicates are: '
for item in md5_duplicates:
print parsed_hash[item]
7 changes: 6 additions & 1 deletion out

Large diffs are not rendered by default.

0 comments on commit d286a06

Please sign in to comment.