From 5a1cd89497598daffdd643114db7a033cf46a807 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Wed, 7 Mar 2012 22:27:53 +0100 Subject: AllDebrid plugin by Andy, Voigt; closed #555; generic XFileSharingPro plugin --- module/plugins/hoster/RarefileNet.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 module/plugins/hoster/RarefileNet.py (limited to 'module/plugins/hoster/RarefileNet.py') diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py new file mode 100644 index 000000000..8339d40eb --- /dev/null +++ b/module/plugins/hoster/RarefileNet.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +import re +from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo +from module.utils import html_unescape + +class RarefileNet(XFileSharingPro): + __name__ = "RarefileNet" + __type__ = "hoster" + __pattern__ = r"http://(?:\w*\.)*rarefile.net/\w{12}" + __version__ = "0.01" + __description__ = """Rarefile.net hoster plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + FILE_NAME_PATTERN = r'(?P.*?)' + FILE_SIZE_PATTERN = r'Size : (?P.+?) ' + + def handleCaptcha(self, inputs): + captcha_div = re.search(r'Enter code.*?(.*?)', self.html, re.S).group(1) + self.logDebug(captcha_div) + numerals = re.findall('(\d)', html_unescape(captcha_div)) + inputs['code'] = "".join([a[1] for a in sorted(numerals, key = lambda num: int(num[0]))]) + self.logDebug("CAPTCHA", inputs['code'], numerals) + return 3 + +getInfo = create_getInfo(RarefileNet) \ No newline at end of file -- cgit v1.2.3