From a33d8062833d1bfec4777145cc484c1d6b9e141f Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 27 Aug 2010 17:07:33 +0200 Subject: some automatic fixes --- module/plugins/hoster/DepositfilesCom.py | 4 +-- module/plugins/hoster/FileserveCom.py | 58 ++++++++++++++++---------------- module/plugins/hoster/FreakshareNet.py | 12 +++---- module/plugins/hoster/HotfileCom.py | 2 +- module/plugins/hoster/MegauploadCom.py | 4 +-- module/plugins/hoster/MegavideoCom.py | 10 +++--- module/plugins/hoster/NetloadIn.py | 20 +++++------ module/plugins/hoster/PornhostCom.py | 10 +++--- module/plugins/hoster/PornhubCom.py | 8 ++--- module/plugins/hoster/RapidshareCom.py | 10 ++---- module/plugins/hoster/RedtubeCom.py | 8 ++--- module/plugins/hoster/ShareCx.py | 16 ++++----- module/plugins/hoster/ShragleCom.py | 10 +++--- module/plugins/hoster/UploadedTo.py | 2 +- module/plugins/hoster/YoupornCom.py | 10 +++--- module/plugins/hoster/YoutubeCom.py | 2 +- module/plugins/hoster/ZippyshareCom.py | 6 ++-- 17 files changed, 94 insertions(+), 98 deletions(-) (limited to 'module/plugins/hoster') diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py index c91341887..28d0819d7 100644 --- a/module/plugins/hoster/DepositfilesCom.py +++ b/module/plugins/hoster/DepositfilesCom.py @@ -32,12 +32,12 @@ class DepositfilesCom(Hoster): self.download(link) def handleFree(self): - if re.search(r'File is checked, please try again in a minute.', self.html) != None: + if re.search(r'File is checked, please try again in a minute.', self.html) is not None: self.log.info("DepositFiles.com: The file is being checked. Waiting 1 minute.") self.setWait(61) self.wait() - if re.search(r'Such file does not exist or it has been removed for infringement of copyrights', self.html) != None: + if re.search(r'Such file does not exist or it has been removed for infringement of copyrights', self.html) is not None: self.offline() self.html = self.load(self.pyfile.url, post={"gateway_result":"1"}) diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index ff09d9a0a..753baa800 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -2,26 +2,26 @@ import re from module.plugins.Hoster import Hoster -from module.plugins.ReCaptcha import ReCaptcha - +from module.plugins.ReCaptcha import ReCaptcha + from module.network.Request import getURL - -def getInfo(urls): - result = [] - - for url in urls: + +def getInfo(urls): + result = [] + + for url in urls: html = getURL(url) if re.search(r'

File not available

', html): - result.append((url, 0, 1, url)) - continue - + result.append((url, 0, 1, url)) + continue + size = re.search(r"(.*?) MB", html).group(1) - size = int(float(size)*1024*1024) + size = int(float(size)*1024*1024) - name = re.search('

(.*?)

', html).group(1) - result.append((name, size, 2, url)) - - yield result + name = re.search('

(.*?)

', html).group(1) + result.append((name, size, 2, url)) + + yield result class FileserveCom(Hoster): __name__ = "FileserveCom" @@ -38,20 +38,20 @@ class FileserveCom(Hoster): def process(self, pyfile): self.html = self.load(self.pyfile.url, cookies=False if self.account else True) - if re.search(r'

File not available

', self.html) != None: - self.offline + if re.search(r'

File not available

', self.html) is not None: + self.offline() self.pyfile.name = re.search('

(.*?)

', self.html).group(1) - - if self.account: - self.handlePremium() - else: - self.handleFree() - - def handlePremium(self): - self.download(self.pyfile.url, post={"download":"premium"}, cookies=True) - - def handleFree(self): + + if self.account: + self.handlePremium() + else: + self.handleFree() + + def handlePremium(self): + self.download(self.pyfile.url, post={"download":"premium"}, cookies=True) + + def handleFree(self): if r'