summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-04-11 12:19:22 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2014-04-11 12:19:22 +0200
commit8c18c14ab56541aeae9123ee3b558b70aeabfd09 (patch)
treed6bb0723d4e9e879cf48f7400a6ff15bcd6e489b /module/plugins/crypter
parentRemove bad whitespaces (diff)
downloadpyload-8c18c14ab56541aeae9123ee3b558b70aeabfd09.tar.xz
Use re.match for __pattern__ matches instead re.search
Merges vuolter/pyload@9117005
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/DuckCryptInfo.py4
-rw-r--r--module/plugins/crypter/FilefactoryComFolder.py2
-rw-r--r--module/plugins/crypter/LixIn.py2
-rw-r--r--module/plugins/crypter/MultiloadCz.py2
-rw-r--r--module/plugins/crypter/MultiuploadCom.py2
-rw-r--r--module/plugins/crypter/NCryptIn.py2
-rw-r--r--module/plugins/crypter/SafelinkingNet.py2
-rw-r--r--module/plugins/crypter/ShareLinksBiz.py2
8 files changed, 9 insertions, 9 deletions
diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py
index 680ddf222..a35343c1d 100644
--- a/module/plugins/crypter/DuckCryptInfo.py
+++ b/module/plugins/crypter/DuckCryptInfo.py
@@ -24,7 +24,7 @@ class DuckCryptInfo(Crypter):
#if found:
# self.logDebug("Sleeping for" % found.group(1))
# self.setWait(int(found.group(1)) ,False)
- found = re.search(self.__pattern__, url)
+ found = re.match(self.__pattern__, url)
if not found:
self.fail('Weird error in link')
if str(found.group(1)) == "link":
@@ -35,7 +35,7 @@ class DuckCryptInfo(Crypter):
def handleFolder(self, found):
src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(found.group(2)))
- found = re.search(self.__pattern__, src)
+ found = re.match(self.__pattern__, src)
self.logDebug("Redirectet to " + str(found.group(0)))
src = self.load(str(found.group(0)))
soup = BeautifulSoup(src)
diff --git a/module/plugins/crypter/FilefactoryComFolder.py b/module/plugins/crypter/FilefactoryComFolder.py
index 6a1ffea2c..ed4ffebb6 100644
--- a/module/plugins/crypter/FilefactoryComFolder.py
+++ b/module/plugins/crypter/FilefactoryComFolder.py
@@ -19,7 +19,7 @@ class FilefactoryComFolder(Crypter):
NEXT_PAGE_PATTERN = r'<li class="current">.*?</li>\s*<li class=""><a href="([^"]+)">'
def decrypt(self, pyfile):
- url_base = re.search(self.__pattern__, self.pyfile.url).group(1)
+ url_base = re.match(self.__pattern__, self.pyfile.url).group(1)
html = self.load(url_base)
new_links = []
diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py
index 84f340d44..ef02c5060 100644
--- a/module/plugins/crypter/LixIn.py
+++ b/module/plugins/crypter/LixIn.py
@@ -22,7 +22,7 @@ class LixIn(Crypter):
def decrypt(self, pyfile):
url = pyfile.url
- matches = re.search(self.__pattern__, url)
+ matches = re.match(self.__pattern__, url)
if not matches:
self.fail("couldn't identify file id")
diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py
index 22dff1c8a..4800bf309 100644
--- a/module/plugins/crypter/MultiloadCz.py
+++ b/module/plugins/crypter/MultiloadCz.py
@@ -22,7 +22,7 @@ class MultiloadCz(Crypter):
self.html = self.load(self.pyfile.url, decode=True)
new_links = []
- if re.search(self.__pattern__, self.pyfile.url).group(1) == "slozka":
+ if re.match(self.__pattern__, self.pyfile.url).group(1) == "slozka":
found = re.search(self.FOLDER_PATTERN, self.html)
if found is not None:
new_links.extend(found.group(1).split())
diff --git a/module/plugins/crypter/MultiuploadCom.py b/module/plugins/crypter/MultiuploadCom.py
index f060d9472..e3013fe0d 100644
--- a/module/plugins/crypter/MultiuploadCom.py
+++ b/module/plugins/crypter/MultiuploadCom.py
@@ -26,7 +26,7 @@ class MultiuploadCom(Crypter):
ml_url = found.group(1) if found else None
json_list = json_loads(self.load("http://multiupload.com/progress/", get={
- "d": re.search(self.__pattern__, pyfile.url).group(1),
+ "d": re.match(self.__pattern__, pyfile.url).group(1),
"r": str(int(time() * 1000))
}))
new_links = []
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index 53f4dad19..c6e26bdad 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -74,7 +74,7 @@ class NCryptIn(Crypter):
self.packages = [(package_name, package_links, folder_name)]
def isSingleLink(self):
- link_type = re.search(self.__pattern__, self.pyfile.url).group('type')
+ link_type = re.match(self.__pattern__, self.pyfile.url).group('type')
return link_type in ('link', 'frame')
def requestFolderHome(self):
diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py
index e0a3e14af..aaf1622c6 100644
--- a/module/plugins/crypter/SafelinkingNet.py
+++ b/module/plugins/crypter/SafelinkingNet.py
@@ -22,7 +22,7 @@ class SafelinkingNet(Crypter):
def decrypt(self, pyfile):
url = pyfile.url
- if re.search(self.__pattern__, url).group(1) == "d":
+ if re.match(self.__pattern__, url).group(1) == "d":
self.req.http.c.setopt(FOLLOWLOCATION, 0)
self.load(url)
m = re.search("^Location: (.+)$", self.req.http.header, re.MULTILINE)
diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py
index c48ef6e64..0c0ab3851 100644
--- a/module/plugins/crypter/ShareLinksBiz.py
+++ b/module/plugins/crypter/ShareLinksBiz.py
@@ -63,7 +63,7 @@ class ShareLinksBiz(Crypter):
url = pyfile.url
if 's2l.biz' in url:
url = self.load(url, just_header=True)['location']
- self.baseUrl = re.search(self.__pattern__, url).group(1)
+ self.baseUrl = re.match(self.__pattern__, url).group(1)
self.fileId = re.match(self.__pattern__, url).group('id')
self.package = pyfile.package()