I want to use the subtitle API. It requires an md5 hash of the first and last 64kb video file. I know how to make the md5 part, I just want to know how I can get 128 KB data.
An example API is given in Python, but unfortunately I do not understand it.
def get_hash(name):
readsize = 64 * 1024
with open(name, 'rb') as f:
size = os.path.getsize(name)
data = f.read(readsize)
f.seek(-readsize, os.SEEK_END)
data += f.read(readsize)
return hashlib.md5(data).hexdigest()
http://thesubdb.com/api/
Any help would be appreciated.
source
share