diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-07-20 03:02:09 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-07-20 03:34:54 +0200 |
commit | 9395182da7afed55a29bde1c7cbefe4204e783f0 (patch) | |
tree | 14c5f5f2dc5ea428c4625e8ce9208c5d77d1fc18 /module/plugins/crypter | |
parent | [account] self.html -> html (where was possible) (diff) | |
download | pyload-9395182da7afed55a29bde1c7cbefe4204e783f0.tar.xz |
Store all re.search/match object as "m" instead "found"
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/CzshareComFolder.py | 6 | ||||
-rw-r--r-- | module/plugins/crypter/DuckCryptInfo.py | 30 | ||||
-rw-r--r-- | module/plugins/crypter/EmbeduploadCom.py | 8 | ||||
-rw-r--r-- | module/plugins/crypter/LinkdecrypterCom.py | 18 | ||||
-rw-r--r-- | module/plugins/crypter/MediafireComFolder.py | 12 | ||||
-rw-r--r-- | module/plugins/crypter/MultiloadCz.py | 14 | ||||
-rw-r--r-- | module/plugins/crypter/MultiuploadCom.py | 4 | ||||
-rw-r--r-- | module/plugins/crypter/NCryptIn.py | 10 | ||||
-rw-r--r-- | module/plugins/crypter/QuickshareCzFolder.py | 6 | ||||
-rw-r--r-- | module/plugins/crypter/UlozToFolder.py | 12 |
10 files changed, 60 insertions, 60 deletions
diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 76762b69b..b305575a2 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -22,10 +22,10 @@ class CzshareComFolder(Crypter): def decrypt(self, pyfile): html = self.load(pyfile.url) - found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: + m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if m is None: self.fail("Parse error (FOLDER)") - self.urls.extend(re.findall(self.LINK_PATTERN, found.group(1))) + self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) if not self.urls: self.fail('Could not extract any links') diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py index 8203f0978..7e13a62f0 100644 --- a/module/plugins/crypter/DuckCryptInfo.py +++ b/module/plugins/crypter/DuckCryptInfo.py @@ -23,28 +23,28 @@ class DuckCryptInfo(Crypter): url = pyfile.url # seems we don't need to wait #src = self.req.load(str(url)) - #found = re.search(self.TIMER_PATTERN, src) - #if found: - # self.logDebug("Sleeping for" % found.group(1)) - # self.setWait(int(found.group(1)) ,False) - found = re.match(self.__pattern__, url) - if found is None: + #m = re.search(self.TIMER_PATTERN, src) + #if m: + # self.logDebug("Sleeping for" % m.group(1)) + # self.setWait(int(m.group(1)) ,False) + m = re.match(self.__pattern__, url) + if m is None: self.fail('Weird error in link') - if str(found.group(1)) == "link": + if str(m.group(1)) == "link": self.handleLink(url) else: - self.handleFolder(found) + self.handleFolder(m) - def handleFolder(self, found): - src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2))) - found = re.match(self.__pattern__, src) - self.logDebug("Redirectet to " + str(found.group(0))) - src = self.load(str(found.group(0))) + def handleFolder(self, m): + src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(m.group(2))) + m = re.match(self.__pattern__, src) + self.logDebug("Redirectet to " + str(m.group(0))) + src = self.load(str(m.group(0))) soup = BeautifulSoup(src) cryptlinks = soup.findAll("div", attrs={"class": "folderbox"}) self.logDebug("Redirectet to " + str(cryptlinks)) if not cryptlinks: - self.fail('no links found - (Plugin out of date?)') + self.fail('no links m - (Plugin out of date?)') for clink in cryptlinks: if clink.find("a"): self.handleLink(clink.find("a")['href']) @@ -54,4 +54,4 @@ class DuckCryptInfo(Crypter): soup = BeautifulSoup(src) self.urls = [soup.find("iframe")["src"]] if not self.urls: - self.logDebug('no links found - (Plugin out of date?)') + self.logDebug('no links m - (Plugin out of date?)') diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py index 823e3f25f..052f5ca84 100644 --- a/module/plugins/crypter/EmbeduploadCom.py +++ b/module/plugins/crypter/EmbeduploadCom.py @@ -25,19 +25,19 @@ class EmbeduploadCom(Crypter): self.html = self.load(pyfile.url, decode=True) tmp_links = [] - found = re.findall(self.LINK_PATTERN, self.html) - if found: + m = re.findall(self.LINK_PATTERN, self.html) + if m: prefered_set = set(self.getConfig("preferedHoster").split('|')) prefered_set = map(lambda s: s.lower().split('.')[0], prefered_set) print "PF", prefered_set - tmp_links.extend([x[1] for x in found if x[0] in prefered_set]) + tmp_links.extend([x[1] for x in m if x[0] in prefered_set]) self.urls = self.getLocation(tmp_links) if not self.urls: ignored_set = set(self.getConfig("ignoredHoster").split('|')) ignored_set = map(lambda s: s.lower().split('.')[0], ignored_set) print "IG", ignored_set - tmp_links.extend([x[1] for x in found if x[0] not in ignored_set]) + tmp_links.extend([x[1] for x in m if x[0] not in ignored_set]) self.urls = self.getLocation(tmp_links) if not self.urls: diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py index 31c4d36b7..2671c19c6 100644 --- a/module/plugins/crypter/LinkdecrypterCom.py +++ b/module/plugins/crypter/LinkdecrypterCom.py @@ -72,17 +72,17 @@ class LinkdecrypterCom(Crypter): self.html = self.load('http://linkdecrypter.com/', post=post_dict, cookies=True, decode=True) while self.passwords or retries: - found = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.DOTALL) - if found: - return [x for x in found.group(1).splitlines() if '[LINK-ERROR]' not in x] + m = re.search(self.TEXTAREA_PATTERN, self.html, flags=re.DOTALL) + if m: + return [x for x in m.group(1).splitlines() if '[LINK-ERROR]' not in x] - found = re.search(self.CAPTCHA_PATTERN, self.html) - if found: - captcha_url = 'http://linkdecrypter.com/' + found.group(1) - result_type = "positional" if "getPos" in found.group(2) else "textual" + m = re.search(self.CAPTCHA_PATTERN, self.html) + if m: + captcha_url = 'http://linkdecrypter.com/' + m.group(1) + result_type = "positional" if "getPos" in m.group(2) else "textual" - found = re.search(r"<p><i><b>([^<]+)</b></i></p>", self.html) - msg = found.group(1) if found else "" + m = re.search(r"<p><i><b>([^<]+)</b></i></p>", self.html) + msg = m.group(1) if m else "" self.logInfo("Captcha protected link", result_type, msg) captcha = self.decryptCaptcha(captcha_url, result_type=result_type) diff --git a/module/plugins/crypter/MediafireComFolder.py b/module/plugins/crypter/MediafireComFolder.py index 5f1b9ad1b..5dd4e555b 100644 --- a/module/plugins/crypter/MediafireComFolder.py +++ b/module/plugins/crypter/MediafireComFolder.py @@ -28,15 +28,15 @@ class MediafireComFolder(Crypter): if result == 0: # load and parse html html = self.load(pyfile.url) - found = re.search(self.FILE_URL_PATTERN, html) - if found: + m = re.search(self.FILE_URL_PATTERN, html) + if m: # file page - self.urls.append("http://www.mediafire.com/file/%s" % found.group(1)) + self.urls.append("http://www.mediafire.com/file/%s" % m.group(1)) else: # folder page - found = re.search(self.FOLDER_KEY_PATTERN, html) - if found: - folder_key = found.group(1) + m = re.search(self.FOLDER_KEY_PATTERN, html) + if m: + folder_key = m.group(1) self.logDebug("FOLDER KEY: %s" % folder_key) json_resp = json_loads(self.load( diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py index f93681be9..4b39872a7 100644 --- a/module/plugins/crypter/MultiloadCz.py +++ b/module/plugins/crypter/MultiloadCz.py @@ -25,18 +25,18 @@ class MultiloadCz(Crypter): self.html = self.load(pyfile.url, decode=True) if re.match(self.__pattern__, pyfile.url).group(1) == "slozka": - found = re.search(self.FOLDER_PATTERN, self.html) - if found: - self.urls.extend(found.group(1).split()) + m = re.search(self.FOLDER_PATTERN, self.html) + if m: + self.urls.extend(m.group(1).split()) else: - found = re.findall(self.LINK_PATTERN, self.html) - if found: + m = re.findall(self.LINK_PATTERN, self.html) + if m: prefered_set = set(self.getConfig("usedHoster").split('|')) - self.urls.extend([x[1] for x in found if x[0] in prefered_set]) + self.urls.extend([x[1] for x in m if x[0] in prefered_set]) if not self.urls: ignored_set = set(self.getConfig("ignoredHoster").split('|')) - self.urls.extend([x[1] for x in found if x[0] not in ignored_set]) + self.urls.extend([x[1] for x in m if x[0] not in ignored_set]) if not self.urls: self.fail('Could not extract any links') diff --git a/module/plugins/crypter/MultiuploadCom.py b/module/plugins/crypter/MultiuploadCom.py index 84d8d0830..f5c0e292b 100644 --- a/module/plugins/crypter/MultiuploadCom.py +++ b/module/plugins/crypter/MultiuploadCom.py @@ -25,8 +25,8 @@ class MultiuploadCom(Crypter): def decrypt(self, pyfile): self.html = self.load(pyfile.url) - found = re.search(self.ML_LINK_PATTERN, self.html) - ml_url = found.group(1) if found else None + m = re.search(self.ML_LINK_PATTERN, self.html) + ml_url = m.group(1) if m else None json_list = json_loads(self.load("http://multiupload.com/progress/", get={ "d": re.match(self.__pattern__, pyfile.url).group(1), diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index f9953b994..9a9d76f51 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -95,7 +95,7 @@ class NCryptIn(Crypter): def isOnline(self): if "Your folder does not exist" in self.cleanedHtml: - self.logDebug("File not found") + self.logDebug("File not m") return False return True @@ -111,14 +111,14 @@ class NCryptIn(Crypter): return False def getPackageInfo(self): - found = re.search(self.NAME_PATTERN, self.html) - if found: - name = folder = found.group('N').strip() + m = re.search(self.NAME_PATTERN, self.html) + if m: + name = folder = m.group('N').strip() self.logDebug("Found name [%s] and folder [%s] in package info" % (name, folder)) else: name = self.package.name folder = self.package.folder - self.logDebug("Package info not found, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) + self.logDebug("Package info not m, defaulting to pyfile name [%s] and folder [%s]" % (name, folder)) return name, folder def unlockProtection(self): diff --git a/module/plugins/crypter/QuickshareCzFolder.py b/module/plugins/crypter/QuickshareCzFolder.py index e138b6f17..1e569a20a 100644 --- a/module/plugins/crypter/QuickshareCzFolder.py +++ b/module/plugins/crypter/QuickshareCzFolder.py @@ -22,10 +22,10 @@ class QuickshareCzFolder(Crypter): def decrypt(self, pyfile): html = self.load(pyfile.url) - found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: + m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if m is None: self.fail("Parse error (FOLDER)") - self.urls.extend(re.findall(self.LINK_PATTERN, found.group(1))) + self.urls.extend(re.findall(self.LINK_PATTERN, m.group(1))) if not self.urls: self.fail('Could not extract any links') diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index 43dbb4807..dfa1bb8c4 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -26,14 +26,14 @@ class UlozToFolder(Crypter): new_links = [] for i in xrange(1, 100): self.logInfo("Fetching links from page %i" % i) - found = re.search(self.FOLDER_PATTERN, html, re.DOTALL) - if found is None: + m = re.search(self.FOLDER_PATTERN, html, re.DOTALL) + if m is None: self.fail("Parse error (FOLDER)") - new_links.extend(re.findall(self.LINK_PATTERN, found.group(1))) - found = re.search(self.NEXT_PAGE_PATTERN, html) - if found: - html = self.load("http://ulozto.net/" + found.group(1)) + new_links.extend(re.findall(self.LINK_PATTERN, m.group(1))) + m = re.search(self.NEXT_PAGE_PATTERN, html) + if m: + html = self.load("http://ulozto.net/" + m.group(1)) else: break else: |