From 942437162dabde1fa2d35452c76061889f47ec90 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Tue, 20 Dec 2011 18:40:01 +0100 Subject: update bloody mediafire, fix share-rapid file info --- module/plugins/hoster/EasybytezCom.py | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 module/plugins/hoster/EasybytezCom.py (limited to 'module/plugins/hoster/EasybytezCom.py') diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py new file mode 100644 index 000000000..5858dd935 --- /dev/null +++ b/module/plugins/hoster/EasybytezCom.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + @author: zoidberg +""" + +import re +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + +class EasybytezCom(SimpleHoster): + __name__ = "EasybytezCom" + __type__ = "hoster" + __pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w+).*" + __version__ = "0.01" + __description__ = """easybytez.com""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + # shares code with TurbouploadCom + + FILE_NAME_PATTERN = r'[^<]+ \((?P[^<]+)\)' + FILE_OFFLINE_PATTERN = r'

File Not Found

' + + FORM_INPUT_PATTERN = r']* name="([^"]+)" value="([^"]*)">' + WAIT_PATTERN = r'[^>]*>(\d+) seconds' + + def handleFree(self): + self.download(self.pyfile.url, post = self.getPostParameters(), ref = True, cookies = True) + + def getPostParameters(self): + inputs = dict(re.findall(self.FORM_INPUT_PATTERN, self.html)) + self.logDebug(inputs) + inputs['method_free'] = "Free Download" + inputs['referer'] = self.pyfile.url + if 'method_premium' in inputs: del inputs['method_premium'] + + self.html = self.load(self.pyfile.url, post = inputs, ref = True, cookies = True) + inputs = dict(re.findall(self.FORM_INPUT_PATTERN, self.html)) + self.logDebug(inputs) + + found = re.search(self.WAIT_PATTERN, self.html) + self.setWait(int(found.group(1)) + 1 if found else 60) + self.wait() + + return inputs + +getInfo = create_getInfo(EasybytezCom) \ No newline at end of file -- cgit v1.2.3