def __init__(self, filename, ed2k=None): # set the size and hash of the file in the request parameters self.params["size"] = os.path.getsize(filename) self.params["ed2k"] = ed2k if ed2k else ed2k.hash(filename)