summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/RarefileNet.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/RarefileNet.py')
-rw-r--r--module/plugins/hoster/RarefileNet.py35
1 files changed, 12 insertions, 23 deletions
diff --git a/module/plugins/hoster/RarefileNet.py b/module/plugins/hoster/RarefileNet.py
index 7dd4164f6..2be952efe 100644
--- a/module/plugins/hoster/RarefileNet.py
+++ b/module/plugins/hoster/RarefileNet.py
@@ -2,35 +2,24 @@
import re
-from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
-from module.utils import html_unescape
+from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo
-class RarefileNet(XFileSharingPro):
- __name__ = "RarefileNet"
- __type__ = "hoster"
- __pattern__ = r'http://(?:www\.)?rarefile.net/\w{12}'
- __version__ = "0.03"
- __description__ = """Rarefile.net hoster plugin"""
- __author_name__ = "zoidberg"
- __author_mail__ = "zoidberg@mujmail.cz"
+class RarefileNet(XFSHoster):
+ __name__ = "RarefileNet"
+ __type__ = "hoster"
+ __version__ = "0.09"
+
+ __pattern__ = r'http://(?:www\.)?rarefile\.net/\w{12}'
- HOSTER_NAME = "rarefile.net"
+ __description__ = """Rarefile.net hoster plugin"""
+ __license__ = "GPLv3"
+ __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
- FILE_NAME_PATTERN = r'<td><font color="red">(?P<N>.*?)</font></td>'
- FILE_SIZE_PATTERN = r'<td>Size : (?P<S>.+?)&nbsp;'
- LINK_PATTERN = r'<a href="(?P<link>[^"]+)">(?P=link)</a>'
- def setup(self):
- self.resumeDownload = self.multiDL = self.premium
+ HOSTER_DOMAIN = "rarefile.net"
- def handleCaptcha(self, inputs):
- captcha_div = re.search(r'<b>Enter code.*?<div.*?>(.*?)</div>', self.html, re.S).group(1)
- self.logDebug(captcha_div)
- numerals = re.findall('<span.*?padding-left\s*:\s*(\d+).*?>(\d)</span>', 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
+ LINK_PATTERN = r'<a href="(.+?)">\1</a>'
getInfo = create_getInfo(RarefileNet)