From 35f5b61e7c49d72c13c5220940c3584edf79a4f3 Mon Sep 17 00:00:00 2001 From: Christian Plesche Date: Sun, 23 Nov 2014 20:45:56 +0100 Subject: Update NetloadIn.py changed to recaptcha, initial commit, needs rework --- module/plugins/hoster/NetloadIn.py | 203 +++++++++++++++++++------------------ 1 file changed, 103 insertions(+), 100 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 549ecb667..4efd3839b 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -1,13 +1,13 @@ +#!/usr/bin/env python # -*- coding: utf-8 -*- import re - from time import sleep, time -from module.network.RequestFactory import getURL from module.plugins.Hoster import Hoster +from module.network.RequestFactory import getURL 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) @@ -26,11 +26,10 @@ def getInfo(urls): api = getURL(apiurl + ids, decode=True) if api is None or len(api) < 10: - self.logDebug("Prefetch failed") + print "Netload prefetch: failed " return if api.find("unknown_auth") >= 0: - print - self.logDebug("Outdated auth code") + print "Netload prefetch: Outdated auth code " return result = [] @@ -42,46 +41,45 @@ def getInfo(urls): size = int(tmp[2]) except: size = 0 - result.append((tmp[1], size, 2 if tmp[3] == "online" else 1, chunk[i])) + result.append((tmp[1], size, 2 if tmp[3] == "online" else 1, chunk[i] )) except: - self.logDebug("Error while processing response: %s" % r) + print "Netload prefetch: Error while processing response: " + print r yield result class NetloadIn(Hoster): - __name__ = "NetloadIn" - __type__ = "hoster" - __version__ = "0.45" - - __pattern__ = r'https?://(?:[^/]*\.)?netload\.in/(?:datei(.*?)(?:\.htm|/)|index\.php?id=10&file_id=)' - - __description__ = """Netload.in hoster plugin""" - __license__ = "GPLv3" - __authors__ = [("spoob", "spoob@pyload.org"), - ("RaNaN", "ranan@pyload.org"), - ("Gregy", "gregy@gregy.cz")] - + __name__ = "NetloadIn" + __type__ = "hoster" + __pattern__ = r"https?://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)" + __version__ = "0.451" + __description__ = """Netload.in Download Hoster""" + __author_name__ = ("spoob", "RaNaN", "Gregy") + __author_mail__ = ("spoob@pyload.org", "ranan@pyload.org", "gregy@gregy.cz") + RECAPTCHA_KEY="6LcLJMQSAAAAAJzquPUPKNovIhbK6LpSqCjYrsR1" def setup(self): - self.multiDL = self.resumeDownload = self.premium - + self.multiDL = False + if self.premium: + self.multiDL = True + self.chunkLimit = -1 + self.resumeDownload = True def process(self, pyfile): self.url = pyfile.url self.prepare() - pyfile.setStatus("downloading") + self.pyfile.setStatus("downloading") self.proceed(self.url) - def prepare(self): self.download_api_data() - if self.api_data and self.api_data['filename']: - self.pyfile.name = self.api_data['filename'] + if self.api_data and self.api_data["filename"]: + self.pyfile.name = self.api_data["filename"] if self.premium: - self.logDebug("Use Premium Account") + self.logDebug("Netload: Use Premium Account") settings = self.load("http://www.netload.in/index.php?id=2&lang=en") if '