diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-07-06 19:00:03 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-07-06 19:00:03 +0200 |
commit | aba96db5e5864703e834a035f524df7405dbe389 (patch) | |
tree | 91f07e5aa2c7e5d5482acaadb83d5c0460b1baee /module | |
parent | Compute wait time using secondsToMidnight (diff) | |
download | pyload-aba96db5e5864703e834a035f524df7405dbe389.tar.xz |
Remove two dead plugins
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/accounts/ReloadCc.py | 75 | ||||
-rw-r--r-- | module/plugins/accounts/Vipleech4uCom.py | 41 | ||||
-rw-r--r-- | module/plugins/hooks/ReloadCc.py | 67 | ||||
-rw-r--r-- | module/plugins/hooks/Vipleech4uCom.py | 80 | ||||
-rw-r--r-- | module/plugins/hoster/ReloadCc.py | 115 | ||||
-rw-r--r-- | module/plugins/hoster/Vipleech4uCom.py | 82 |
6 files changed, 7 insertions, 453 deletions
diff --git a/module/plugins/accounts/ReloadCc.py b/module/plugins/accounts/ReloadCc.py deleted file mode 100644 index af23d9936..000000000 --- a/module/plugins/accounts/ReloadCc.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.Account import Account - -from module.common.json_layer import json_loads - -from module.network.HTTPRequest import BadHeader - - -class ReloadCc(Account): - __name__ = "ReloadCc" - __version__ = "0.3" - __type__ = "account" - __description__ = """Reload.cc account plugin""" - - __author_name__ = "Reload Team" - __author_mail__ = "hello@reload.cc" - - def loadAccountInfo(self, user, req): - - # Get user data from reload.cc - status = self.getAccountStatus(user, req) - - # Parse account info - account_info = {"validuntil": float(status['msg']['expires']), - "pwdhash": status['msg']['hash'], - "trafficleft": -1} - - return account_info - - def login(self, user, data, req): - - # Get user data from reload.cc - status = self.getAccountStatus(user, req) - - if not status: - raise Exception("There was an error upon logging in to Reload.cc!") - - # Check if user and password are valid - if status['status'] != "ok": - self.wrongPassword() - - def getAccountStatus(self, user, req): - # Use reload.cc API v1 to retrieve account info and return the parsed json answer - query_params = dict( - via='pyload', - v=1, - get_traffic='true', - user=user - ) - - try: - query_params.update(dict(hash=self.infos[user]['pwdhash'])) - except Exception: - query_params.update(dict(pwd=self.accounts[user]['password'])) - - try: - answer = req.load("http://api.reload.cc/login", get=query_params) - except BadHeader, e: - if e.code == 400: - raise Exception("There was an unknown error within the Reload.cc plugin.") - elif e.code == 401: - self.wrongPassword() - elif e.code == 402: - self.expired(user) - elif e.code == 403: - raise Exception("Your account is disabled. Please contact the Reload.cc support!") - elif e.code == 409: - self.empty(user) - elif e.code == 503: - self.logInfo("Reload.cc is currently in maintenance mode! Please check again later.") - self.wrongPassword() - return None - - return json_loads(answer) diff --git a/module/plugins/accounts/Vipleech4uCom.py b/module/plugins/accounts/Vipleech4uCom.py deleted file mode 100644 index 1e8463456..000000000 --- a/module/plugins/accounts/Vipleech4uCom.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -import re -from time import mktime, strptime - -from module.plugins.Account import Account - - -class Vipleech4uCom(Account): - __name__ = "Vipleech4uCom" - __version__ = "0.1" - __type__ = "account" - __description__ = """Vipleech4u.com account plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - STATUS_PATTERN = re.compile(r'status.*?<\s*?strong\s*?>[^<]*?vip[^<]*?<', re.I) - VALIDUNTIL_PATTERN = re.compile(r'valid\s*?until.*?<\s*?strong\s*?>([^<]*?)<', re.I) - - def loadAccountInfo(self, user, req): - response = req.load("http://vipleech4u.com", decode=True) - status = self.STATUS_PATTERN.search(response) - - validuntil = self.VALIDUNTIL_PATTERN.search(response) - if validuntil: - validuntil = validuntil.group(1) - - if status and validuntil: - print status - print validuntil - return {"trafficleft": -1, "validuntil": mktime(strptime("%s 23:59" % validuntil, "%d-%m-%Y %H:%M"))} - else: - return {"premium": False} - - def login(self, user, data, req): - self.loginname = user - self.password = data["password"] - post_data = {'action': 'login', 'user': self.loginname, 'pass': self.password} - req.load("http://vipleech4u.com/login.php") - response = req.load("http://vipleech4u.com/login.php", post=post_data, decode=True) - if 'Username or Password are incorrect' in response: - self.wrongPassword() diff --git a/module/plugins/hooks/ReloadCc.py b/module/plugins/hooks/ReloadCc.py deleted file mode 100644 index 9960a2699..000000000 --- a/module/plugins/hooks/ReloadCc.py +++ /dev/null @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.internal.MultiHoster import MultiHoster - -from module.common.json_layer import json_loads -from module.network.RequestFactory import getURL - - -class ReloadCc(MultiHoster): - __name__ = "ReloadCc" - __version__ = "0.3" - __type__ = "hook" - __description__ = """Reload.cc hook plugin""" - - __config__ = [("activated", "bool", "Activated", False), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] - - __author_name__ = "Reload Team" - __author_mail__ = "hello@reload.cc" - - interval = 0 # Disable periodic calls - - def getHoster(self): - # If no accounts are available there will be no hosters available - if not self.account or not self.account.canUse(): - print "ReloadCc: No accounts available" - return [] - - # Get account data - (user, data) = self.account.selectAccount() - - # Get supported hosters list from reload.cc using the json API v1 - query_params = dict( - via='pyload', - v=1, - get_supported='true', - get_traffic='true', - user=user - ) - - try: - query_params.update(dict(hash=self.account.infos[user]['pwdhash'])) - except Exception: - query_params.update(dict(pwd=data['password'])) - - answer = getURL("http://api.reload.cc/login", get=query_params) - data = json_loads(answer) - - # If account is not valid thera are no hosters available - if data['status'] != "ok": - print "ReloadCc: Status is not ok: %s" % data['status'] - return [] - - # Extract hosters from json file - return data['msg']['supportedHosters'] - - def coreReady(self): - # Get account plugin and check if there is a valid account available - self.account = self.core.accountManager.getAccountPlugin("ReloadCc") - if not self.account.canUse(): - self.account = None - self.logError("Please add a valid reload.cc account first and restart pyLoad.") - return - - # Run the overwriten core ready which actually enables the multihoster hook - return MultiHoster.coreReady(self) diff --git a/module/plugins/hooks/Vipleech4uCom.py b/module/plugins/hooks/Vipleech4uCom.py deleted file mode 100644 index b2156b017..000000000 --- a/module/plugins/hooks/Vipleech4uCom.py +++ /dev/null @@ -1,80 +0,0 @@ -# -*- coding: utf-8 -*- -import re - -from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster - - -class Vipleech4uCom(MultiHoster): - __name__ = "Vipleech4uCom" - __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__ = """Vipleech4u.com 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 = { - 'depositfiles': ['depositfiles.com', 'dfiles.eu'], - 'uploaded': ['uploaded.to', 'uploaded.net', 'ul.to'], - 'rapidggator': ['rapidgator.net'], # they have a typo it's called rapidgator - 'freakshare': ['freakshare.net', 'freakshare.com'], - 'filefactory': ['filefactory.com'], - 'bitshare': ['bitshare.com'], - 'share-online': ['share-online.biz', 'egoshare.com'], - 'youtube': ['youtube.com'], - 'turbobit': ['turbobit.net', 'unextfiles.com'], - 'firedrive': ['firedrive.com', 'putlocker.com'], - 'filepost': ['filepost.com', 'fp.io'], - 'netload': ['netload.in'], - 'uploadhero': ['uploadhero.com'], - 'ryushare': ['ryushare.com'], - } - - #check if the list is still valid - 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/ReloadCc.py b/module/plugins/hoster/ReloadCc.py deleted file mode 100644 index ed1b21aa3..000000000 --- a/module/plugins/hoster/ReloadCc.py +++ /dev/null @@ -1,115 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.plugins.Hoster import Hoster - -from module.common.json_layer import json_loads - -from module.network.HTTPRequest import BadHeader - - -class ReloadCc(Hoster): - __name__ = "ReloadCc" - __version__ = "0.5" - __type__ = "hoster" - __description__ = """Reload.cc hoster plugin""" - - # Since we want to allow the user to specify the list of hoster to use we let MultiHoster.coreReady - # create the regex patterns for us using getHosters in our ReloadCc hook. - __pattern__ = None - - __author_name__ = "Reload Team" - __author_mail__ = "hello@reload.cc" - - def process(self, pyfile): - # Check account - if not self.account or not self.account.canUse(): - self.logError(_("Please enter your %s account or deactivate this plugin") % "reload.cc") - self.fail("No valid reload.cc account provided") - - # In some cases hostsers do not supply us with a filename at download, so we - # are going to set a fall back filename (e.g. for freakshare or xfileshare) - pyfile.name = pyfile.name.split('/').pop() # Remove everthing before last slash - - # Correction for automatic assigned filename: Removing html at end if needed - suffix_to_remove = ["html", "htm", "php", "php3", "asp", "shtm", "shtml", "cfml", "cfm"] - temp = pyfile.name.split('.') - if temp.pop() in suffix_to_remove: - pyfile.name = ".".join(temp) - - # Get account data - (user, data) = self.account.selectAccount() - - query_params = dict( - via='pyload', - v=1, - user=user, - uri=pyfile.url - ) - - try: - query_params.update(dict(hash=self.account.infos[user]['pwdhash'])) - except Exception: - query_params.update(dict(pwd=data['password'])) - - try: - answer = self.load("http://api.reload.cc/dl", get=query_params) - except BadHeader, e: - if e.code == 400: - self.fail("The URI is not supported by Reload.cc.") - elif e.code == 401: - self.fail("Wrong username or password") - elif e.code == 402: - self.fail("Your account is inactive. A payment is required for downloading!") - elif e.code == 403: - self.fail("Your account is disabled. Please contact the Reload.cc support!") - elif e.code == 409: - self.logWarning("The hoster seems to be a limited hoster and you've used your daily traffic for this hoster: %s" % pyfile.url) - # Wait for 6 hours and retry up to 4 times => one day - self.retry(4, 6 * 60 * 60, "Limited hoster traffic limit exceeded") - elif e.code == 429: - # Too many connections, wait 2 minutes and try again - self.retry(5, 2 * 60, "Too many concurrent connections") - elif e.code == 503: - # Retry in 10 minutes - self.retry(wait_time=10 * 60, - reason="Reload.cc is currently in maintenance mode! Please check again later.") - else: - self.fail( - "Internal error within Reload.cc. Please contact the Reload.cc support for further information.") - return - - data = json_loads(answer) - - # Check status and decide what to do - status = data.get('status', None) - if status == "ok": - conn_limit = data.get('msg', 0) - # API says these connections are limited - # Make sure this limit is used - the download will fail if not - if conn_limit > 0: - try: - self.limitDL = int(conn_limit) - except ValueError: - self.limitDL = 1 - else: - self.limitDL = 0 - - try: - self.download(data['link'], disposition=True) - except BadHeader, e: - if e.code == 404: - self.fail("File Not Found") - elif e.code == 412: - self.fail("File access password is wrong") - elif e.code == 417: - self.fail("Password required for file access") - elif e.code == 429: - # Too many connections, wait 2 minutes and try again - self.retry(5, 2 * 60, "Too many concurrent connections") - else: - self.fail( - "Internal error within Reload.cc. Please contact the Reload.cc support for further information." - ) - return - else: - self.fail("Internal error within Reload.cc. Please contact the Reload.cc support for further information.") diff --git a/module/plugins/hoster/Vipleech4uCom.py b/module/plugins/hoster/Vipleech4uCom.py index 53768a430..5e0613be1 100644 --- a/module/plugins/hoster/Vipleech4uCom.py +++ b/module/plugins/hoster/Vipleech4uCom.py @@ -1,84 +1,16 @@ # -*- coding: utf-8 -*- -import re +from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo -from module.plugins.Hoster import Hoster - -class Vipleech4uCom(Hoster): +class Vipleech4uCom(DeadHoster): __name__ = "Vipleech4uCom" - __version__ = "0.1" + __version__ = "0.2" __type__ = "hoster" - __pattern__ = r"http://vipleech4u.com/manager.php" + __pattern__ = r"http://(?:www\.)?vipleech4u\.com/manager\.php" __description__ = """Vipleech4u.com hoster plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - FILENAME_PATTERN = re.compile(r'name\s*?=\s*?["\']filename["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I) - HOST_PATTERN = re.compile(r'name\s*?=\s*?["\']host["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I) - PATH_PATTERN = re.compile(r'name\s*?=\s*?["\']path["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I) - REFERER_PATTERN = re.compile(r'name\s*?=\s*?["\']referer["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I) - LINK_PATTERN = re.compile(r'name\s*?=\s*?["\']link["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', re.I) - COOKIE_PATTERN = re.compile(r'name\s*?=\s*?["\']cookie["\'][^>]*?value\s*?=\s*?["\'](.*?)["\']', 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 - - if re.match(self.__pattern__, new_url): - self.fail("Can't handle vipleech4u links.") - - #upload the link which has to be loaded - page = self.load('http://vipleech4u.com/generator.php', post={'links': new_url, 'ddl': 'no'}) - - #switch to the manager and see what's happening - page = self.load('http://vipleech4u.com/unrestrict.php', get={'link': new_url, 'premium_acc': 'on'}) - - if re.search(r'You have generated maximum links available to you today', page, re.I): - self.fail('Daily limit reached.') - - filename = self.FILENAME_PATTERN.search(page) - host = self.HOST_PATTERN.search(page) - path = self.PATH_PATTERN.search(page) - referer = self.REFERER_PATTERN.search(page) - link = self.LINK_PATTERN.search(page) - cookie = self.COOKIE_PATTERN.search(page) - - #build the post-dictionary - post_dict = {} - - if filename: - post_dict.update({'filename': filename.group(1)}) - if host: - post_dict.update({'host': host.group(1)}) - if path: - post_dict.update({'path': path.group(1)}) - if referer: - post_dict.update({'referer': referer.group(1)}) - if link: - post_dict.update({'link': link.group(1)}) - if cookie: - post_dict.update({'cookie': cookie.group(1)}) - - if not post_dict: - self.logDebug('Get an empty post_dict. Strange.') - - self.setWait(5) - self.wait() - self.logDebug("Unrestricted URL: " + str(post_dict)) - - self.download('http://vipleech4u.com/unrestrict.php', post=post_dict, disposition=True) + __author_name__ = "Kagenoshin" + __author_mail__ = "kagenoshin@gmx.ch" - check = self.checkDownload({"bad": "<html"}) - if check == "bad": - self.retry(24, 150, 'Bad file downloaded') +getInfo = create_getInfo(Vipleech4uCom) |