diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-18 16:07:21 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-18 16:07:21 +0100 |
commit | 4e9c8f7ab1269966a9eac9e1b6363f5458f9f970 (patch) | |
tree | 82f54383c4f5a341ff43c06bb51e6309987c22ad /module/plugins/hoster/PremiumTo.py | |
parent | Update account plugins (diff) | |
download | pyload-4e9c8f7ab1269966a9eac9e1b6363f5458f9f970.tar.xz |
Update checkFile routine in some hoster plugins
Diffstat (limited to 'module/plugins/hoster/PremiumTo.py')
-rw-r--r-- | module/plugins/hoster/PremiumTo.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py index 6c94b3fa9..cb880d6c1 100644 --- a/module/plugins/hoster/PremiumTo.py +++ b/module/plugins/hoster/PremiumTo.py @@ -13,7 +13,7 @@ from module.utils import fs_encode class PremiumTo(SimpleHoster): __name__ = "PremiumTo" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'https?://(?:www\.)?premium\.to/.*' @@ -47,6 +47,8 @@ class PremiumTo(SimpleHoster): def checkFile(self): + super(PremiumTo, self).checkFile() + check = self.checkDownload({"nopremium": "No premium account available"}) if check == "nopremium": @@ -56,13 +58,9 @@ class PremiumTo(SimpleHoster): if self.req.http.code == '420': # Custom error code send - fail lastDownload = fs_encode(self.lastDownload) - - if exists(lastDownload): - with open(lastDownload, "rb") as f: - err = f.read(256).strip() - remove(lastDownload) - else: - err = _('File does not exist') + with open(lastDownload, "rb") as f: + err = f.read(256).strip() + remove(lastDownload) trb = self.getTraffic() self.logInfo(_("Filesize: %d, Traffic used %d, traffic left %d") % (self.pyfile.size, tra - trb, trb)) |