Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 14d68ed
Showing
21 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
env | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
DVD Fingerprint | ||
=============== | ||
|
||
This is a Python implementation of the disc fingerprinting technique used by the | ||
[Discident Database](http://discident.com/). Works by traversing a directory (from a | ||
DVD drive or ripped) and creating a unique hash for that disc. | ||
|
||
# Usage | ||
|
||
Command line: | ||
|
||
$ dvdfingerprint /Volumes/DVD_VIDEO/ | ||
|
||
From your own code: | ||
|
||
import dvdfingerprint | ||
dvdfingerprint.fingerprint("/Volumes/DVD_VIDEO/") | ||
|
||
Adapted from Erik Kastner's Ruby implementation [dvd_fingerprint](https://github.com/kastner/dvd_fingerprint). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
import dvdfingerprint | ||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) == 2: | ||
print dvdfingerprint.fingerprint(sys.argv[1]) | ||
else: | ||
print "Usage: dvdfingerprint <path>" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Metadata-Version: 1.0 | ||
Name: dvdfingerprint | ||
Version: 0.1.0 | ||
Summary: DVD Fingerprint | ||
Home-page: http://discident.com | ||
Author: Michael Lavers | ||
Author-email: kolanos@gmail.com | ||
License: BSD | ||
Description: UNKNOWN | ||
Platform: UNKNOWN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
setup.py | ||
bin/dvdfingerprint | ||
dvdfingerprint/__init__.py | ||
dvdfingerprint.egg-info/PKG-INFO | ||
dvdfingerprint.egg-info/SOURCES.txt | ||
dvdfingerprint.egg-info/dependency_links.txt | ||
dvdfingerprint.egg-info/top_level.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dvdfingerprint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import hashlib | ||
import os | ||
import sys | ||
|
||
__VERSION__ = "0.1.0" | ||
|
||
|
||
def generate_hash(s): | ||
s = hashlib.md5(s).hexdigest().upper() | ||
return "-".join([s[:8], s[8:12], s[12:16], s[16:20], s[20:]]) | ||
|
||
|
||
def get_paths(root_dir): | ||
file_list = [] | ||
for root, subFolders, files in os.walk(root_dir): | ||
for file in files: | ||
f = os.path.join(root, file) | ||
s = os.path.getsize(f) | ||
f = f.replace(root_dir, '') | ||
if not f.startswith('/'): | ||
f = '/%s' % f | ||
file_list.append("%s:%d" % (f, s)) | ||
return file_list | ||
|
||
|
||
def combine_files(f): | ||
f.sort() | ||
return ":%s" % ":".join(f) | ||
|
||
|
||
def fingerprint(path): | ||
p = get_paths(path) | ||
s = combine_files(p) | ||
return generate_hash(s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
try: | ||
from setuptools import setup | ||
except ImportError: | ||
from distutils.core import setup | ||
|
||
setup( | ||
name='dvdfingerprint', | ||
description='DVD Fingerprint', | ||
author='Michael Lavers', | ||
author_email='kolanos@gmail.com', | ||
url='http://discident.com', | ||
version='0.1.0', | ||
license='BSD', | ||
install_requires=[], | ||
test_suite='', | ||
packages=['dvdfingerprint'], | ||
scripts=['bin/dvdfingerprint'] | ||
) |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.