From 4c09a9e839ab1341cc64c20210533b09d84379f7 Mon Sep 17 00:00:00 2001
From: Stefano <l.stickell@yahoo.it>
Date: Fri, 4 Oct 2013 22:29:40 +0200
Subject: Checksum: reverted b2e7352 due to a case sensitive issue

(cherry picked from commit cef7ca82b3c4eea73ed544184c17118cb310129b)
---
 pyload/plugins/addons/Checksum.py | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

(limited to 'pyload/plugins/addons')

diff --git a/pyload/plugins/addons/Checksum.py b/pyload/plugins/addons/Checksum.py
index 908286677..081e8ac3b 100644
--- a/pyload/plugins/addons/Checksum.py
+++ b/pyload/plugins/addons/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):
-- 
cgit v1.2.3