diff options
Diffstat (limited to 'module/plugins/hooks')
| -rw-r--r-- | module/plugins/hooks/Checksum.py | 16 | 
1 files changed, 1 insertions, 15 deletions
| diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 908286677..081e8ac3b 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -22,7 +22,6 @@ import zlib  from os import remove  from os.path import getsize, isfile, splitext  import re -import base64  from module.utils import save_join, fs_encode  from module.plugins.Hook import Hook @@ -49,25 +48,13 @@ def computeChecksum(local_file, algorithm):          return "%x" % last -    # Special Hash used by DDLStorage.com -    # It compute the MD5 hash only on the first and the last 4096 bytes, then the hash is base64 encoded -    elif algorithm == 'md5_ddlstorage': -        h = hashlib.md5() - -        with open(local_file, 'rb') as f: -            h.update(f.read(4096)) -            f.seek(-4096, 2) -            h.update(f.read(4096)) - -        return base64.b64encode(h.digest()).rstrip('=') -      else:          return None  class Checksum(Hook):      __name__ = "Checksum" -    __version__ = "0.09" +    __version__ = "0.10"      __description__ = "Verify downloaded file size and checksum (enable in general preferences)"      __config__ = [("activated", "bool", "Activated", True),                    ("action", "fail;retry;nothing", "What to do if check fails?", "retry"), @@ -88,7 +75,6 @@ class Checksum(Hook):          self.algorithms = sorted(              getattr(hashlib, "algorithms", ("md5", "sha1", "sha224", "sha256", "sha384", "sha512")), reverse=True)          self.algorithms.extend(["crc32", "adler32"]) -        self.algorithms.append('md5_ddlstorage')          self.formats = self.algorithms + ['sfv', 'crc', 'hash']      def downloadFinished(self, pyfile): | 
