summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/PremiumTo.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/PremiumTo.py')
-rw-r--r--module/plugins/hoster/PremiumTo.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/module/plugins/hoster/PremiumTo.py b/module/plugins/hoster/PremiumTo.py
index 665005ec3..2007eefa7 100644
--- a/module/plugins/hoster/PremiumTo.py
+++ b/module/plugins/hoster/PremiumTo.py
@@ -2,7 +2,7 @@
from __future__ import with_statement
-from os import remove
+import os
from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
from module.utils import fs_encode
@@ -11,9 +11,10 @@ from module.utils import fs_encode
class PremiumTo(MultiHoster):
__name__ = "PremiumTo"
__type__ = "hoster"
- __version__ = "0.20"
+ __version__ = "0.24"
__pattern__ = r'^unmatchable$'
+ __config__ = [("use_premium", "bool", "Use premium account if available", True)]
__description__ = """Premium.to multi-hoster plugin"""
__license__ = "GPLv3"
@@ -22,6 +23,9 @@ class PremiumTo(MultiHoster):
("stickell", "l.stickell@yahoo.it")]
+ CHECK_TRAFFIC = True
+
+
def handlePremium(self, pyfile):
#raise timeout to 2min
self.download("http://premium.to/api/getfile.php",
@@ -38,10 +42,10 @@ class PremiumTo(MultiHoster):
err = ''
if self.req.http.code == '420':
# Custom error code send - fail
- lastDownload = fs_encode(self.lastDownload)
- with open(lastDownload, "rb") as f:
+ file = fs_encode(self.lastDownload)
+ with open(file, "rb") as f:
err = f.read(256).strip()
- remove(lastDownload)
+ os.remove(file)
if err:
self.fail(err)