summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar godofdream <soilfiction@gmail.com> 2012-08-06 17:48:55 +0200
committerGravatar godofdream <soilfiction@gmail.com> 2012-08-06 17:48:55 +0200
commitc25be987a3a8d536b8323455828b83f66870d81d (patch)
tree2bd7a235925b36489dd72d259bf9d57ae10217bb /module/plugins
parentupdate czshare, warsever.cz (diff)
downloadpyload-c25be987a3a8d536b8323455828b83f66870d81d.tar.xz
update Freakshare, IcyFiles, Zippyshare, C1neon, FshareVn-Ac, Filefactory-Ac
Added BypassCaptcha - closed #647, #615, #639, #644, #562, #586, #642
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/accounts/FilefactoryCom.py6
-rw-r--r--module/plugins/accounts/FshareVn.py10
-rw-r--r--module/plugins/crypter/C1neonCom.py9
-rw-r--r--module/plugins/hooks/BypassCaptcha.py167
-rw-r--r--module/plugins/hoster/FreakshareCom.py10
-rw-r--r--module/plugins/hoster/IcyFilesCom.py4
-rw-r--r--module/plugins/hoster/ZippyshareCom.py29
7 files changed, 215 insertions, 20 deletions
diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py
index 73431b546..356c5d22a 100644
--- a/module/plugins/accounts/FilefactoryCom.py
+++ b/module/plugins/accounts/FilefactoryCom.py
@@ -23,13 +23,13 @@ from time import mktime, strptime
class FilefactoryCom(Account):
__name__ = "FilefactoryCom"
- __version__ = "0.11"
+ __version__ = "0.12"
__type__ = "account"
__description__ = """filefactory.com account plugin"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- ACCOUNT_INFO_PATTERN = r'"greenText">Premium member until<.*?datetime="(.*?)"'
+ ACCOUNT_INFO_PATTERN = r'<a href="/premium/">.*?datetime="(.*?)"'
def loadAccountInfo(self, user, req):
html = req.load("http://www.filefactory.com/member/")
@@ -51,4 +51,4 @@ class FilefactoryCom(Account):
"redirect": "/"})
if '/member/login.php?err=1' in req.http.header:
- self.wrongPassword() \ No newline at end of file
+ self.wrongPassword()
diff --git a/module/plugins/accounts/FshareVn.py b/module/plugins/accounts/FshareVn.py
index 46d2d5166..e51009f50 100644
--- a/module/plugins/accounts/FshareVn.py
+++ b/module/plugins/accounts/FshareVn.py
@@ -24,7 +24,7 @@ import re
class FshareVn(Account):
__name__ = "FshareVn"
- __version__ = "0.01"
+ __version__ = "0.02"
__type__ = "account"
__description__ = """fshare.vn account plugin"""
__author_name__ = ("zoidberg")
@@ -47,13 +47,13 @@ class FshareVn(Account):
return {"validuntil": validuntil, "trafficleft": trafficleft}
def login(self, user, data, req):
- req.http.c.setopt(REFERER, "http://www.fshare.vn/login.php")
+ req.http.c.setopt(REFERER, "https://www.fshare.vn/login.php")
- html = req.load('http://www.fshare.vn/login.php', post = {
+ html = req.load('https://www.fshare.vn/login.php', post = {
"login_password" : data['password'],
"login_useremail" : user,
- "url_refe" : "http://www.fshare.vn/login.php"
+ "url_refe" : "https://www.fshare.vn/login.php"
}, referer = True, decode = True)
if not '<img alt="VIP"' in html:
- self.wrongPassword() \ No newline at end of file
+ self.wrongPassword()
diff --git a/module/plugins/crypter/C1neonCom.py b/module/plugins/crypter/C1neonCom.py
index e9861ab54..1a0c3c90f 100644
--- a/module/plugins/crypter/C1neonCom.py
+++ b/module/plugins/crypter/C1neonCom.py
@@ -24,7 +24,7 @@ class C1neonCom(Crypter):
__name__ = "C1neonCom"
__type__ = "container"
__pattern__ = r"http://(www\.)?c1neon.com/.*?"
- __version__ = "0.02"
+ __version__ = "0.03"
__config__ = [
("changeNameS", "Packagename;Show;Season;Episode", "Rename Show by", "Show"),
("changeName", "Packagename;Movie", "Rename Movie by", "Movie"),
@@ -99,8 +99,11 @@ class C1neonCom(Crypter):
#selects the preferred hoster, after that selects any hoster (ignoring the one to ignore)
#selects only one Hoster
def getpreferred(self, hosterslist):
- hosterlist = hosterslist['d']
- if self.getConfig("useStreams"):
+ if hosterslist['u'] is not None:
+ hosterlist = hosterslist['u']
+ if hosterslist['d'] is not None:
+ hosterlist.append(hosterslist['d'])
+ if self.getConfig("useStreams") and hosterslist['s'] is not None:
hosterlist.append(hosterslist['s'])
result = []
diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py
new file mode 100644
index 000000000..892c5cca6
--- /dev/null
+++ b/module/plugins/hooks/BypassCaptcha.py
@@ -0,0 +1,167 @@
+# -*- 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 <http://www.gnu.org/licenses/>.
+
+ @author: RaNaN
+"""
+
+import base64
+
+try:
+ from json import loads
+except ImportError:
+ from simplejson import loads
+
+from thread import start_new_thread
+from pycurl import FORM_FILE, LOW_SPEED_TIME
+
+from module.network.RequestFactory import getURL, getRequest
+from module.network.HTTPRequest import BadHeader
+
+from module.plugins.Addon import Addon
+
+class BypassCaptchaException(Exception):
+ def __init__(self, err):
+ self.err = err
+
+ def getCode(self):
+ return self.err
+
+ def __str__(self):
+ return "<BypassCaptchaException %s>" % self.err
+
+ def __repr__(self):
+ return "<BypassCaptchaException %s>" % self.err
+
+class BypassCaptcha(Addon):
+ __name__ = "BypassCaptcha"
+ __version__ = "0.01"
+ __description__ = """send captchas to bypasscaptcha.com"""
+ __config__ = [("activated", "bool", "Activated", True),
+ ("key", "str", "Key", ""),
+ ("force", "bool", "Force CT even if client is connected", False),
+ __author_name__ = ("RaNaN")
+ __author_mail__ = ("RaNaN@pyload.org")
+
+ SUBMIT_URL = "http://bypasscaptcha.com/upload.php"
+ RESPOND_URL = "http://bypasscaptcha.com/check_value.php"
+ GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php"
+
+ def setup(self):
+ self.info = {}
+
+ def getCredits(self):
+ json = getURL(BypassCaptcha.GETCREDITS_URL % {"key": self.getConfig("key")})
+ response = loads(json)
+ if response[0] < 0:
+ raise BypassCaptchaException(response[1])
+ else:
+ self.logInfo(_("%s credits left") % response['Left'])
+ self.info["credits"] = response['Left']
+ return response['Left']
+
+ def submit(self, captcha, captchaType="file", match=None):
+ #if type(captcha) == str and captchaType == "file":
+ # raise BypassCaptchaException("Invalid Type")
+ assert captchaType in ("file", "url-jpg", "url-jpeg", "url-png", "url-bmp")
+
+ self.logInfo(_("submitting %s, type %s") % (captcha, captchaType))
+
+ req = getRequest()
+
+ #raise timeout threshold
+ req.c.setopt(LOW_SPEED_TIME, 80)
+
+ try:
+ img = Image.open(captcha)
+ self.logDebug("CAPTCHA IMAGE", img, img.format)
+ output = StringIO.StringIO()
+ img.save(output, "JPEG")
+ data = base64.b64encode(output.getvalue())
+ output.close()
+ except Exception, e:
+ raise BypassCaptchaException("Reading or converting captcha image failed: %s" % e)
+
+ try:
+ json = req.load(BypassCaptcha.SUBMIT_URL, post={"key": self.getConfig("key"),
+ "password": self.getConfig("passkey"),
+ "file": data,
+ "submit": "Submit",
+ "gen_task_id": 1,
+ "base64_code": 1})
+ finally:
+ req.close()
+
+ response = loads(json)
+ if response[0] < 0:
+ raise BypassCaptchaException(response[1])
+
+ ticket = response['TaskId']
+ result = response['Value']
+ self.logDebug("result %s : %s" % (ticket,result))
+
+ return ticket, result
+
+ def respond(self, ticket, success):
+ try:
+ json = getURL(BypassCaptcha.RESPOND_URL, post={ "key": self.getConfig("key"),
+ "task_id": ticket,
+ "cv": 1 if success else 0,
+ "submit": "Submit" })
+
+ response = loads(json)
+ if response[0] < 0:
+ raise BypassCaptchaException(response[1])
+
+ except BadHeader, e:
+ self.logError(_("Could not send response."), str(e))
+
+ def newCaptchaTask(self, task):
+ if not task.isTextual():
+ return False
+
+ if not self.getConfig("key"):
+ return False
+
+ if self.core.isClientConnected() and not self.getConfig("force"):
+ return False
+
+ if self.getCredits() > 0:
+ task.handler.append(self)
+ task.setWaiting(100)
+ start_new_thread(self.processCaptcha, (task,))
+
+ else:
+ self.logInfo(_("Your BypassCaptcha Account has not enough credits"))
+
+ def captchaCorrect(self, task):
+ if "TaskId" in task.data:
+ ticket = task.data["TaskId"]
+ self.respond(ticket, True)
+
+ def captchaInvalid(self, task):
+ if "TaskId" in task.data:
+ ticket = task.data["TaskId"]
+ self.respond(ticket, False)
+
+ def processCaptcha(self, task):
+ c = task.captchaFile
+ try:
+ ticket, result = self.submit(c)
+ except BypassCaptchaException, e:
+ task.error = e.getCode()
+ return
+
+ task.data["ticket"] = ticket
+ task.setResult(result) \ No newline at end of file
diff --git a/module/plugins/hoster/FreakshareCom.py b/module/plugins/hoster/FreakshareCom.py
index 29a0bda8f..56e02cbdc 100644
--- a/module/plugins/hoster/FreakshareCom.py
+++ b/module/plugins/hoster/FreakshareCom.py
@@ -9,7 +9,7 @@ class FreakshareCom(Hoster):
__name__ = "FreakshareCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?freakshare\.(net|com)/files/\S*?/"
- __version__ = "0.36"
+ __version__ = "0.37"
__description__ = """Freakshare.com Download Hoster"""
__author_name__ = ("sitacuisses","spoob","mkaay", "Toilal")
__author_mail__ = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de", "toilal.dev@gmail.com")
@@ -39,7 +39,8 @@ class FreakshareCom(Hoster):
check = self.checkDownload({"bad": "bad try",
"paralell": "> Sorry, you cant download more then 1 files at time. <",
- "empty": "Warning: Unknown: Filename cannot be empty"})
+ "empty": "Warning: Unknown: Filename cannot be empty",
+ "wrong_captcha": "Wrong Captcha!"})
if check == "bad":
self.fail("Bad Try.")
@@ -48,7 +49,10 @@ class FreakshareCom(Hoster):
self.wait()
self.retry()
if check == "empty":
- self.fail("File not downloadable")
+ self.fail("File not downloadable")
+ if check == "wrong_captcha":
+ self.invalidCaptcha()
+ self.retry()
def prepare(self):
pyfile = self.pyfile
diff --git a/module/plugins/hoster/IcyFilesCom.py b/module/plugins/hoster/IcyFilesCom.py
index 73dd5f7c9..09458732e 100644
--- a/module/plugins/hoster/IcyFilesCom.py
+++ b/module/plugins/hoster/IcyFilesCom.py
@@ -33,7 +33,7 @@ def getInfo(urls):
size = re.search(IcyFilesCom.SIZE_PATTERN, html)
if name is not None:
name = name.group(1)
- size = (size.group(1) * 1000000)
+ size = (int(size.group(1)) * 1000000)
result.append((name, size, 2, url))
yield result
@@ -42,7 +42,7 @@ class IcyFilesCom(Hoster):
__name__ = "IcyFilesCom"
__type__ = "hoster"
__pattern__ = r"http://(?:www\.)?icyfiles\.com/.*"
- __version__ = "0.02"
+ __version__ = "0.03"
__description__ = """IcyFiles.com plugin - free only"""
__author_name__ = ("godofdream")
__author_mail__ = ("soilfiction@gmail.com")
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index 0dde85e2c..001e2b296 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -10,7 +10,7 @@ class ZippyshareCom(SimpleHoster):
__name__ = "ZippyshareCom"
__type__ = "hoster"
__pattern__ = r"(?P<HOST>http://www\d{0,2}\.zippyshare.com)/v(?:/|iew.jsp.*key=)(?P<KEY>\d+)"
- __version__ = "0.33"
+ __version__ = "0.35"
__description__ = """Zippyshare.com Download Hoster"""
__author_name__ = ("spoob", "zoidberg")
__author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz")
@@ -100,8 +100,29 @@ class ZippyshareCom(SimpleHoster):
try:
swf_data = self.load(swf_url)
os.write(fd, swf_data)
-
- p = subprocess.Popen(['swfdump', '-a', fpath], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+
+ # used for detecting if swfdump is instelled
+ def is_exe(ppath):
+ return os.path.isfile(ppath) and os.access(ppath, os.X_OK)
+
+ program = 'swfdump'
+ swfdump = None
+ ppath, pname = os.path.split(program)
+ if ppath:
+ if is_exe(program):
+ swfdump = program
+ else:
+ for ppath in os.environ["PATH"].split(os.pathsep):
+ exe_file = os.path.join(ppath, program)
+ if is_exe(exe_file):
+ swfdump = exe_file
+ if swfdump is None:
+ self.fail("swfdump missing - install swftools")
+ # ok swfdump is installed move on...
+
+
+
+ p = subprocess.Popen([swfdump, '-a', fpath], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if err:
@@ -151,4 +172,4 @@ class ZippyshareCom(SimpleHoster):
return url
-getInfo = create_getInfo(ZippyshareCom) \ No newline at end of file
+getInfo = create_getInfo(ZippyshareCom)