From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hoster/UploadedTo.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster/UploadedTo.py') diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 2c39a5cf4..e41ae2e34 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -54,17 +54,22 @@ def getAPIData(urls): def parseFileInfo(self, url='', html=''): if not html and hasattr(self, "html"): html = self.html - name, size, status, found, fileid = url, 0, 3, None, None + + name = url + size = 0 + fileid = None if re.search(self.OFFLINE_PATTERN, html): # File offline status = 1 else: - found = re.search(self.FILE_INFO_PATTERN, html) - if found: - name, fileid = html_unescape(found.group('N')), found.group('ID') - size = parseFileSize(found.group('S')) + m = re.search(self.FILE_INFO_PATTERN, html) + if m: + name, fileid = html_unescape(m.group('N')), m.group('ID') + size = parseFileSize(m.group('S')) status = 2 + else: + status = 3 return name, size, status, fileid @@ -163,10 +168,10 @@ class UploadedTo(Hoster): else: #Indirect download self.html = self.load("http://uploaded.net/file/%s" % self.fileID) - found = re.search(r'
(\d+) seconds", self.html) - if found is None: + m = re.search(r"Current waiting period: (\d+) seconds", self.html) + if m is None: self.fail("File not downloadable for free users") - self.setWait(int(found.group(1))) + self.setWait(int(m.group(1))) js = self.load("http://uploaded.net/js/download.js", decode=True) -- cgit v1.2.3