diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-09-10 23:56:19 +0200 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-09-10 23:56:19 +0200 |
commit | 358db22de830b6976d085b7f44fb6058816eb5a1 (patch) | |
tree | 5086162afba0819674aba980f12221451e49432e /module/plugins/hoster | |
parent | add UnSkipOnFail hook (diff) | |
download | pyload-358db22de830b6976d085b7f44fb6058816eb5a1.tar.xz |
fix turbobit with ossp-js, ryushare, easybytez - thx trance4us, ChriZathens
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r-- | module/plugins/hoster/TurbobitNet.py | 16 | ||||
-rw-r--r-- | module/plugins/hoster/XFileSharingPro.py | 6 |
2 files changed, 14 insertions, 8 deletions
diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index 2a65c1b00..b3b01c92b 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -35,7 +35,7 @@ class TurbobitNet(SimpleHoster): __name__ = "TurbobitNet" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?(turbobit.net|unextfiles.com)/(?:download/free/)?(?P<ID>\w+).*" - __version__ = "0.06" + __version__ = "0.07" __description__ = """Turbobit.net plugin""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -106,9 +106,11 @@ class TurbobitNet(SimpleHoster): if self.getStorage("version") != self.__version__ or int(self.getStorage("timestamp", 0)) + 86400000 < timestamp(): # that's right, we are even using jdownloader updates rtUpdate = getURL("http://update0.jdownloader.org/pluginstuff/tbupdate.js") - rtUpdate = self.decrypt(rtUpdate.splitlines()[1]) - rtUpdate = rtUpdate.replace("for each(var ss in[2,4,5,6]){inn+=s[ss]}", "inn+=s[2]+s[4]+s[5]+s[6]") - + rtUpdate = self.decrypt(rtUpdate.splitlines()[1]) + # but we still need to fix the syntax to work with other engines than rhino + rtUpdate = re.sub(r'for each\(var (\w+) in(\[[^\]]+\])\)\{',r'zza=\2;for(var zzi=0;zzi<zza.length;zzi++){\1=zza[zzi];',rtUpdate) + rtUpdate = re.sub(r"for\((\w+)=",r"for(var \1=", rtUpdate) + self.logDebug("rtUpdate") self.setStorage("rtUpdate", rtUpdate) self.setStorage("timestamp", timestamp()) @@ -133,13 +135,15 @@ class TurbobitNet(SimpleHoster): try: out = self.js.eval(self.jscode) + self.logDebug("URL", self.js.engine, out) if out.startswith('/download/'): return "http://turbobit.net%s" % out.strip() except Exception, e: self.logError(e) else: - # retry with updated js - self.delStorage("rtUpdate") + if self.retries >= 2: + # retry with updated js + self.delStorage("rtUpdate") self.retry() def decrypt(self, data): diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 36874b798..8e213e9bf 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -34,7 +34,7 @@ class XFileSharingPro(SimpleHoster): __name__ = "XFileSharingPro" __type__ = "hoster" __pattern__ = r"^unmatchable$" - __version__ = "0.10" + __version__ = "0.11" __description__ = """XFileSharingPro common hoster base""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -78,6 +78,8 @@ class XFileSharingPro(SimpleHoster): self.file_info = self.getFileInfo() except PluginParseError: self.file_info = None + + self.req.http.lastURL = self.pyfile.url self.req.http.c.setopt(FOLLOWLOCATION, 0) self.html = self.load(self.pyfile.url, cookies = True, decode = True) @@ -87,7 +89,7 @@ class XFileSharingPro(SimpleHoster): self.location = None found = re.search("Location\s*:\s*(.*)", self.header, re.I) if found and re.match(self.DIRECT_LINK_PATTERN, found.group(1)): - self.location = found.group(1) + self.location = found.group(1).strip() if not self.file_info: pyfile.name = html_unescape(unquote(urlparse(self.location if self.location else pyfile.url).path.split("/")[-1])) |