summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/LomafileCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-07 19:54:24 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-07 19:54:24 +0200
commitbe459e0b409dcd5e04edd75be374bd35d4018e9a (patch)
tree3f73e813d20608ff0d23eada8214a5124c85bff5 /pyload/plugins/hoster/LomafileCom.py
parentMerge branch 'stable' into 0.4.10 (diff)
parentNew __authors__ key replaces __author_name__ and __author_mail__ + Whitespace... (diff)
downloadpyload-be459e0b409dcd5e04edd75be374bd35d4018e9a.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: module/plugins/internal/CaptchaService.py pyload/plugins/account/EasybytezCom.py pyload/plugins/account/TusfilesNet.py pyload/plugins/base/OCR.py pyload/plugins/crypter/MultiuploadCom.py pyload/plugins/crypter/UploadableChFolder.py pyload/plugins/hoster/DuploadOrg.py pyload/plugins/hoster/EpicShareNet.py pyload/plugins/hoster/LemUploadsCom.py pyload/plugins/hoster/LoadTo.py pyload/plugins/hoster/LomafileCom.py pyload/plugins/hoster/MegaFilesSe.py pyload/plugins/hoster/MegareleaseOrg.py pyload/plugins/hoster/PandaPlanet.py pyload/plugins/hoster/PotloadCom.py pyload/plugins/hoster/PremiumTo.py pyload/plugins/hoster/TurbobitNet.py pyload/plugins/internal/DeadCrypter.py pyload/plugins/internal/DeadHoster.py pyload/plugins/internal/SimpleCrypter.py pyload/plugins/internal/UpdateManager.py pyload/plugins/ocr/LinksaveIn.py
Diffstat (limited to 'pyload/plugins/hoster/LomafileCom.py')
-rw-r--r--pyload/plugins/hoster/LomafileCom.py66
1 files changed, 17 insertions, 49 deletions
diff --git a/pyload/plugins/hoster/LomafileCom.py b/pyload/plugins/hoster/LomafileCom.py
index 2ae6973c8..8184e9393 100644
--- a/pyload/plugins/hoster/LomafileCom.py
+++ b/pyload/plugins/hoster/LomafileCom.py
@@ -1,61 +1,29 @@
# -*- coding: utf-8 -*-
-import re
+from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
-from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-
-class LomafileCom(SimpleHoster):
+class LomafileCom(XFileSharingPro):
__name__ = "LomafileCom"
__type__ = "hoster"
- __version__ = "0.2"
+ __version__ = "0.3"
- __pattern__ = r'https?://lomafile\.com/.+/[\w\.]+'
+ __pattern__ = r'http://lomafile\.com/\w{12}'
__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 xrange(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.")
+ __authors__ = [("nath_schwarz", "nathan.notwhite@gmail.com"),
+ ("guidobelix", "guidobelix@hotmail.it")]
+
+
+ HOSTER_NAME = "lomafile.com"
+
+ FILE_NAME_PATTERN = r'<a href="http://lomafile\.com/w{12}/(?P<N>.+?)">'
+ FILE_SIZE_PATTERN = r'Size:</b></td><td>(?P<S>[\d.]+) (?P<U>\w+)'
+
+ OFFLINE_PATTERN = r'>(No such file|Software error:<)'
+ TEMP_OFFLINE_PATTERN = r'The page may have been renamed, removed or be temporarily unavailable.<'
+
+ CAPTCHA_URL_PATTERN = r'(http://lomafile\.com/captchas/[^"\']+)'
getInfo = create_getInfo(LomafileCom)