diff options
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/accounts/UlozTo.py | 9 | ||||
-rw-r--r-- | module/plugins/hoster/BitshareCom.py | 12 |
2 files changed, 14 insertions, 7 deletions
diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 0375337b0..0c4ecda6a 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -5,7 +5,7 @@ import re class UlozTo(Account): __name__ = "UlozTo" - __version__ = "0.02" + __version__ = "0.03" __type__ = "account" __description__ = """uloz.to account plugin""" __author_name__ = ("zoidberg") @@ -14,11 +14,14 @@ class UlozTo(Account): TRAFFIC_LEFT_PATTERN = r'<li class="menu-kredit"><a href="/kredit/" title="[^"]*?GB = ([0-9.]+) MB">' def loadAccountInfo(self, user, req): - html = req.load("http://www.ulozto.net/statistiky", decode = True) + #this cookie gets lost somehow after each request + self.phpsessid = req.cj.getCookie("PHPSESSID") + html = req.load("http://www.ulozto.net/", decode = True) + req.cj.setCookie("www.ulozto.net", "PHPSESSID", self.phpsessid) found = re.search(self.TRAFFIC_LEFT_PATTERN, html) trafficleft = int(float(found.group(1).replace(' ','').replace(',','.')) * 1000 / 1.024) if found else 0 - self.premium = True if trafficleft else False + self.premium = True if trafficleft else False return {"validuntil": -1, "trafficleft": trafficleft} diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 1c7d79510..ba90f3ddc 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -46,7 +46,7 @@ class BitshareCom(Hoster): __name__ = "BitshareCom" __type__ = "hoster" __pattern__ = r"http://(www\.)?bitshare\.com/(files/(?P<id1>[a-zA-Z0-9]+)(/(?P<name>.*?)\.html)?|\?f=(?P<id2>[a-zA-Z0-9]+))" - __version__ = "0.42" + __version__ = "0.43" __description__ = """Bitshare.Com File Download Hoster""" __author_name__ = ("paulking", "fragonib") __author_mail__ = (None, "fragonib[AT]yahoo[DOT]es") @@ -58,10 +58,12 @@ class BitshareCom(Hoster): CAPTCHA_KEY_PATTERN = r"http://api\.recaptcha\.net/challenge\?k=(.*?) " def setup(self): - self.multiDL = False + self.multiDL = self.premium self.chunkLimit = 1 def process(self, pyfile): + if self.premium: + self.account.relogin(self.user) self.pyfile = pyfile @@ -142,10 +144,12 @@ class BitshareCom(Hoster): url = response.split("#")[-1] return url - + def handleErrors(self, response, separator): self.logDebug("Checking response [%s]" % response) - if "ERROR" in response: + if "ERROR:Session timed out" in response: + self.retry() + elif "ERROR" in response: msg = response.split(separator)[-1] self.fail(msg) |