diff options
Diffstat (limited to 'pyload/plugin')
22 files changed, 50 insertions, 61 deletions
diff --git a/pyload/plugin/captcha/ReCaptcha.py b/pyload/plugin/captcha/ReCaptcha.py index b1dfd813c..410cb19de 100644 --- a/pyload/plugin/captcha/ReCaptcha.py +++ b/pyload/plugin/captcha/ReCaptcha.py @@ -137,26 +137,26 @@ class ReCaptcha(Captcha): millis, rpc = self._prepareTimeAndRpc() html = self.plugin.req.load("https://www.google.com/recaptcha/api2/anchor", - get={'k': key, - 'hl': language, - 'v': vers, - 'usegapi': "1", - 'jsh': "%s#id=IO_%s" % (jsh, millis), - 'parent': parent, - 'pfname': "", + get={'k' : key, + 'hl' : language, + 'v' : vers, + 'usegapi' : "1", + 'jsh' : "%s#id=IO_%s" % (jsh, millis), + 'parent' : parent, + 'pfname' : "", 'rpctoken': rpc}) token1 = re.search(r'id="recaptcha-token" value="(.*?)">', html) self.logDebug("Token #1: %s" % token1.group(1)) html = self.plugin.req.load("https://www.google.com/recaptcha/api2/frame", - get={'c': token1.group(1), - 'hl': language, - 'v': vers, - 'bg': botguardstring, - 'k': key, + get={'c' : token1.group(1), + 'hl' : language, + 'v' : vers, + 'bg' : botguardstring, + 'k' : key, 'usegapi': "1", - 'jsh': jsh}).decode('unicode-escape') + 'jsh' : jsh}).decode('unicode-escape') token2 = re.search(r'"finput","(.*?)",', html) self.logDebug("Token #2: %s" % token2.group(1)) @@ -165,10 +165,10 @@ class ReCaptcha(Captcha): self.logDebug("Token #3: %s" % token3.group(1)) html = self.plugin.req.load("https://www.google.com/recaptcha/api2/reload", - post={'k': key, - 'c': token2.group(1), + post={'k' : key, + 'c' : token2.group(1), 'reason': "fi", - 'fbg': token3.group(1)}) + 'fbg' : token3.group(1)}) token4 = re.search(r'"rresp","(.*?)",', html) self.logDebug("Token #4: %s" % token4.group(1)) @@ -186,12 +186,12 @@ class ReCaptcha(Captcha): timeToSolveMore = timeToSolve + int(float("0." + str(randint(1, 99999999))) * 500) html = self.plugin.req.load("https://www.google.com/recaptcha/api2/userverify", - post={'k': key, - 'c': token4.group(1), + post={'k' : key, + 'c' : token4.group(1), 'response': response, - 't': timeToSolve, - 'ct': timeToSolveMore, - 'bg': botguardstring}) + 't' : timeToSolve, + 'ct' : timeToSolveMore, + 'bg' : botguardstring}) token5 = re.search(r'"uvresp","(.*?)",', html) self.logDebug("Token #5: %s" % token5.group(1)) diff --git a/pyload/plugin/crypter/NCryptIn.py b/pyload/plugin/crypter/NCryptIn.py index a7f1b0bb9..02427190e 100644 --- a/pyload/plugin/crypter/NCryptIn.py +++ b/pyload/plugin/crypter/NCryptIn.py @@ -6,7 +6,7 @@ import re from Crypto.Cipher import AES from pyload.plugin.Crypter import Crypter -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha class NCryptIn(Crypter): diff --git a/pyload/plugin/crypter/SafelinkingNet.py b/pyload/plugin/crypter/SafelinkingNet.py index 720766d22..a949d17b1 100644 --- a/pyload/plugin/crypter/SafelinkingNet.py +++ b/pyload/plugin/crypter/SafelinkingNet.py @@ -6,7 +6,7 @@ from BeautifulSoup import BeautifulSoup from pyload.utils import json_loads from pyload.plugin.Crypter import Crypter -from pyload.plugin.captcha import SolveMedia +from pyload.plugin.captcha.SolveMedia import SolveMedia class SafelinkingNet(Crypter): diff --git a/pyload/plugin/hoster/BitshareCom.py b/pyload/plugin/hoster/BitshareCom.py index ef65b1b80..471951a9e 100644 --- a/pyload/plugin/hoster/BitshareCom.py +++ b/pyload/plugin/hoster/BitshareCom.py @@ -4,7 +4,7 @@ from __future__ import with_statement import re -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/CatShareNet.py b/pyload/plugin/hoster/CatShareNet.py index 08666e573..f60208cc4 100644 --- a/pyload/plugin/hoster/CatShareNet.py +++ b/pyload/plugin/hoster/CatShareNet.py @@ -2,7 +2,7 @@ import re -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/CrockoCom.py b/pyload/plugin/hoster/CrockoCom.py index b2748f6b1..4bf549574 100644 --- a/pyload/plugin/hoster/CrockoCom.py +++ b/pyload/plugin/hoster/CrockoCom.py @@ -2,7 +2,7 @@ import re -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/DateiTo.py b/pyload/plugin/hoster/DateiTo.py index c91557747..251036ad2 100644 --- a/pyload/plugin/hoster/DateiTo.py +++ b/pyload/plugin/hoster/DateiTo.py @@ -2,7 +2,7 @@ import re -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/DepositfilesCom.py b/pyload/plugin/hoster/DepositfilesCom.py index 7dfd9dd5e..451adbdc0 100644 --- a/pyload/plugin/hoster/DepositfilesCom.py +++ b/pyload/plugin/hoster/DepositfilesCom.py @@ -4,7 +4,7 @@ import re from urllib import unquote -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/DlFreeFr.py b/pyload/plugin/hoster/DlFreeFr.py index 127462d61..568b6dfce 100644 --- a/pyload/plugin/hoster/DlFreeFr.py +++ b/pyload/plugin/hoster/DlFreeFr.py @@ -5,7 +5,7 @@ import re from pyload.network.Browser import Browser from pyload.network.CookieJar import CookieJar -from pyload.plugin.captcha import AdYouLike +from pyload.plugin.captcha.AdYouLike import AdYouLike from pyload.plugin.internal.SimpleHoster import SimpleHoster, replace_patterns from pyload.utils import json_loads diff --git a/pyload/plugin/hoster/FilecloudIo.py b/pyload/plugin/hoster/FilecloudIo.py index 33256b6a8..2cbc472de 100644 --- a/pyload/plugin/hoster/FilecloudIo.py +++ b/pyload/plugin/hoster/FilecloudIo.py @@ -3,7 +3,7 @@ import re from pyload.utils import json_loads -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/FilepostCom.py b/pyload/plugin/hoster/FilepostCom.py index a32b46fbb..c5cfa1521 100644 --- a/pyload/plugin/hoster/FilepostCom.py +++ b/pyload/plugin/hoster/FilepostCom.py @@ -4,7 +4,7 @@ import re import time from pyload.utils import json_loads -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/KingfilesNet.py b/pyload/plugin/hoster/KingfilesNet.py index 92942fbeb..af1d49390 100644 --- a/pyload/plugin/hoster/KingfilesNet.py +++ b/pyload/plugin/hoster/KingfilesNet.py @@ -2,7 +2,7 @@ import re -from pyload.plugin.captcha import SolveMedia +from pyload.plugin.captcha.SolveMedia import SolveMedia from pyload.plugin.internal.SimpleHoster import SimpleHoster @@ -17,8 +17,7 @@ class KingfilesNet(SimpleHoster): __description = """Kingfiles.net hoster plugin""" __license = "GPLv3" __authors = [("zapp-brannigan", "fuerst.reinje@web.de"), - ("Walter Purcaro", "vuolter@gmail.com")] - + ("Walter Purcaro", "vuolter@gmail.com")] NAME_PATTERN = r'name="fname" value="(?P<N>.+?)">' SIZE_PATTERN = r'>Size: .+?">(?P<S>[\d.,]+) (?P<U>[\w^_]+)' @@ -29,12 +28,10 @@ class KingfilesNet(SimpleHoster): LINK_FREE_PATTERN = r'var download_url = \'(.+)\';' - def setup(self): self.resumeDownload = True self.multiDL = True - def handleFree(self, pyfile): # Click the free user button post_data = {'op' : "download1", diff --git a/pyload/plugin/hoster/LoadTo.py b/pyload/plugin/hoster/LoadTo.py index 2c34b7c03..a0e4eb92e 100644 --- a/pyload/plugin/hoster/LoadTo.py +++ b/pyload/plugin/hoster/LoadTo.py @@ -6,7 +6,7 @@ import re -from pyload.plugin.captcha import SolveMedia +from pyload.plugin.captcha.SolveMedia import SolveMedia from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/LuckyShareNet.py b/pyload/plugin/hoster/LuckyShareNet.py index b23428938..7fbbbf1ea 100644 --- a/pyload/plugin/hoster/LuckyShareNet.py +++ b/pyload/plugin/hoster/LuckyShareNet.py @@ -4,7 +4,7 @@ import re from bottle import json_loads -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/NetloadIn.py b/pyload/plugin/hoster/NetloadIn.py index 5a982a055..dcfb9dcb6 100644 --- a/pyload/plugin/hoster/NetloadIn.py +++ b/pyload/plugin/hoster/NetloadIn.py @@ -8,7 +8,7 @@ from urlparse import urljoin from pyload.network.RequestFactory import getURL from pyload.plugin.Hoster import Hoster from pyload.plugin.Plugin import chunks -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha def getInfo(urls): diff --git a/pyload/plugin/hoster/OboomCom.py b/pyload/plugin/hoster/OboomCom.py index c24e4c9ab..07c40a397 100644 --- a/pyload/plugin/hoster/OboomCom.py +++ b/pyload/plugin/hoster/OboomCom.py @@ -7,7 +7,7 @@ import re from pyload.utils import json_loads from pyload.plugin.Hoster import Hoster -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha class OboomCom(Hoster): diff --git a/pyload/plugin/hoster/RapiduNet.py b/pyload/plugin/hoster/RapiduNet.py index 858e5fd09..4a7be110c 100644 --- a/pyload/plugin/hoster/RapiduNet.py +++ b/pyload/plugin/hoster/RapiduNet.py @@ -6,7 +6,7 @@ import time from pycurl import HTTPHEADER from pyload.utils import json_loads -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/ShareonlineBiz.py b/pyload/plugin/hoster/ShareonlineBiz.py index 5d671c77a..273431f99 100644 --- a/pyload/plugin/hoster/ShareonlineBiz.py +++ b/pyload/plugin/hoster/ShareonlineBiz.py @@ -7,7 +7,7 @@ from urllib import unquote from urlparse import urlparse from pyload.network.RequestFactory import getURL -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/TurbobitNet.py b/pyload/plugin/hoster/TurbobitNet.py index af28f7d74..4c07cb84f 100644 --- a/pyload/plugin/hoster/TurbobitNet.py +++ b/pyload/plugin/hoster/TurbobitNet.py @@ -10,7 +10,7 @@ from pycurl import HTTPHEADER from urllib import quote from pyload.network.RequestFactory import getURL -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster, timestamp diff --git a/pyload/plugin/hoster/UploadableCh.py b/pyload/plugin/hoster/UploadableCh.py index 9037b0250..c030c4178 100644 --- a/pyload/plugin/hoster/UploadableCh.py +++ b/pyload/plugin/hoster/UploadableCh.py @@ -2,7 +2,7 @@ import re -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/hoster/UpstoreNet.py b/pyload/plugin/hoster/UpstoreNet.py index dcbf7ea9e..544cee633 100644 --- a/pyload/plugin/hoster/UpstoreNet.py +++ b/pyload/plugin/hoster/UpstoreNet.py @@ -2,7 +2,7 @@ import re -from pyload.plugin.captcha import ReCaptcha +from pyload.plugin.captcha.ReCaptcha import ReCaptcha from pyload.plugin.internal.SimpleHoster import SimpleHoster diff --git a/pyload/plugin/internal/XFSHoster.py b/pyload/plugin/internal/XFSHoster.py index b1370eb93..532d9bea4 100644 --- a/pyload/plugin/internal/XFSHoster.py +++ b/pyload/plugin/internal/XFSHoster.py @@ -6,7 +6,8 @@ import time from random import random from urlparse import urljoin, urlparse -from pyload.plugin.captcha import ReCaptcha, SolveMedia +from pyload.plugin.captcha.ReCaptcha import ReCaptcha +from pyload.plugin.captcha.SolveMedia import SolveMedia from pyload.plugin.internal.SimpleHoster import SimpleHoster, secondsToMidnight from pyload.utils import html_unescape @@ -21,15 +22,14 @@ class XFSHoster(SimpleHoster): __description = """XFileSharing hoster plugin""" __license = "GPLv3" __authors = [("zoidberg" , "zoidberg@mujmail.cz"), - ("stickell" , "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com" )] - + ("stickell" , "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] HOSTER_DOMAIN = None TEXT_ENCODING = False DIRECT_LINK = None - MULTI_HOSTER = True #@NOTE: Should be default to False for safe, but I'm lazy... + MULTI_HOSTER = True # @NOTE: Should be default to False for safe, but I'm lazy... NAME_PATTERN = r'(Filename[ ]*:[ ]*</b>(</td><td nowrap>)?|name="fname"[ ]+value="|<[\w^_]+ class="(file)?name">)\s*(?P<N>.+?)(\s*<|")' SIZE_PATTERN = r'(Size[ ]*:[ ]*</b>(</td><td>)?|File:.*>|</font>\s*\(|<[\w^_]+ class="size">)\s*(?P<S>[\d.,]+)\s*(?P<U>[\w^_]+)' @@ -52,12 +52,10 @@ class XFSHoster(SimpleHoster): FORM_PATTERN = None FORM_INPUTS_MAP = None #: dict passed as input_names to parseHtmlForm - def setup(self): self.chunkLimit = -1 if self.premium else 1 self.resumeDownload = self.multiDL = self.premium - def prepare(self): """ Initialize important variables """ if not self.HOSTER_DOMAIN: @@ -86,7 +84,6 @@ class XFSHoster(SimpleHoster): if self.DIRECT_LINK is None: self.directDL = self.premium - def handleFree(self, pyfile): for i in xrange(1, 6): self.logDebug("Getting download link: #%d" % i) @@ -112,18 +109,16 @@ class XFSHoster(SimpleHoster): self.logError(data['op'] if 'op' in data else _("UNKNOWN")) return "" - self.link = m.group(1).strip() #@TODO: Remove .strip() in 0.4.10 - + self.link = m.group(1).strip() # @TODO: Remove .strip() in 0.4.10 def handlePremium(self, pyfile): return self.handleFree(pyfile) - def handleMulti(self, pyfile): if not self.account: self.fail(_("Only registered or premium users can use url leech feature")) - #only tested with easybytez.com + # only tested with easybytez.com self.html = self.load("http://www.%s/" % self.HOSTER_DOMAIN) action, inputs = self.parseHtmlForm() @@ -166,7 +161,7 @@ class XFSHoster(SimpleHoster): else: self.fail(stmsg) - #get easybytez.com link for uploaded file + # get easybytez.com link for uploaded file m = re.search(self.LINK_LEECH_PATTERN, self.html) if m is None: self.error(_("LINK_LEECH_PATTERN not found")) @@ -176,7 +171,6 @@ class XFSHoster(SimpleHoster): if 'location' in header: #: Direct download link self.link = header['location'] - def checkErrors(self): m = re.search(self.ERROR_PATTERN, self.html) if m is None: @@ -229,7 +223,6 @@ class XFSHoster(SimpleHoster): else: self.info.pop('error', None) - def getPostParameters(self): if self.FORM_PATTERN or self.FORM_INPUTS_MAP: action, inputs = self.parseHtmlForm(self.FORM_PATTERN or "", self.FORM_INPUTS_MAP or {}) @@ -275,7 +268,6 @@ class XFSHoster(SimpleHoster): return inputs - def handleCaptcha(self, inputs): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: |