def getRtUpdate(self): rtUpdate = self.getStorage("rtUpdate") if not rtUpdate: 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]) # 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.setStorage("rtUpdate", rtUpdate) self.setStorage("timestamp", timestamp()) self.setStorage("version", self.__version) else: self.logError(_("Unable to download, wait for update...")) self.tempOffline() return rtUpdate
def handle_premium(self, pyfile): postData = { 'action': 'get_link', 'code': self.info['pattern']['ID'], 'pass': '******' } self.html = self.load( 'http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData) url = re.search(r'"link"\s*:\s*"(.*?)"', self.html) if url: self.link = url.group(1).replace("\\/", "/") raise Exception("Plugin defect")
def handlePremium(self, pyfile): postData = {'action': 'get_link', 'code' : self.info['pattern']['ID'], 'pass' : 'undefined'} self.html = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData) url = re.search(r'"link"\s*:\s*"(.*?)"', self.html) if url: self.link = url.group(1).replace("\\/", "/") raise Exception("Plugin defect")