summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/LomafileCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-07 23:40:50 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 10:58:42 +0200
commit887ad58e4c6c20b992311bbdf931bcd18e73d384 (patch)
treef31beb241bacca0bfea4c1acc4e9ace813755cef /module/plugins/hoster/LomafileCom.py
parent[AccountManager] Fixed #733 (diff)
parent[File4safe] distributing LINK_PATTERN (diff)
downloadpyload-887ad58e4c6c20b992311bbdf931bcd18e73d384.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/Account.py module/plugins/AccountManager.py module/plugins/Hook.py module/plugins/OCR.py module/plugins/Plugin.py module/plugins/PluginManager.py module/plugins/ReCaptcha.py module/plugins/accounts/Ftp.py module/plugins/accounts/Http.py module/plugins/internal/MultiHoster.py module/plugins/ocr/GigasizeCom.py module/plugins/ocr/LinksaveIn.py module/plugins/ocr/NetloadIn.py module/plugins/ocr/ShareonlineBiz.py
Diffstat (limited to 'module/plugins/hoster/LomafileCom.py')
-rw-r--r--module/plugins/hoster/LomafileCom.py61
1 files changed, 61 insertions, 0 deletions
diff --git a/module/plugins/hoster/LomafileCom.py b/module/plugins/hoster/LomafileCom.py
new file mode 100644
index 000000000..372d42fd3
--- /dev/null
+++ b/module/plugins/hoster/LomafileCom.py
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+
+class LomafileCom(SimpleHoster):
+ __name__ = "LomafileCom"
+ __type__ = "hoster"
+ __version__ = "0.2"
+
+ __pattern__ = r'https?://lomafile\.com/.+/[\w\.]+'
+
+ __description__ = """ Lomafile.com hoster plugin """
+ __author_name__ = "nath_schwarz"
+ __author_mail__ = "nathan.notwhite@gmail.com"
+
+ FILE_NAME_PATTERN = r'Filename:[^>]*>(?P<N>[\w\.]+)'
+ FILE_SIZE_PATTERN = r'\((?P<S>\d+)\s(?P<U>\w+)\)'
+ OFFLINE_PATTERN = r'Software error'
+
+
+ def handleFree(self):
+ for _ in range(3):
+ captcha_id = re.search(r'src="http://lomafile\.com/captchas/(?P<id>\w+)\.jpg"', self.html)
+ if not captcha_id:
+ self.parseError("Unable to parse captcha id.")
+ else:
+ captcha_id = captcha_id.group("id")
+
+ form_id = re.search(r'name="id" value="(?P<id>\w+)"', self.html)
+ if not form_id:
+ self.parseError("Unable to parse form id")
+ else:
+ form_id = form_id.group("id")
+
+ captcha = self.decryptCaptcha("http://lomafile.com/captchas/" + captcha_id + ".jpg")
+
+ self.wait(60)
+
+ self.html = self.load(self.pyfile.url, post={
+ "op": "download2",
+ "id": form_id,
+ "rand": captcha_id,
+ "code": captcha,
+ "down_direct": "1"})
+
+ download_url = re.search(r'http://[\d\.]+:\d+/d/\w+/[\w\.]+', self.html)
+ if download_url is None:
+ self.invalidCaptcha()
+ self.logDebug("Invalid captcha.")
+ else:
+ download_url = download_url.group(0)
+ self.logDebug("Download URL: %s" % download_url)
+ self.download(download_url)
+ else:
+ self.fail("Invalid captcha-code entered.")
+
+
+getInfo = create_getInfo(LomafileCom)