From 0a5daec6812f27e68673c7ef5842f701b4ed1594 Mon Sep 17 00:00:00 2001 From: estaban Date: Tue, 4 Aug 2015 23:11:43 +0200 Subject: Download deleted because of file size mismatch One some hosters like OneFichier for example, the webpage displays a file size of 1.46GB. However the real file size can be 1.4649853GB, which makes a difference between the downloaded file size and the expected file size. size_tolerance is meant for that, but its value is currently set to 1MB. This is an issue in the above case where the difference between expected size and downloaded size is almost 10MB. In many cases, this causes the downloaded file to simply be deleted, even though it has been downloaded without any issue. The biggest possible size difference is 10MB, at least if the website displays 2 decimals and that the biggest unit is GB. Therefore I propose to change the max tolerance from 1MB to 10MB. FYI the error message in the log looks like that: Fail: File size mismatch | Expected file size: 1492501135.36 | Downloaded file size: 1488025852 --- module/plugins/internal/SimpleHoster.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 8d4100026..5c2bafe8e 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -310,9 +310,11 @@ class SimpleHoster(Hoster): self.captcha.invalid() self.retry(10, reason=_("Wrong captcha")) + # 10485760 is 10MB, tolerance is used when comparing displayed size to real size + # For example displayed size can be 1.46GB for example, but real size can be 1.4649853 elif self.check_download({'Empty file': re.compile(r'\A((.|)(\2|\s)*)\Z')}, file_size=self.info['size'] if 'size' in self.info else 0, - size_tolerance=1048576, + size_tolerance=10485760, delete=True): self.error(_("Empty file")) -- cgit v1.2.3 From 0019494ce0c844952f1acb5cd4b661e256839baa Mon Sep 17 00:00:00 2001 From: estaban Date: Tue, 4 Aug 2015 23:16:56 +0200 Subject: Update SimpleHoster.py --- module/plugins/internal/SimpleHoster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 5c2bafe8e..91d5fe4b3 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -310,8 +310,8 @@ class SimpleHoster(Hoster): self.captcha.invalid() self.retry(10, reason=_("Wrong captcha")) - # 10485760 is 10MB, tolerance is used when comparing displayed size to real size - # For example displayed size can be 1.46GB for example, but real size can be 1.4649853 + # 10485760 is 10MB, tolerance is used when comparing displayed size on the hoster website to real size + # For example displayed size can be 1.46GB for example, but real size can be 1.4649853GB elif self.check_download({'Empty file': re.compile(r'\A((.|)(\2|\s)*)\Z')}, file_size=self.info['size'] if 'size' in self.info else 0, size_tolerance=10485760, -- cgit v1.2.3