summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-10-10 23:41:06 +0200
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-10-10 23:41:06 +0200
commit87effaa3c99406ec8f8de157fcfc39ccb0a92b8b (patch)
tree1b19617cbb31ed79b30f22c926c6198bc07da6fc
parenteuroshare.eu premium (diff)
downloadpyload-87effaa3c99406ec8f8de157fcfc39ccb0a92b8b.tar.xz
fix sharerapid, euroshare
-rw-r--r--module/plugins/accounts/ShareRapidCom.py41
-rw-r--r--module/plugins/hoster/EuroshareEu.py4
2 files changed, 29 insertions, 16 deletions
diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py
index aad229475..f8043449c 100644
--- a/module/plugins/accounts/ShareRapidCom.py
+++ b/module/plugins/accounts/ShareRapidCom.py
@@ -1,24 +1,37 @@
# -*- coding: utf-8 -*-
import re
+from time import mktime, strptime
from module.plugins.Account import Account
class ShareRapidCom(Account):
__name__ = "ShareRapidCom"
- __version__ = "0.31"
+ __version__ = "0.32"
__type__ = "account"
__description__ = """ShareRapid account plugin"""
- __author_name__ = ("MikyWoW")
-
+ __author_name__ = ("MikyWoW", "zoidberg")
+
+ login_timeout = 60
+
def loadAccountInfo(self, user, req):
- src = req.load("http://share-rapid.com/mujucet/", cookies=True)
+ src = req.load("http://share-rapid.com/mujucet/", decode=True)
+
+ found = re.search(ur'<td>Max. počet paralelních stahování: </td><td>(\d+)', src)
+ if found:
+ data = self.getAccountData(user)
+ data["options"]["limitDL"] = [int(found.group(1))]
+
+ found = re.search(ur'<td>Paušální stahování aktivní. Vyprší </td><td><strong>(.*?)</strong>', src)
+ if found:
+ validuntil = mktime(strptime(found.group(1), "%d.%m.%Y - %H:%M"))
+ return {"premium": True, "trafficleft": -1, "validuntil": validuntil}
+
found = re.search(r'<tr><td>GB:</td><td>(.*?) GB', src)
if found:
- ret = float(found.group(1)) * (1 << 20)
- tmp = {"premium": True, "trafficleft": ret, "validuntil": -1}
- else:
- tmp = {"premium": False, "trafficleft": None, "validuntil": None}
- return tmp
+ trafficleft = float(found.group(1)) * (1 << 20)
+ return {"premium": True, "trafficleft": trafficleft, "validuntil": -1}
+
+ return {"premium": False, "trafficleft": None, "validuntil": None}
def login(self, user, data, req):
htm = req.load("http://share-rapid.com/prihlaseni/", cookies=True)
@@ -27,8 +40,8 @@ class ShareRapidCom(Account):
htm = htm[start+33:]
hashes = htm[0:32]
htm = req.load("http://share-rapid.com/prihlaseni/",
- post={"hash": hashes,"login": user, "pass1": data["password"],"remember": 0,
- "sbmt": "P%C5%99ihl%C3%A1sit"}, cookies=True)
-
- #if "Heslo:" in htm:
- # self.wrongPassword() \ No newline at end of file
+ post={"hash": hashes,
+ "login": user,
+ "pass1": data["password"],
+ "remember": 0,
+ "sbmt": u"Přihlásit"}, cookies=True) \ No newline at end of file
diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py
index 79df56ac4..448862f5b 100644
--- a/module/plugins/hoster/EuroshareEu.py
+++ b/module/plugins/hoster/EuroshareEu.py
@@ -17,13 +17,13 @@
"""
import re
-from module.plugins.internal.SimpleHoster import SimpleHoster
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class EuroshareEu(SimpleHoster):
__name__ = "EuroshareEu"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)?euroshare.(eu|sk|cz|hu|pl)/file/.*"
- __version__ = "0.22"
+ __version__ = "0.23"
__description__ = """Euroshare.eu"""
__author_name__ = ("zoidberg")