summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-25 01:15:58 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-25 01:15:58 +0200
commit29de13dc5098cc9214f3f8f111da140a22e3e2ff (patch)
treeddf95710cbc7ee67da3457b38a1e7937fda4ef21 /module/plugins
parentFix error method (diff)
downloadpyload-29de13dc5098cc9214f3f8f111da140a22e3e2ff.tar.xz
Use parseTraffic instead parseFileSize in accounts
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/Account.py2
-rw-r--r--module/plugins/accounts/EasybytezCom.py5
-rw-r--r--module/plugins/accounts/FastshareCz.py5
-rw-r--r--module/plugins/accounts/FilerNet.py5
-rw-r--r--module/plugins/accounts/MultishareCz.py10
-rw-r--r--module/plugins/accounts/QuickshareCz.py6
-rw-r--r--module/plugins/accounts/StahnuTo.py5
-rw-r--r--module/plugins/accounts/TusfilesNet.py1
-rw-r--r--module/plugins/internal/XFSPAccount.py5
9 files changed, 18 insertions, 26 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py
index 9c97d2cf9..72b10b45d 100644
--- a/module/plugins/Account.py
+++ b/module/plugins/Account.py
@@ -265,7 +265,7 @@ class Account(Base):
def parseTraffic(self, string): #returns kbyte
- return parseFileSize(string) / 1024
+ return parseFileSize(string, unit="kb")
def wrongPassword(self):
diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py
index f88e9ed4c..74602b696 100644
--- a/module/plugins/accounts/EasybytezCom.py
+++ b/module/plugins/accounts/EasybytezCom.py
@@ -5,13 +5,12 @@ import re
from time import mktime, strptime, gmtime
from module.plugins.internal.XFSPAccount import XFSPAccount
-from module.utils import parseFileSize
class EasybytezCom(XFSPAccount):
__name__ = "EasybytezCom"
__type__ = "account"
- __version__ = "0.07"
+ __version__ = "0.08"
__description__ = """EasyBytez.com account plugin"""
__license__ = "GPLv3"
@@ -52,6 +51,6 @@ class EasybytezCom(XFSPAccount):
if "Unlimited" in trafficleft:
trafficleft = -1
else:
- trafficleft = parseFileSize(trafficleft)
+ trafficleft = self.parseTraffic(trafficleft)
return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}
diff --git a/module/plugins/accounts/FastshareCz.py b/module/plugins/accounts/FastshareCz.py
index 1f74ea2f9..7838d9bab 100644
--- a/module/plugins/accounts/FastshareCz.py
+++ b/module/plugins/accounts/FastshareCz.py
@@ -2,13 +2,12 @@
import re
from module.plugins.Account import Account
-from module.utils import parseFileSize
class FastshareCz(Account):
__name__ = "FastshareCz"
__type__ = "account"
- __version__ = "0.03"
+ __version__ = "0.04"
__description__ = """Fastshare.cz account plugin"""
__license__ = "GPLv3"
@@ -24,7 +23,7 @@ class FastshareCz(Account):
m = re.search(self.CREDIT_PATTERN, html)
if m:
- trafficleft = parseFileSize(m.group(1))
+ trafficleft = self.parseTraffic(m.group(1))
premium = True if trafficleft else False
else:
trafficleft = None
diff --git a/module/plugins/accounts/FilerNet.py b/module/plugins/accounts/FilerNet.py
index f89d7be2f..8dcb20295 100644
--- a/module/plugins/accounts/FilerNet.py
+++ b/module/plugins/accounts/FilerNet.py
@@ -4,13 +4,12 @@ import re
import time
from module.plugins.Account import Account
-from module.utils import parseFileSize
class FilerNet(Account):
__name__ = "FilerNet"
__type__ = "account"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """Filer.net account plugin"""
__license__ = "GPLv3"
@@ -34,7 +33,7 @@ class FilerNet(Account):
traffic = re.search(self.TRAFFIC_PATTERN, html)
if until and traffic:
validuntil = int(time.mktime(time.strptime(until.group(1), "%d.%m.%Y %H:%M:%S")))
- trafficleft = parseFileSize(traffic.group(1))
+ trafficleft = self.parseTraffic(traffic.group(1))
return {"premium": True, "validuntil": validuntil, "trafficleft": trafficleft}
else:
self.logError("Unable to retrieve account information")
diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py
index 813f36496..38bb11ea1 100644
--- a/module/plugins/accounts/MultishareCz.py
+++ b/module/plugins/accounts/MultishareCz.py
@@ -1,16 +1,14 @@
# -*- coding: utf-8 -*-
-from module.plugins.Account import Account
-#from time import mktime, strptime
-#from pycurl import REFERER
import re
-from module.utils import parseFileSize
+
+from module.plugins.Account import Account
class MultishareCz(Account):
__name__ = "MultishareCz"
__type__ = "account"
- __version__ = "0.02"
+ __version__ = "0.03"
__description__ = """Multishare.cz account plugin"""
__license__ = "GPLv3"
@@ -26,7 +24,7 @@ class MultishareCz(Account):
html = req.load("http://www.multishare.cz/profil/", decode=True)
m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- trafficleft = parseFileSize(m.group('S'), m.group('U')) if m else 0
+ trafficleft = self.parseTraffic(m.group('S'), m.group('U')) if m else 0
self.premium = True if trafficleft else False
html = req.load("http://www.multishare.cz/", decode=True)
diff --git a/module/plugins/accounts/QuickshareCz.py b/module/plugins/accounts/QuickshareCz.py
index e83f7308d..adb54c7d0 100644
--- a/module/plugins/accounts/QuickshareCz.py
+++ b/module/plugins/accounts/QuickshareCz.py
@@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
import re
+
from module.plugins.Account import Account
-from module.utils import parseFileSize
class QuickshareCz(Account):
__name__ = "QuickshareCz"
__type__ = "account"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """Quickshare.cz account plugin"""
__license__ = "GPLv3"
@@ -20,7 +20,7 @@ class QuickshareCz(Account):
m = re.search(r'Stav kreditu: <strong>(.+?)</strong>', html)
if m:
- trafficleft = parseFileSize(m.group(1))
+ trafficleft = self.parseTraffic(m.group(1))
premium = True if trafficleft else False
else:
trafficleft = None
diff --git a/module/plugins/accounts/StahnuTo.py b/module/plugins/accounts/StahnuTo.py
index 7b32ae842..b254e0fac 100644
--- a/module/plugins/accounts/StahnuTo.py
+++ b/module/plugins/accounts/StahnuTo.py
@@ -3,13 +3,12 @@
import re
from module.plugins.Account import Account
-from module.utils import parseFileSize
class StahnuTo(Account):
__name__ = "StahnuTo"
__type__ = "account"
- __version__ = "0.02"
+ __version__ = "0.03"
__description__ = """StahnuTo account plugin"""
__license__ = "GPLv3"
@@ -20,7 +19,7 @@ class StahnuTo(Account):
html = req.load("http://www.stahnu.to/")
m = re.search(r'>VIP: (\d+.*)<', html)
- trafficleft = parseFileSize(m.group(1)) * 1024 if m else 0
+ trafficleft = self.parseTraffic(m.group(1)) * 1024 if m else 0
return {"premium": trafficleft > (512 * 1024), "trafficleft": trafficleft, "validuntil": -1}
diff --git a/module/plugins/accounts/TusfilesNet.py b/module/plugins/accounts/TusfilesNet.py
index 65f35a8e2..d52169fae 100644
--- a/module/plugins/accounts/TusfilesNet.py
+++ b/module/plugins/accounts/TusfilesNet.py
@@ -5,7 +5,6 @@ import re
from time import mktime, strptime, gmtime
from module.plugins.internal.XFSPAccount import XFSPAccount
-from module.utils import parseFileSize
class TusfilesNet(XFSPAccount):
diff --git a/module/plugins/internal/XFSPAccount.py b/module/plugins/internal/XFSPAccount.py
index 5e2a0afc4..e54fda987 100644
--- a/module/plugins/internal/XFSPAccount.py
+++ b/module/plugins/internal/XFSPAccount.py
@@ -7,13 +7,12 @@ from time import mktime, strptime
from module.plugins.Account import Account
from module.plugins.internal.SimpleHoster import parseHtmlForm, set_cookies
-from module.utils import parseFileSize
class XFSPAccount(Account):
__name__ = "XFSPAccount"
__type__ = "account"
- __version__ = "0.15"
+ __version__ = "0.16"
__description__ = """XFileSharingPro account plugin"""
__license__ = "GPLv3"
@@ -94,7 +93,7 @@ class XFSPAccount(Account):
unit = self.TRAFFIC_LEFT_UNIT
else:
unit = None
- trafficleft = parseFileSize(traffic['S'], unit)
+ trafficleft = self.parseTraffic(traffic['S'], unit)
except:
pass