diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/accounts/MegaRapidoNet.py | 47 | ||||
-rw-r--r-- | module/plugins/hooks/MegaRapidoNet.py | 117 | ||||
-rw-r--r-- | module/plugins/hoster/MegaRapidoNet.py | 81 |
3 files changed, 245 insertions, 0 deletions
diff --git a/module/plugins/accounts/MegaRapidoNet.py b/module/plugins/accounts/MegaRapidoNet.py new file mode 100644 index 000000000..55b52907c --- /dev/null +++ b/module/plugins/accounts/MegaRapidoNet.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +import re +from time import mktime, strptime, time + +from module.plugins.Account import Account + + +class MegaRapidoNet(Account): + __name__ = "MegaRapidoNet" + __version__ = "0.01" + __type__ = "account" + __description__ = """Megarapido.net account plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + VALIDUNTIL_PATTERN = re.compile(r'<\s*?div[^>]*?class\s*?=\s*?[\'"]premium_index[\'"][^>]*>[^<]*?<[^>]*?b[^>]*>\s*?TEMPO\s*?PREMIUM[^<]*<[^>]*?/b[^>]*>\s*?(\d*)[^\d]*?DIAS[^\d]*?(\d*)[^\d]*?HORAS[^\d]*?(\d*)[^\d]*?MINUTOS[^\d]*?(\d*)[^\d]*?SEGUNDOS', re.I) + USER_ID_PATTERN= re.compile(r' <\s*?div[^>]*?class\s*?=\s*?["\']checkbox_compartilhar["\'][^>]*>[^<]*<\s*?input[^>]*?name\s*?=\s*?["\']usar["\'][^>]*>[^<]*<\s*?input[^>]*?name\s*?=\s*?["\']user["\'][^>]*?value\s*?=\s*?["\'](.*?)\s*?["\']', re.I) + + def loadAccountInfo(self, user, req): + response = req.load("http://megarapido.net/gerador", decode=True) + + validuntil = self.VALIDUNTIL_PATTERN.search(response) + if validuntil: + #hier weitermachen!!! (müssen umbedingt die zeit richtig machen damit! (sollte aber möglich)) + validuntil = time() + int(validuntil.group(1))*24*3600 + int(validuntil.group(2))*3600 + int(validuntil.group(3))*60 + int(validuntil.group(4)) + + if validuntil: + return {"trafficleft": -1, "validuntil": validuntil} + else: + return {"premium": False} + + def login(self, user, data, req): + self.loginname = user + self.password = data["password"] + post_data = {'login': self.loginname, 'senha': self.password} + req.load("http://megarapido.net/login") + response = req.load("http://megarapido.net/painel_user/ajax/logar.php", post=post_data, decode=True) + response = req.load("http://megarapido.net/gerador") + if 'sair' not in response.lower(): + self.wrongPassword() + else: + user_id = self.USER_ID_PATTERN.search(response) + if user_id: + user_id = user_id.group(1) + self.setStorage("MegarapidoNet_userID", user_id) + else: + self.fail("Couldn't find the user ID")
\ No newline at end of file diff --git a/module/plugins/hooks/MegaRapidoNet.py b/module/plugins/hooks/MegaRapidoNet.py new file mode 100644 index 000000000..e59b94adf --- /dev/null +++ b/module/plugins/hooks/MegaRapidoNet.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +import re + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster + + +class MegaRapidoNet(MultiHoster): + __name__ = "MegaRapidoNet" + __version__ = "0.01" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Megarapido.net hook plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + HOSTER_PATTERN = re.compile(r'align\s*?=\s*?["\']*?left.*?<\s*?strong\s*?>([^<]*?)<', re.I) + + def getHoster(self): + hosters = { + '1fichier': [],#leave it there are so many possible addresses? + '1st-files': ['1st-files.com'], + '2shared': ['2shared.com'], + '4shared': ['4shared.com', '4shared-china.com'], + 'asfile': ['http://asfile.com/'], + 'bitshare': ['bitshare.com'], + 'brupload': ['brupload.net'], + 'crocko': ['crocko.com','easy-share.com'], + 'dailymotion': ['dailymotion.com'], + 'depfile': ['depfile.com'], + 'depositfiles': ['depositfiles.com', 'dfiles.eu'], + 'dizzcloud': ['dizzcloud.com'], + 'dl.dropbox': [], + 'extabit': ['extabit.com'], + 'extmatrix': ['extmatrix.com'], + 'facebook': [], + 'file4go': ['file4go.com'], + 'filecloud': ['filecloud.io','ifile.it','mihd.net'], + 'filefactory': ['filefactory.com'], + 'fileom': ['fileom.com'], + 'fileparadox': ['fileparadox.in'], + 'filepost': ['filepost.com', 'fp.io'], + 'filerio': ['filerio.in','filerio.com','filekeen.com'], + 'filesflash': ['filesflash.com'], + 'firedrive': ['firedrive.com', 'putlocker.com'], + 'flashx': [], + 'freakshare': ['freakshare.net', 'freakshare.com'], + 'gigasize': ['gigasize.com'], + 'hipfile': ['hipfile.com'], + 'junocloud': ['junocloud.me'], + 'letitbit': ['letitbit.net','shareflare.net'], + 'mediafire': ['mediafire.com'], + 'mega': ['mega.co.nz'], + 'megashares': ['megashares.com'], + 'metacafe': ['metacafe.com'], + 'netload': ['netload.in'], + 'oboom': ['oboom.com'], + 'rapidgator': ['rapidgator.net'], + 'rapidshare': ['rapidshare.com'], + 'rarefile': ['rarefile.net'], + 'ryushare': ['ryushare.com'], + 'sendspace': ['sendspace.com'], + 'turbobit': ['turbobit.net', 'unextfiles.com'], + 'uploadable': ['uploadable.ch'], + 'uploadbaz': ['uploadbaz.com'], + 'uploaded': ['uploaded.to', 'uploaded.net', 'ul.to'], + 'uploadhero': ['uploadhero.com'], + 'uploading': ['uploading.com'], + 'uptobox': ['uptobox.com'], + 'xvideos': ['xvideos.com'], + 'youtube': ['youtube.com'] + } + + #check if the list is still valid + #has to be added! self.check_for_new_or_removed_hosters(hosters) + + #build list + hoster_list = [] + + for item in hosters.itervalues(): + hoster_list.extend(item) + + return hoster_list + + def check_for_new_or_removed_hosters(self, hosters): + #get the old hosters + old_hosters = hosters.keys() + + #load the current hosters from vipleech4u.com + page = getURL('http://vipleech4u.com/hosts.php') + current_hosters = self.HOSTER_PATTERN.findall(page) + current_hosters = [x.lower() for x in current_hosters] + + #let's look for new hosters + new_hosters = [] + + for hoster in current_hosters: + if not hoster in old_hosters: + new_hosters.append(hoster) + + #let's look for removed hosters + removed_hosters = [] + + for hoster in old_hosters: + if not hoster in current_hosters: + removed_hosters.append(hoster) + + if new_hosters: + self.logDebug('The following new hosters were found on vipleech4u.com: %s' % str(new_hosters)) + + if removed_hosters: + self.logDebug('The following hosters were removed from vipleech4u.com: %s' % str(removed_hosters)) + + if not (new_hosters and removed_hosters): + self.logDebug('The hoster list is still valid.') diff --git a/module/plugins/hoster/MegaRapidoNet.py b/module/plugins/hoster/MegaRapidoNet.py new file mode 100644 index 000000000..2978c72e1 --- /dev/null +++ b/module/plugins/hoster/MegaRapidoNet.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.Hoster import Hoster +from random import randint + +def random_with_N_digits(n): + rand = "0." + not_zero = 0 + for i in range(1,n+1): + r = randint(0,9) + if(r > 0): + not_zero += 1 + rand += str(r) + + if not_zero > 0: + return rand + else: + return random_with_N_digits(n) + +class MegaRapidoNet(Hoster): + __name__ = "MegaRapidoNet" + __version__ = "0.01" + __type__ = "hoster" + __pattern__ = r"http://(?:www\.)*?(?:[^\.]+)\.megarapido\.net/\?file=" + __description__ = """Megarapido.net hoster plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + DOWNLOAD_LINK_PATTERN = re.compile(r'<\s*?a[^>]*?title\s*?=\s*?["\'][^"\']*?download["\'][^>]*?href=["\']([^"\']*)', re.I) + ERROR_MESSAGE_PATTERN = re.compile(r'<\s*?div[^>]*?class\s*?=\s*?["\']?alert-message error[^>]*>([^<]*)',re.I) + + def setup(self): + self.resumeDownload = self.multiDL = True + self.chunkLimit = 1 + + def process(self, pyfile): + if not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "vipleech4u.com") + self.fail("No vipleech4u.com account provided") + + self.logDebug("Old URL: %s" % pyfile.url) + + new_url = pyfile.url + + #load userID + user_id = self.getStorage("MegarapidoNet_userID") + + #upload the link which has to be loaded + if not re.match(self.__pattern__, new_url): + page = self.load("http://megarapido.net/gerar.php", post={"rand":random_with_N_digits(16), "urllist":new_url, "links":new_url, "exibir":"normal", "usar":"premium", "user":user_id, "autoreset":""}) + if "desloga e loga novamente para gerar seus links" in page.lower(): + self.fail("Restart pyload, because you have logged in at another place.") + + error_1 = self.ERROR_MESSAGE_PATTERN.search(page) + if error_1: + self.fail("%s" %error_1.group(1)) + + download_link = self.DOWNLOAD_LINK_PATTERN.search(page) + if download_link: + download_link = download_link.group(1) + else: + self.fail("Couldn't find a download link.") + else: + download_link = new_url + + #tests (todo) + if re.search(r'You have generated maximum links available to you today', page, re.I): + self.fail('Daily limit reached.') + + self.setWait(5) + self.wait() + self.logDebug("Unrestricted URL: " + download_link) + + self.download(download_link, disposition=True) + + check = self.checkDownload({"bad": "<html"}) + + if check == "bad": + self.retry(24, 150, 'Bad file downloaded') |