summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-22 16:45:04 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-12-22 16:45:04 +0100
commit854efeb463bd98cb8e22f1f78f5ce97e6c0ab49f (patch)
tree3128578d89f36fed0aa5ab7b3ede6311751dd7f8 /module/plugins/crypter
parent[UlozTo] Fix TRAFFIC_LEFT_PATTERN (diff)
downloadpyload-854efeb463bd98cb8e22f1f78f5ce97e6c0ab49f.tar.xz
Spare code cosmetics
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/DailymotionBatch.py4
-rw-r--r--module/plugins/crypter/Dereferer.py4
-rw-r--r--module/plugins/crypter/DlProtectCom.py2
-rw-r--r--module/plugins/crypter/LinkSaveIn.py4
-rw-r--r--module/plugins/crypter/LixIn.py10
-rw-r--r--module/plugins/crypter/MultiUpOrg.py2
-rw-r--r--module/plugins/crypter/NCryptIn.py4
-rw-r--r--module/plugins/crypter/RelinkUs.py10
-rw-r--r--module/plugins/crypter/TurbobitNetFolder.py2
-rw-r--r--module/plugins/crypter/UploadedToFolder.py6
-rw-r--r--module/plugins/crypter/YoutubeBatch.py4
11 files changed, 26 insertions, 26 deletions
diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py
index 28e01c084..8d4cb64df 100644
--- a/module/plugins/crypter/DailymotionBatch.py
+++ b/module/plugins/crypter/DailymotionBatch.py
@@ -84,8 +84,8 @@ class DailymotionBatch(Crypter):
def decrypt(self, pyfile):
m = re.match(self.__pattern__, pyfile.url)
- m_id = m.group("ID")
- m_type = m.group("TYPE")
+ m_id = m.group('ID')
+ m_type = m.group('TYPE')
if m_type == "playlist":
self.logDebug("Url recognized as Playlist")
diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py
index dadc3c8b3..398cadce7 100644
--- a/module/plugins/crypter/Dereferer.py
+++ b/module/plugins/crypter/Dereferer.py
@@ -12,7 +12,7 @@ class Dereferer(Crypter):
__type__ = "crypter"
__version__ = "0.10"
- __pattern__ = r'https?://([^/]+)/.*?(?P<url>(ht|f)tps?(://|%3A%2F%2F).*)'
+ __pattern__ = r'https?://([^/]+)/.*?(?P<URL>(ht|f)tps?(://|%3A%2F%2F).*)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -22,5 +22,5 @@ class Dereferer(Crypter):
def decrypt(self, pyfile):
- link = re.match(self.__pattern__, pyfile.url).group('url')
+ link = re.match(self.__pattern__, pyfile.url).group('URL')
self.urls = [unquote(link).rstrip('+')]
diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py
index 0f59e925e..a99ed0be9 100644
--- a/module/plugins/crypter/DlProtectCom.py
+++ b/module/plugins/crypter/DlProtectCom.py
@@ -30,7 +30,7 @@ class DlProtectCom(SimpleCrypter):
if not re.match(r"http://(?:www\.)?dl-protect\.com", self.req.http.lastEffectiveURL):
return [self.req.http.lastEffectiveURL]
- #id = re.match(self.__pattern__, self.pyfile.url).group("ID")
+ #id = re.match(self.__pattern__, self.pyfile.url).group('ID')
key = re.search(r'name="id_key" value="(.+?)"', self.html).group(1)
post_req = {"id_key": key, "submitform": ""}
diff --git a/module/plugins/crypter/LinkSaveIn.py b/module/plugins/crypter/LinkSaveIn.py
index 22aba8afc..842310853 100644
--- a/module/plugins/crypter/LinkSaveIn.py
+++ b/module/plugins/crypter/LinkSaveIn.py
@@ -18,7 +18,7 @@ class LinkSaveIn(SimpleCrypter):
__type__ = "crypter"
__version__ = "2.02"
- __pattern__ = r'http://(?:www\.)?linksave\.in/(?P<id>\w+)$'
+ __pattern__ = r'http://(?:www\.)?linksave\.in/(?P<ID>\w+)$'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -44,7 +44,7 @@ class LinkSaveIn(SimpleCrypter):
def decrypt(self, pyfile):
# Init
self.package = pyfile.package()
- self.fileid = re.match(self.__pattern__, pyfile.url).group('id')
+ self.fileid = re.match(self.__pattern__, pyfile.url).group('ID')
# Request package
self.html = self.load(pyfile.url)
diff --git a/module/plugins/crypter/LixIn.py b/module/plugins/crypter/LixIn.py
index 50ad217d4..d899d58c7 100644
--- a/module/plugins/crypter/LixIn.py
+++ b/module/plugins/crypter/LixIn.py
@@ -19,9 +19,9 @@ class LixIn(Crypter):
__authors__ = [("spoob", "spoob@pyload.org")]
- CAPTCHA_PATTERN = r'<img src="(?P<image>captcha_img\.php\?.*?)"'
+ CAPTCHA_PATTERN = r'<img src="(captcha_img\.php\?.*?)"'
SUBMIT_PATTERN = r'value=\'continue.*?\''
- LINK_PATTERN = r'name="ifram" src="(?P<link>.*?)"'
+ LINK_PATTERN = r'name="ifram" src="(.*?)"'
def decrypt(self, pyfile):
@@ -31,7 +31,7 @@ class LixIn(Crypter):
if m is None:
self.error(_("Unable to identify file ID"))
- id = m.group("ID")
+ id = m.group('ID')
self.logDebug("File id is %s" % id)
self.html = self.load(url, decode=True)
@@ -46,7 +46,7 @@ class LixIn(Crypter):
m = re.search(self.CAPTCHA_PATTERN, self.html)
if m:
self.logDebug("Trying captcha")
- captcharesult = self.decryptCaptcha("http://lix.in/" + m.group("image"))
+ captcharesult = self.decryptCaptcha("http://lix.in/" + m.group(1))
self.html = self.load(url, decode=True,
post={"capt": captcharesult, "submit": "submit", "tiny": id})
else:
@@ -58,5 +58,5 @@ class LixIn(Crypter):
if m is None:
self.error(_("Unable to find destination url"))
else:
- self.urls = [m.group("link")]
+ self.urls = [m.group(1)]
self.logDebug("Found link %s, adding to package" % self.urls[0])
diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py
index ada8d0728..5209ebf09 100644
--- a/module/plugins/crypter/MultiUpOrg.py
+++ b/module/plugins/crypter/MultiUpOrg.py
@@ -24,7 +24,7 @@ class MultiUpOrg(SimpleCrypter):
def getLinks(self):
- m_type = re.match(self.__pattern__, self.pyfile.url).group("TYPE")
+ m_type = re.match(self.__pattern__, self.pyfile.url).group('TYPE')
if m_type == "project":
pattern = r'\n(http://www\.multiup\.org/(?:en|fr)/download/.*)'
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index 1d572e538..8b7214157 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -15,7 +15,7 @@ class NCryptIn(Crypter):
__type__ = "crypter"
__version__ = "1.33"
- __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?P<type>folder|link|frame)-([^/\?]+)'
+ __pattern__ = r'http://(?:www\.)?ncrypt\.in/(?P<TYPE>folder|link|frame)-([^/\?]+)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -80,7 +80,7 @@ class NCryptIn(Crypter):
def isSingleLink(self):
- link_type = re.match(self.__pattern__, self.pyfile.url).group('type')
+ link_type = re.match(self.__pattern__, self.pyfile.url).group('TYPE')
return link_type in ("link", "frame")
diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py
index 94a73cded..5933839ec 100644
--- a/module/plugins/crypter/RelinkUs.py
+++ b/module/plugins/crypter/RelinkUs.py
@@ -16,7 +16,7 @@ class RelinkUs(Crypter):
__type__ = "crypter"
__version__ = "3.11"
- __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<id>.+)'
+ __pattern__ = r'http://(?:www\.)?relink\.us/(f/|((view|go)\.php\?id=))(?P<ID>.+)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -50,9 +50,9 @@ class RelinkUs(Crypter):
DLC_LINK_REGEX = r'<a href=".*?" class="dlc_button" target="_blank">'
DLC_DOWNLOAD_URL = r'http://www.relink.us/download.php'
- WEB_FORWARD_REGEX = r'getFile\(\'(?P<link>.+)\'\)'
+ WEB_FORWARD_REGEX = r'getFile\(\'(.+)\'\)'
WEB_FORWARD_URL = r'http://www.relink.us/frame.php'
- WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(?P<link>.+)"></iframe>'
+ WEB_LINK_REGEX = r'<iframe name="Container" height="100%" frameborder="no" width="100%" src="(.+)"></iframe>'
def setup(self):
@@ -100,7 +100,7 @@ class RelinkUs(Crypter):
def initPackage(self, pyfile):
- self.fileid = re.match(self.__pattern__, pyfile.url).group('id')
+ self.fileid = re.match(self.__pattern__, pyfile.url).group('ID')
self.package = pyfile.package()
self.password = self.getPassword()
@@ -241,7 +241,7 @@ class RelinkUs(Crypter):
self.logDebug("Decrypting Web link %d, %s" % (index + 1, url))
res = self.load(url, decode=True)
- link = re.search(self.WEB_LINK_REGEX, res).group('link')
+ link = re.search(self.WEB_LINK_REGEX, res).group(1)
package_links.append(link)
diff --git a/module/plugins/crypter/TurbobitNetFolder.py b/module/plugins/crypter/TurbobitNetFolder.py
index 64fcefac6..c6734c997 100644
--- a/module/plugins/crypter/TurbobitNetFolder.py
+++ b/module/plugins/crypter/TurbobitNetFolder.py
@@ -39,7 +39,7 @@ class TurbobitNetFolder(SimpleCrypter):
def getLinks(self):
- id = re.match(self.__pattern__, self.pyfile.url).group("ID")
+ id = re.match(self.__pattern__, self.pyfile.url).group('ID')
fixurl = lambda id: "http://turbobit.net/%s.html" % id
return map(fixurl, self._getLinks(id))
diff --git a/module/plugins/crypter/UploadedToFolder.py b/module/plugins/crypter/UploadedToFolder.py
index 3e77d73a9..0a71add70 100644
--- a/module/plugins/crypter/UploadedToFolder.py
+++ b/module/plugins/crypter/UploadedToFolder.py
@@ -12,7 +12,7 @@ class UploadedToFolder(SimpleCrypter):
__type__ = "crypter"
__version__ = "0.42"
- __pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<id>\w+)'
+ __pattern__ = r'http://(?:www\.)?(uploaded|ul)\.(to|net)/(f|folder|list)/(?P<ID>\w+)'
__config__ = [("use_subfolder", "bool", "Save package to subfolder", True),
("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
@@ -21,7 +21,7 @@ class UploadedToFolder(SimpleCrypter):
__authors__ = [("stickell", "l.stickell@yahoo.it")]
- PLAIN_PATTERN = r'<small class="date"><a href="(?P<plain>[\w/]+)" onclick='
+ PLAIN_PATTERN = r'<small class="date"><a href="([\w/]+)" onclick='
NAME_PATTERN = r'<title>(?P<N>.+?)<'
@@ -30,7 +30,7 @@ class UploadedToFolder(SimpleCrypter):
if m is None:
self.error(_("PLAIN_PATTERN not found"))
- plain_link = urljoin("http://uploaded.net/", m.group('plain'))
+ plain_link = urljoin("http://uploaded.net/", m.group(1))
return self.load(plain_link).split('\n')[:-1]
diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py
index c66f94753..73ebf5fb3 100644
--- a/module/plugins/crypter/YoutubeBatch.py
+++ b/module/plugins/crypter/YoutubeBatch.py
@@ -96,8 +96,8 @@ class YoutubeBatch(Crypter):
def decrypt(self, pyfile):
m = re.match(self.__pattern__, pyfile.url)
- m_id = m.group("ID")
- m_type = m.group("TYPE")
+ m_id = m.group('ID')
+ m_type = m.group('TYPE')
if m_type == "user":
self.logDebug("Url recognized as Channel")