From 189f9e90d2814713e343ea340d6ada86fc217f3e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 27 May 2015 23:35:23 +0200 Subject: [NetloadIn] Mark dead (temp) --- module/plugins/accounts/NetloadIn.py | 63 -------- module/plugins/crypter/NetfolderIn.py | 64 +------- module/plugins/hoster/NetloadIn.py | 292 +--------------------------------- 3 files changed, 13 insertions(+), 406 deletions(-) delete mode 100644 module/plugins/accounts/NetloadIn.py diff --git a/module/plugins/accounts/NetloadIn.py b/module/plugins/accounts/NetloadIn.py deleted file mode 100644 index 066174a28..000000000 --- a/module/plugins/accounts/NetloadIn.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- - -import re -import time - -from module.plugins.Account import Account - - -class NetloadIn(Account): - __name__ = "NetloadIn" - __type__ = "account" - __version__ = "0.24" - - __description__ = """Netload.in account plugin""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - - - def api_response(self, id, password, req): - return req.load("http://api.netload.in/user_info.php", - get={'auth' : "BVm96BWDSoB4WkfbEhn42HgnjIe1ilMt", - 'user_id' : id, - 'user_password': password}).strip() - - - def loadAccountInfo(self, user, req): - validuntil = None - trafficleft = -1 - premium = False - - html = self.api_response(user, self.getAccountData(user)['password'], req) - - if html == "-1": - premium = True - - elif html == "0": - validuntil = -1 - - else: - try: - validuntil = time.mktime(time.strptime(html, "%Y-%m-%d %H:%M")) - - except Exception, e: - self.logError(e) - - else: - self.logDebug("Valid until: %s" % validuntil) - - if validuntil > time.mktime(time.gmtime()): - premium = True - else: - validuntil = -1 - - return {'validuntil' : validuntil, - 'trafficleft': trafficleft, - 'premium' : premium} - - - def login(self, user, data, req): - html = self.api_response(user, data['password'], req) - - if not html or re.search(r'disallowed_agent|unknown_auth|login_failed', html): - self.wrongPassword() diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py index ac76c059e..32d59af03 100644 --- a/module/plugins/crypter/NetfolderIn.py +++ b/module/plugins/crypter/NetfolderIn.py @@ -1,19 +1,15 @@ # -*- coding: utf-8 -*- -import re +from module.plugins.internal.DeadCrypter import DeadCrypter, create_getInfo -from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo - -class NetfolderIn(SimpleCrypter): +class NetfolderIn(DeadCrypter): __name__ = "NetfolderIn" __type__ = "crypter" - __version__ = "0.72" + __version__ = "0.73" - __pattern__ = r'http://(?:www\.)?netfolder\.in/(folder\.php\?folder_id=)?(?P\w+)(?(1)|/\w+)' - __config__ = [("use_premium" , "bool", "Use premium account if available" , True), - ("use_subfolder" , "bool", "Save package to subfolder" , True), - ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] + __pattern__ = r'http://(?:www\.)?netfolder\.(in|me)/(folder\.php\?folder_id=)?(?P\w+)(?(1)|/\w+)' + __config__ = [] #@TODO: Remove in 0.4.10 __description__ = """NetFolder.in decrypter plugin""" __license__ = "GPLv3" @@ -21,54 +17,4 @@ class NetfolderIn(SimpleCrypter): ("fragonib", "fragonib[AT]yahoo[DOT]es")] - NAME_PATTERN = r'
Inhalt des Ordners (?P.+)
' - - - def prepare(self): - super(NetfolderIn, self).prepare() - - # Check for password protection - if self.isPasswordProtected(): - self.html = self.submitPassword() - if not self.html: - self.fail(_("Incorrect password, please set right password on Add package form and retry")) - - - def isPasswordProtected(self): - if '' in html: - self.logDebug("Incorrect password, please set right password on Edit package form and retry") - return None - - return html - - - def getLinks(self): - links = re.search(r'name="list" value="(.*?)"', self.html).group(1).split(",") - self.logDebug("Package has %d links" % len(links)) - return links - - getInfo = create_getInfo(NetfolderIn) diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index cab7bd88f..1c56a705c 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -1,297 +1,21 @@ # -*- coding: utf-8 -*- -import re -import time -import urlparse +from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo -from module.network.RequestFactory import getURL -from module.plugins.Hoster import Hoster -from module.plugins.Plugin import chunks -from module.plugins.internal.CaptchaService import ReCaptcha - -def getInfo(urls): - ## returns list of tupels (name, size (in bytes), status (see FileDatabase), url) - - apiurl = "http://api.netload.in/info.php" - id_regex = re.compile(NetloadIn.__pattern__) - urls_per_query = 80 - - for chunk in chunks(urls, urls_per_query): - ids = "" - for url in chunk: - match = id_regex.search(url) - if match: - ids = ids + match.group('ID') + ";" - - api = getURL(apiurl, - get={'auth' : "Zf9SnQh9WiReEsb18akjvQGqT0I830e8", - 'bz' : 1, - 'md5' : 1, - 'file_id': ids}, - decode=True) - - if api is None or len(api) < 10: - self.logDebug("Prefetch failed") - return - - if api.find("unknown_auth") >= 0: - self.logDebug("Outdated auth code") - return - - result = [] - - for i, r in enumerate(api.splitlines()): - try: - tmp = r.split(";") - - try: - size = int(tmp[2]) - except Exception: - size = 0 - - result.append((tmp[1], size, 2 if tmp[3] == "online" else 1, chunk[i] )) - - except Exception: - self.logDebug("Error while processing response: %s" % r) - - yield result - - -class NetloadIn(Hoster): +class NetloadIn(DeadHoster): __name__ = "NetloadIn" __type__ = "hoster" - __version__ = "0.49" + __version__ = "0.50" - __pattern__ = r'https?://(?:www\.)?netload\.in/(?Pdatei|index\.php\?id=10&file_id=)(?P\w+)' + __pattern__ = r'https?://(?:www\.)?netload\.(in|me)/(?Pdatei|index\.php\?id=10&file_id=)(?P\w+)' + __config__ = [] #@TODO: Remove in 0.4.10 __description__ = """Netload.in hoster plugin""" __license__ = "GPLv3" __authors__ = [("spoob", "spoob@pyload.org"), ("RaNaN", "ranan@pyload.org"), - ("Gregy", "gregy@gregy.cz")] - - - RECAPTCHA_KEY = "6LcLJMQSAAAAAJzquPUPKNovIhbK6LpSqCjYrsR1" - - - def setup(self): - self.multiDL = self.resumeDownload = self.premium - - - def process(self, pyfile): - self.url = pyfile.url - - self.prepare() - - pyfile.setStatus("downloading") - - self.proceed(self.url) - - - def prepare(self): - self.api_load() - - if self.api_data and self.api_data['filename']: - self.pyfile.name = self.api_data['filename'] - - if self.premium: - self.logDebug("Use Premium Account") - - settings = self.load("http://www.netload.in/index.php", get={'id': 2, 'lang': "en"}) - - if '