From c6a54414f340efe1d649c72786ec25c505e94172 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Dec 2014 19:03:23 +0100 Subject: [RestartSlow] New fixed version re-added --- module/plugins/hooks/RestartSlow.py | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 module/plugins/hooks/RestartSlow.py (limited to 'module') diff --git a/module/plugins/hooks/RestartSlow.py b/module/plugins/hooks/RestartSlow.py new file mode 100644 index 000000000..587799235 --- /dev/null +++ b/module/plugins/hooks/RestartSlow.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- + +import pycurl + +from module.plugins.Hook import Hook + + +class RestartSlow(Hook): + __name__ = "RestartSlow" + __type__ = "hook" + __version__ = "0.02" + + __config__ = [("free_limit" , "int" , "Transfer speed threshold in kilobytes" , 100 ), + ("free_time" , "int" , "Sample interval in minutes" , 5 ), + ("premium_limit", "int" , "Transfer speed threshold for premium download in kilobytes", 300 ), + ("premium_time" , "int" , "Sample interval for premium download in minutes" , 2 ), + ("safe_mode" , "bool", "Don't restart if download is not resumable" , True)] + + __description__ = """Restart slow downloads""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + event_list = ["downloadStarts"] + + + def setup(self): + self.info = {'chunk': {}} + + + def initPeriodical(self): + pass + + + def periodical(self): + if not self.pyfile.req.dl: + return + + if self.getConfig("safe_mode") and not self.pyfile.plugin.resumeDownload: + time = 30 + limit = 5 + else: + type = "premium" if self.pyfile.plugin.premium else "free" + time = max(30, self.getConfig("%s_time" % type) * 60) + limit = max(5, self.getConfig("%s_limit" % type) * 1024) + + chunks = [chunk for chunk in self.pyfile.req.dl.chunks \ + if chunk.id not in self.info['chunk'] or self.info['chunk'][chunk.id] not is (time, limit)] + + for chunk in chunks: + chunk.c.setopt(pycurl.LOW_SPEED_TIME , time) + chunk.c.setopt(pycurl.LOW_SPEED_LIMIT, limit) + + self.info['chunk'][chunk.id] = (time, limit) + + + def downloadStarts(self, pyfile, url, filename): + if self.cb or (self.getConfig("safe_mode") and not pyfile.plugin.resumeDownload): + return + + super(RestartSlow, self).initPeriodical() -- cgit v1.2.3 From 78e26bfd3b940034748256e4d0237e0ae5d33d60 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Dec 2014 23:19:08 +0100 Subject: [SkipRev] Update (2) --- module/plugins/hooks/SkipRev.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'module') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 76a48a255..f3edcc9dc 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- -import re - from urllib import unquote -from urlparse import urljoin, urlparse +from urlparse import urlparse from module.plugins.Hook import Hook from module.plugins.Plugin import SkipDownload @@ -12,11 +10,9 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" - __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True), - ("tokeep", "int" , "Min number of rev files to keep for package" , 1), - ("unskip", "bool", "Restart a skipped rev when download fails" , True)] + __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] __description__ = """Skip files ending with extension rev""" __license__ = "GPLv3" @@ -55,11 +51,11 @@ class SkipRev(Hook): tokeep = self.getConfig("tokeep") - if tokeep > 0: + if tokeep: saved = [True for link in pyfile.package().getChildren() \ if link.name.endswith(".rev") and (link.hasStatus("finished") or link.hasStatus("downloading"))].count(True) - if saved < tokeep: + if not saved or saved < tokeep: #: keep one rev at least in auto mode return pyfile.setCustomStatus("SkipRev", "skipped") @@ -67,15 +63,15 @@ class SkipRev(Hook): def downloadFailed(self, pyfile): - if self.getConfig("auto") is False: - - if self.getConfig("unskip") is False: - return + tokeep = self.getConfig("tokeep") - if not pyfile.name.endswith(".rev"): - return + if not tokeep: + return for link in pyfile.package().getChildren(): if link.hasStatus("skipped") and link.name.endswith(".rev"): - link.setCustomStatus("unskipped", "queued") + if tokeep > -1 or pyfile.name.endswith(".rev"): + link.setStatus("queued") + else: + link.setCustomStatus("unskipped", "queued") return -- cgit v1.2.3 From e4c9e4ffc9e3f6bd6b16ce83796dc3d275d544f7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 01:13:05 +0100 Subject: Don't start unused periodical in some addons --- module/plugins/hooks/BypassCaptcha.py | 7 ++++++- module/plugins/hooks/Captcha9kw.py | 7 ++++++- module/plugins/hooks/CaptchaBrotherhood.py | 7 ++++++- module/plugins/hooks/Checksum.py | 7 ++++++- module/plugins/hooks/ClickAndLoad.py | 7 ++++++- module/plugins/hooks/DeathByCaptcha.py | 7 ++++++- module/plugins/hooks/DownloadScheduler.py | 7 ++++++- module/plugins/hooks/ExpertDecoders.py | 7 ++++++- module/plugins/hooks/ExternalScripts.py | 7 ++++++- module/plugins/hooks/ExtractArchive.py | 7 ++++++- module/plugins/hooks/IRCInterface.py | 7 ++++++- module/plugins/hooks/ImageTyperz.py | 7 ++++++- module/plugins/hooks/LinkdecrypterCom.py | 7 ++++++- module/plugins/hooks/MergeFiles.py | 7 ++++++- module/plugins/hooks/MultiHome.py | 7 ++++++- module/plugins/hooks/SkipRev.py | 5 +++++ module/plugins/hooks/UnSkipOnFail.py | 7 ++++++- module/plugins/hooks/WindowsPhoneToastNotify.py | 7 ++++++- module/plugins/hooks/XFileSharingPro.py | 7 ++++++- 19 files changed, 113 insertions(+), 18 deletions(-) (limited to 'module') diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 7e1ea6424..a32de7f42 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -29,7 +29,7 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Hook): __name__ = "BypassCaptcha" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("force", "bool", "Force BC even if client is connected", False), ("passkey", "password", "Passkey", "")] @@ -48,6 +48,11 @@ class BypassCaptcha(Hook): GETCREDITS_URL = "http://bypasscaptcha.com/ex_left.php" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/Captcha9kw.py b/module/plugins/hooks/Captcha9kw.py index ead8aec9a..33ad00c49 100755 --- a/module/plugins/hooks/Captcha9kw.py +++ b/module/plugins/hooks/Captcha9kw.py @@ -17,7 +17,7 @@ from module.plugins.Hook import Hook class Captcha9kw(Hook): __name__ = "Captcha9kw" __type__ = "hook" - __version__ = "0.25" + __version__ = "0.26" __config__ = [("activated" , "bool" , "Activated" , True ), ("ssl" , "bool" , "Use HTTPS" , True ), @@ -41,6 +41,11 @@ class Captcha9kw(Hook): API_URL = "http://www.9kw.eu/index.cgi" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 if self.getConfig("ssl"): diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 2ebeb1734..b6e38d8bb 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -39,7 +39,7 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Hook): __name__ = "CaptchaBrotherhood" __type__ = "hook" - __version__ = "0.05" + __version__ = "0.06" __config__ = [("username", "str", "Username", ""), ("force", "bool", "Force CT even if client is connected", False), @@ -54,6 +54,11 @@ class CaptchaBrotherhood(Hook): API_URL = "http://www.captchabrotherhood.com/" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index eeda2d849..18036e020 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -40,7 +40,7 @@ def computeChecksum(local_file, algorithm): class Checksum(Hook): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("check_checksum", "bool", "Check checksum? (If False only size will be verified)", True), ("check_action", "fail;retry;nothing", "What to do if check fails?", "retry"), @@ -62,6 +62,11 @@ class Checksum(Hook): 'default': r'^(?P[0-9A-Fa-f]+)\s+\*?(?P.+)$'} + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): if not self.getConfig("check_checksum"): self.logInfo(_("Checksum validation is disabled in plugin configuration")) diff --git a/module/plugins/hooks/ClickAndLoad.py b/module/plugins/hooks/ClickAndLoad.py index c9c0f60c0..27d99c71c 100644 --- a/module/plugins/hooks/ClickAndLoad.py +++ b/module/plugins/hooks/ClickAndLoad.py @@ -52,7 +52,7 @@ def forward(source, destination): class ClickAndLoad(Hook): __name__ = "ClickAndLoad" __type__ = "hook" - __version__ = "0.22" + __version__ = "0.23" __config__ = [("activated", "bool", "Activated", True), ("extern", "bool", "Allow external link adding", False)] @@ -63,6 +63,11 @@ class ClickAndLoad(Hook): ("mkaay", "mkaay@mkaay.de")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): self.port = int(self.config['webinterface']['port']) if self.config['webinterface']['activated']: diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index df09769ce..f03ac4567 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -52,7 +52,7 @@ class DeathByCaptchaException(Exception): class DeathByCaptcha(Hook): __name__ = "DeathByCaptcha" __type__ = "hook" - __version__ = "0.03" + __version__ = "0.04" __config__ = [("username", "str", "Username", ""), ("passkey", "password", "Password", ""), @@ -67,6 +67,11 @@ class DeathByCaptcha(Hook): API_URL = "http://api.dbcapi.me/api/" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/DownloadScheduler.py b/module/plugins/hooks/DownloadScheduler.py index 14884426f..4996e212d 100644 --- a/module/plugins/hooks/DownloadScheduler.py +++ b/module/plugins/hooks/DownloadScheduler.py @@ -10,7 +10,7 @@ from module.plugins.Hook import Hook class DownloadScheduler(Hook): __name__ = "DownloadScheduler" __type__ = "hook" - __version__ = "0.21" + __version__ = "0.22" __config__ = [("timetable", "str", "List time periods as hh:mm full or number(kB/s)", "0:00 full, 7:00 250, 10:00 0, 17:00 150"), @@ -22,6 +22,11 @@ class DownloadScheduler(Hook): ("stickell", "l.stickell@yahoo.it")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.cb = None # callback to scheduler job; will be by removed hookmanager when hook unloaded diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 1b9459eb6..1784a270c 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -15,7 +15,7 @@ from module.plugins.Hook import Hook class ExpertDecoders(Hook): __name__ = "ExpertDecoders" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" __config__ = [("force", "bool", "Force CT even if client is connected", False), ("passkey", "password", "Access key", "")] @@ -29,6 +29,11 @@ class ExpertDecoders(Hook): API_URL = "http://www.fasttypers.org/imagepost.ashx" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 5db2037fa..a35e47c03 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -13,7 +13,7 @@ from module.utils import save_join class ExternalScripts(Hook): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.24" + __version__ = "0.25" __config__ = [("activated", "bool", "Activated", True)] @@ -29,6 +29,11 @@ class ExternalScripts(Hook): "allDownloadsFinished", "allDownloadsProcessed"] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.scripts = {} diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 07db13aa1..fc77dbdf6 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -59,7 +59,7 @@ from module.utils import save_join, fs_encode class ExtractArchive(Hook): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "0.18" + __version__ = "0.19" __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), @@ -83,6 +83,11 @@ class ExtractArchive(Hook): event_list = ["allDownloadsProcessed"] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.plugins = [] self.passwords = [] diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 98edc2f7f..efd4e411d 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -20,7 +20,7 @@ from module.utils import formatSize class IRCInterface(Thread, Hook): __name__ = "IRCInterface" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("host", "str", "IRC-Server Address", "Enter your server here!"), ("port", "int", "IRC-Server Port", 6667), @@ -44,6 +44,11 @@ class IRCInterface(Thread, Hook): self.setDaemon(True) + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): self.abort = False self.more = [] diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index b00c5118f..f89d64c37 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -33,7 +33,7 @@ class ImageTyperzException(Exception): class ImageTyperz(Hook): __name__ = "ImageTyperz" __type__ = "hook" - __version__ = "0.04" + __version__ = "0.05" __config__ = [("username", "str", "Username", ""), ("passkey", "password", "Password", ""), @@ -50,6 +50,11 @@ class ImageTyperz(Hook): GETCREDITS_URL = "http://captchatypers.com/Forms/RequestBalance.ashx" + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/LinkdecrypterCom.py b/module/plugins/hooks/LinkdecrypterCom.py index 0c5f6e754..b0ce335d0 100644 --- a/module/plugins/hooks/LinkdecrypterCom.py +++ b/module/plugins/hooks/LinkdecrypterCom.py @@ -10,13 +10,18 @@ from module.utils import remove_chars class LinkdecrypterCom(Hook): __name__ = "LinkdecrypterCom" __type__ = "hook" - __version__ = "0.20" + __version__ = "0.21" __description__ = """Linkdecrypter.com hook plugin""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): try: self.loadPatterns() diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index e6f8bb26f..767209d21 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -12,7 +12,7 @@ from module.utils import save_join, fs_encode class MergeFiles(Hook): __name__ = "MergeFiles" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("activated", "bool", "Activated", True)] @@ -24,6 +24,11 @@ class MergeFiles(Hook): BUFFER_SIZE = 4096 + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): # nothing to do pass diff --git a/module/plugins/hooks/MultiHome.py b/module/plugins/hooks/MultiHome.py index 228e6027d..105a42abd 100644 --- a/module/plugins/hooks/MultiHome.py +++ b/module/plugins/hooks/MultiHome.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class MultiHome(Hook): __name__ = "MultiHome" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("interfaces", "str", "Interfaces", "None")] @@ -17,6 +17,11 @@ class MultiHome(Hook): __authors__ = [("mkaay", "mkaay@mkaay.de")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.register = {} self.interfaces = [] diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index f3edcc9dc..609bb4197 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -19,6 +19,11 @@ class SkipRev(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def _setup(self): super(self.pyfile.plugin, self).setup() if self.pyfile.hasStatus("skipped"): diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index f97d12431..d3baccfc2 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -10,7 +10,7 @@ from module.utils import fs_encode class UnSkipOnFail(Hook): __name__ = "UnSkipOnFail" __type__ = "hook" - __version__ = "0.01" + __version__ = "0.02" __config__ = [("activated", "bool", "Activated", True)] @@ -19,6 +19,11 @@ class UnSkipOnFail(Hook): __authors__ = [("hagg", None)] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def downloadFailed(self, pyfile): pyfile_name = basename(pyfile.name) pid = pyfile.package().id diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneToastNotify.py index 053ea47d0..ed305778c 100644 --- a/module/plugins/hooks/WindowsPhoneToastNotify.py +++ b/module/plugins/hooks/WindowsPhoneToastNotify.py @@ -9,7 +9,7 @@ from module.plugins.Hook import Hook class WindowsPhoneToastNotify(Hook): __name__ = "WindowsPhoneToastNotify" __type__ = "hook" - __version__ = "0.02" + __version__ = "0.03" __config__ = [("force", "bool", "Force even if client is connected", False), ("pushId", "str", "pushId", ""), @@ -21,6 +21,11 @@ class WindowsPhoneToastNotify(Hook): __authors__ = [("Andy Voigt", "phone-support@hotmail.de")] + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def setup(self): self.info = {} #@TODO: Remove in 0.4.10 diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index fe955beb9..e9b1b454e 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.25" + __version__ = "0.26" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", True), @@ -44,6 +44,11 @@ class XFileSharingPro(Hook): # self.loadPattern() + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): self.loadPattern() -- cgit v1.2.3 From 6151e81fa0b325dffda3da4228d5821e73db3ef3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 01:19:46 +0100 Subject: Fix __version__ format in some plugins --- module/plugins/accounts/DepositfilesCom.py | 2 +- module/plugins/accounts/FilesMailRu.py | 2 +- module/plugins/accounts/FileserveCom.py | 2 +- module/plugins/accounts/MegaDebridEu.py | 2 +- module/plugins/accounts/RPNetBiz.py | 2 +- module/plugins/accounts/RehostTo.py | 2 +- module/plugins/accounts/SimplydebridCom.py | 2 +- module/plugins/accounts/UploadheroCom.py | 2 +- module/plugins/captcha/GigasizeCom.py | 2 +- module/plugins/captcha/LinksaveIn.py | 2 +- module/plugins/captcha/NetloadIn.py | 2 +- module/plugins/captcha/ShareonlineBiz.py | 2 +- module/plugins/captcha/captcha.py | 2 +- module/plugins/container/CCF.py | 2 +- module/plugins/crypter/ChipDe.py | 2 +- module/plugins/crypter/CzshareComFolder.py | 2 +- module/plugins/crypter/DDLMusicOrg.py | 2 +- module/plugins/crypter/Dereferer.py | 2 +- module/plugins/crypter/DontKnowMe.py | 2 +- module/plugins/crypter/FourChanOrg.py | 2 +- module/plugins/crypter/HoerbuchIn.py | 2 +- module/plugins/crypter/HotfileComFolder.py | 2 +- module/plugins/crypter/LetitbitNetFolder.py | 2 +- module/plugins/crypter/MultiloadCz.py | 2 +- module/plugins/crypter/OneKhDe.py | 2 +- module/plugins/crypter/QuickshareCzFolder.py | 2 +- module/plugins/crypter/SpeedLoadOrgFolder.py | 2 +- module/plugins/crypter/StealthTo.py | 2 +- module/plugins/crypter/UlozToFolder.py | 2 +- module/plugins/crypter/XupPl.py | 2 +- module/plugins/hooks/RPNetBiz.py | 2 +- module/plugins/hoster/DailymotionCom.py | 2 +- module/plugins/hoster/FilezyNet.py | 2 +- module/plugins/hoster/FlyFilesNet.py | 2 +- module/plugins/hoster/FreevideoCz.py | 2 +- module/plugins/hoster/MegaDebridEu.py | 2 +- module/plugins/hoster/MyvideoDe.py | 2 +- module/plugins/hoster/OboomCom.py | 2 +- module/plugins/hoster/PornhostCom.py | 2 +- module/plugins/hoster/PornhubCom.py | 2 +- module/plugins/hoster/RPNetBiz.py | 2 +- module/plugins/hoster/RedtubeCom.py | 2 +- module/plugins/hoster/SimplydebridCom.py | 2 +- module/plugins/hoster/SoundcloudCom.py | 2 +- module/plugins/hoster/StreamCz.py | 2 +- module/plugins/hoster/Vipleech4uCom.py | 2 +- module/plugins/hoster/XVideosCom.py | 2 +- module/plugins/hoster/YoupornCom.py | 2 +- module/plugins/hoster/ZDF.py | 2 +- module/plugins/internal/AbstractExtractor.py | 2 +- module/plugins/internal/UnZip.py | 2 +- 51 files changed, 51 insertions(+), 51 deletions(-) (limited to 'module') diff --git a/module/plugins/accounts/DepositfilesCom.py b/module/plugins/accounts/DepositfilesCom.py index 437265c3f..1cfb96e84 100644 --- a/module/plugins/accounts/DepositfilesCom.py +++ b/module/plugins/accounts/DepositfilesCom.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class DepositfilesCom(Account): __name__ = "DepositfilesCom" __type__ = "account" - __version__ = "0.3" + __version__ = "0.30" __description__ = """Depositfiles.com account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/FilesMailRu.py b/module/plugins/accounts/FilesMailRu.py index 365fa86dc..dcec22644 100644 --- a/module/plugins/accounts/FilesMailRu.py +++ b/module/plugins/accounts/FilesMailRu.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class FilesMailRu(Account): __name__ = "FilesMailRu" __type__ = "account" - __version__ = "0.1" + __version__ = "0.10" __description__ = """Filesmail.ru account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/FileserveCom.py b/module/plugins/accounts/FileserveCom.py index 411ba85b1..6f23f4b43 100644 --- a/module/plugins/accounts/FileserveCom.py +++ b/module/plugins/accounts/FileserveCom.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads class FileserveCom(Account): __name__ = "FileserveCom" __type__ = "account" - __version__ = "0.2" + __version__ = "0.20" __description__ = """Fileserve.com account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/MegaDebridEu.py b/module/plugins/accounts/MegaDebridEu.py index e7e22048b..a082b97af 100644 --- a/module/plugins/accounts/MegaDebridEu.py +++ b/module/plugins/accounts/MegaDebridEu.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class MegaDebridEu(Account): __name__ = "MegaDebridEu" __type__ = "account" - __version__ = "0.2" + __version__ = "0.20" __description__ = """mega-debrid.eu account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py index 4daa56a75..8bd358084 100644 --- a/module/plugins/accounts/RPNetBiz.py +++ b/module/plugins/accounts/RPNetBiz.py @@ -7,7 +7,7 @@ from module.common.json_layer import json_loads class RPNetBiz(Account): __name__ = "RPNetBiz" __type__ = "account" - __version__ = "0.1" + __version__ = "0.10" __description__ = """RPNet.biz account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/RehostTo.py b/module/plugins/accounts/RehostTo.py index 16702e632..eec7d8731 100644 --- a/module/plugins/accounts/RehostTo.py +++ b/module/plugins/accounts/RehostTo.py @@ -6,7 +6,7 @@ from module.plugins.Account import Account class RehostTo(Account): __name__ = "RehostTo" __type__ = "account" - __version__ = "0.1" + __version__ = "0.10" __description__ = """Rehost.to account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py index 7979fd5d5..406534364 100644 --- a/module/plugins/accounts/SimplydebridCom.py +++ b/module/plugins/accounts/SimplydebridCom.py @@ -8,7 +8,7 @@ from module.plugins.Account import Account class SimplydebridCom(Account): __name__ = "SimplydebridCom" __type__ = "account" - __version__ = "0.1" + __version__ = "0.10" __description__ = """Simply-Debrid.com account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/accounts/UploadheroCom.py b/module/plugins/accounts/UploadheroCom.py index be1dfe981..63d823e69 100644 --- a/module/plugins/accounts/UploadheroCom.py +++ b/module/plugins/accounts/UploadheroCom.py @@ -10,7 +10,7 @@ from module.plugins.Account import Account class UploadheroCom(Account): __name__ = "UploadheroCom" __type__ = "account" - __version__ = "0.2" + __version__ = "0.20" __description__ = """Uploadhero.co account plugin""" __license__ = "GPLv3" diff --git a/module/plugins/captcha/GigasizeCom.py b/module/plugins/captcha/GigasizeCom.py index 99f432d12..244cf6a2a 100644 --- a/module/plugins/captcha/GigasizeCom.py +++ b/module/plugins/captcha/GigasizeCom.py @@ -6,7 +6,7 @@ from module.plugins.captcha.captcha import OCR class GigasizeCom(OCR): __name__ = "GigasizeCom" __type__ = "ocr" - __version__ = "0.1" + __version__ = "0.10" __description__ = """Gigasize.com ocr plugin""" __license__ = "GPLv3" diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py index 41673d8a6..56cbd58a0 100644 --- a/module/plugins/captcha/LinksaveIn.py +++ b/module/plugins/captcha/LinksaveIn.py @@ -15,7 +15,7 @@ from module.plugins.captcha.captcha import OCR class LinksaveIn(OCR): __name__ = "LinksaveIn" __type__ = "ocr" - __version__ = "0.1" + __version__ = "0.10" __description__ = """Linksave.in ocr plugin""" __license__ = "GPLv3" diff --git a/module/plugins/captcha/NetloadIn.py b/module/plugins/captcha/NetloadIn.py index fc8eecf59..28eb18fb5 100644 --- a/module/plugins/captcha/NetloadIn.py +++ b/module/plugins/captcha/NetloadIn.py @@ -6,7 +6,7 @@ from module.plugins.captcha.captcha import OCR class NetloadIn(OCR): __name__ = "NetloadIn" __type__ = "ocr" - __version__ = "0.1" + __version__ = "0.10" __description__ = """Netload.in ocr plugin""" __license__ = "GPLv3" diff --git a/module/plugins/captcha/ShareonlineBiz.py b/module/plugins/captcha/ShareonlineBiz.py index 6e513941d..8210e8859 100644 --- a/module/plugins/captcha/ShareonlineBiz.py +++ b/module/plugins/captcha/ShareonlineBiz.py @@ -6,7 +6,7 @@ from module.plugins.captcha.captcha import OCR class ShareonlineBiz(OCR): __name__ = "ShareonlineBiz" __type__ = "ocr" - __version__ = "0.1" + __version__ = "0.10" __description__ = """Shareonline.biz ocr plugin""" __license__ = "GPLv3" diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index b67ce9b9e..5dcde33fb 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -18,7 +18,7 @@ from os.path import abspath, join class OCR(object): __name__ = "OCR" __type__ = "ocr" - __version__ = "0.1" + __version__ = "0.10" __description__ = """OCR base plugin""" __license__ = "GPLv3" diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py index c7824fcc4..ff7d43e08 100644 --- a/module/plugins/container/CCF.py +++ b/module/plugins/container/CCF.py @@ -14,7 +14,7 @@ from module.utils import save_join class CCF(Container): __name__ = "CCF" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'.+\.ccf' diff --git a/module/plugins/crypter/ChipDe.py b/module/plugins/crypter/ChipDe.py index 59ed6559e..b342cd1bf 100644 --- a/module/plugins/crypter/ChipDe.py +++ b/module/plugins/crypter/ChipDe.py @@ -7,7 +7,7 @@ from module.plugins.Crypter import Crypter class ChipDe(Crypter): __name__ = "ChipDe" __type__ = "crypter" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?chip\.de/video/.*\.html' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/CzshareComFolder.py b/module/plugins/crypter/CzshareComFolder.py index 669f469b2..67376c6e6 100644 --- a/module/plugins/crypter/CzshareComFolder.py +++ b/module/plugins/crypter/CzshareComFolder.py @@ -7,7 +7,7 @@ from module.plugins.Crypter import Crypter class CzshareComFolder(Crypter): __name__ = "CzshareComFolder" __type__ = "crypter" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.*' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/DDLMusicOrg.py b/module/plugins/crypter/DDLMusicOrg.py index c2524b180..55181e9ad 100644 --- a/module/plugins/crypter/DDLMusicOrg.py +++ b/module/plugins/crypter/DDLMusicOrg.py @@ -10,7 +10,7 @@ from module.plugins.Crypter import Crypter class DDLMusicOrg(Crypter): __name__ = "DDLMusicOrg" __type__ = "crypter" - __version__ = "0.3" + __version__ = "0.30" __pattern__ = r'http://(?:www\.)?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/Dereferer.py b/module/plugins/crypter/Dereferer.py index 70b42b00c..dadc3c8b3 100644 --- a/module/plugins/crypter/Dereferer.py +++ b/module/plugins/crypter/Dereferer.py @@ -10,7 +10,7 @@ from module.plugins.Crypter import Crypter class Dereferer(Crypter): __name__ = "Dereferer" __type__ = "crypter" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'https?://([^/]+)/.*?(?P(ht|f)tps?(://|%3A%2F%2F).*)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/DontKnowMe.py b/module/plugins/crypter/DontKnowMe.py index 6783abd7c..8d2a52c2c 100644 --- a/module/plugins/crypter/DontKnowMe.py +++ b/module/plugins/crypter/DontKnowMe.py @@ -10,7 +10,7 @@ from module.plugins.Crypter import Crypter class DontKnowMe(Crypter): __name__ = "DontKnowMe" __type__ = "crypter" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?dontknow\.me/at/\?.+$' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/FourChanOrg.py b/module/plugins/crypter/FourChanOrg.py index 48592d30a..d6c5c86cc 100644 --- a/module/plugins/crypter/FourChanOrg.py +++ b/module/plugins/crypter/FourChanOrg.py @@ -10,7 +10,7 @@ from module.plugins.Crypter import Crypter class FourChanOrg(Crypter): __name__ = "FourChanOrg" __type__ = "crypter" - __version__ = "0.3" + __version__ = "0.30" __pattern__ = r'http://(?:www\.)?boards\.4chan\.org/\w+/res/(\d+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py index 4d4b8fbef..a347e4232 100644 --- a/module/plugins/crypter/HoerbuchIn.py +++ b/module/plugins/crypter/HoerbuchIn.py @@ -10,7 +10,7 @@ from module.plugins.Crypter import Crypter class HoerbuchIn(Crypter): __name__ = "HoerbuchIn" __type__ = "crypter" - __version__ = "0.6" + __version__ = "0.60" __pattern__ = r'http://(?:www\.)?hoerbuch\.in/(wp/horbucher/\d+/.+/|tp/out\.php\?.+|protection/folder_\d+\.html)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/HotfileComFolder.py b/module/plugins/crypter/HotfileComFolder.py index a294c04e0..4f40587ad 100644 --- a/module/plugins/crypter/HotfileComFolder.py +++ b/module/plugins/crypter/HotfileComFolder.py @@ -6,7 +6,7 @@ from module.plugins.internal.DeadCrypter import DeadCrypter, create_getInfo class HotfileComFolder(DeadCrypter): __name__ = "HotfileComFolder" __type__ = "crypter" - __version__ = "0.3" + __version__ = "0.30" __pattern__ = r'https?://(?:www\.)?hotfile\.com/list/\w+/\w+' __config__ = [] diff --git a/module/plugins/crypter/LetitbitNetFolder.py b/module/plugins/crypter/LetitbitNetFolder.py index e3848e2ab..56ecbc7f8 100644 --- a/module/plugins/crypter/LetitbitNetFolder.py +++ b/module/plugins/crypter/LetitbitNetFolder.py @@ -7,7 +7,7 @@ from module.plugins.Crypter import Crypter class LetitbitNetFolder(Crypter): __name__ = "LetitbitNetFolder" __type__ = "crypter" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?letitbit\.net/folder/\w+' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/MultiloadCz.py b/module/plugins/crypter/MultiloadCz.py index 127fe068a..b096f63ef 100644 --- a/module/plugins/crypter/MultiloadCz.py +++ b/module/plugins/crypter/MultiloadCz.py @@ -7,7 +7,7 @@ from module.plugins.Crypter import Crypter class MultiloadCz(Crypter): __name__ = "MultiloadCz" __type__ = "crypter" - __version__ = "0.4" + __version__ = "0.40" __pattern__ = r'http://(?:[^/]*\.)?multiload\.cz/(stahnout|slozka)/.*' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/OneKhDe.py b/module/plugins/crypter/OneKhDe.py index 540f14568..cfb084da8 100644 --- a/module/plugins/crypter/OneKhDe.py +++ b/module/plugins/crypter/OneKhDe.py @@ -9,7 +9,7 @@ from module.plugins.Crypter import Crypter class OneKhDe(Crypter): __name__ = "OneKhDe" __type__ = "crypter" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?1kh\.de/f/' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/QuickshareCzFolder.py b/module/plugins/crypter/QuickshareCzFolder.py index 52d558af7..f84f43fa4 100644 --- a/module/plugins/crypter/QuickshareCzFolder.py +++ b/module/plugins/crypter/QuickshareCzFolder.py @@ -7,7 +7,7 @@ from module.plugins.Crypter import Crypter class QuickshareCzFolder(Crypter): __name__ = "QuickshareCzFolder" __type__ = "crypter" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?quickshare\.cz/slozka-\d+.*' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/SpeedLoadOrgFolder.py b/module/plugins/crypter/SpeedLoadOrgFolder.py index 1d3a7df91..ddde7dec2 100644 --- a/module/plugins/crypter/SpeedLoadOrgFolder.py +++ b/module/plugins/crypter/SpeedLoadOrgFolder.py @@ -6,7 +6,7 @@ from module.plugins.internal.DeadCrypter import DeadCrypter, create_getInfo class SpeedLoadOrgFolder(DeadCrypter): __name__ = "SpeedLoadOrgFolder" __type__ = "crypter" - __version__ = "0.3" + __version__ = "0.30" __pattern__ = r'http://(?:www\.)?speedload\.org/(\d+~f$|folder/\d+/)' __config__ = [] diff --git a/module/plugins/crypter/StealthTo.py b/module/plugins/crypter/StealthTo.py index e4da3e7e4..5173421f1 100644 --- a/module/plugins/crypter/StealthTo.py +++ b/module/plugins/crypter/StealthTo.py @@ -6,7 +6,7 @@ from module.plugins.internal.DeadCrypter import DeadCrypter, create_getInfo class StealthTo(DeadCrypter): __name__ = "StealthTo" __type__ = "crypter" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?stealth\.to/folder/.+' __config__ = [] diff --git a/module/plugins/crypter/UlozToFolder.py b/module/plugins/crypter/UlozToFolder.py index 59c828174..cfb756413 100644 --- a/module/plugins/crypter/UlozToFolder.py +++ b/module/plugins/crypter/UlozToFolder.py @@ -7,7 +7,7 @@ from module.plugins.Crypter import Crypter class UlozToFolder(Crypter): __name__ = "UlozToFolder" __type__ = "crypter" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(m|soubory)/.*' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/crypter/XupPl.py b/module/plugins/crypter/XupPl.py index c456723b3..25b80860c 100644 --- a/module/plugins/crypter/XupPl.py +++ b/module/plugins/crypter/XupPl.py @@ -6,7 +6,7 @@ from module.plugins.Crypter import Crypter class XupPl(Crypter): __name__ = "XupPl" __type__ = "crypter" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'https?://(?:[^/]*\.)?xup\.pl/.*' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), diff --git a/module/plugins/hooks/RPNetBiz.py b/module/plugins/hooks/RPNetBiz.py index e38aa8ea0..917cd02de 100644 --- a/module/plugins/hooks/RPNetBiz.py +++ b/module/plugins/hooks/RPNetBiz.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class RPNetBiz(MultiHoster): __name__ = "RPNetBiz" __type__ = "hook" - __version__ = "0.1" + __version__ = "0.10" __config__ = [("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), ("hosterList", "str", "Hoster list (comma separated)", ""), diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py index 09b2f626d..f07a34f8a 100644 --- a/module/plugins/hoster/DailymotionCom.py +++ b/module/plugins/hoster/DailymotionCom.py @@ -40,7 +40,7 @@ def getInfo(urls): class DailymotionCom(Hoster): __name__ = "DailymotionCom" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'https?://(?:www\.)?dailymotion\.com/.*video/(?P[\w^_]+)' __config__ = [("quality", "Lowest;LD 144p;LD 240p;SD 384p;HQ 480p;HD 720p;HD 1080p;Highest", "Quality", "Highest")] diff --git a/module/plugins/hoster/FilezyNet.py b/module/plugins/hoster/FilezyNet.py index d86ee6157..4197a2858 100644 --- a/module/plugins/hoster/FilezyNet.py +++ b/module/plugins/hoster/FilezyNet.py @@ -6,7 +6,7 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo class FilezyNet(DeadHoster): __name__ = "FilezyNet" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?filezy\.net/\w{12}' diff --git a/module/plugins/hoster/FlyFilesNet.py b/module/plugins/hoster/FlyFilesNet.py index aa2c3993f..361537927 100644 --- a/module/plugins/hoster/FlyFilesNet.py +++ b/module/plugins/hoster/FlyFilesNet.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster class FlyFilesNet(SimpleHoster): __name__ = "FlyFilesNet" __type__ = "hoster" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?flyfiles\.net/.*' diff --git a/module/plugins/hoster/FreevideoCz.py b/module/plugins/hoster/FreevideoCz.py index 8c0df84b2..e56d1a299 100644 --- a/module/plugins/hoster/FreevideoCz.py +++ b/module/plugins/hoster/FreevideoCz.py @@ -6,7 +6,7 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo class FreevideoCz(DeadHoster): __name__ = "FreevideoCz" __type__ = "hoster" - __version__ = "0.3" + __version__ = "0.30" __pattern__ = r'http://(?:www\.)?freevideo\.cz/vase-videa/.+' diff --git a/module/plugins/hoster/MegaDebridEu.py b/module/plugins/hoster/MegaDebridEu.py index 4d1e1bcb7..f63a7b3c6 100644 --- a/module/plugins/hoster/MegaDebridEu.py +++ b/module/plugins/hoster/MegaDebridEu.py @@ -11,7 +11,7 @@ from module.plugins.Hoster import Hoster class MegaDebridEu(Hoster): __name__ = "MegaDebridEu" __type__ = "hoster" - __version__ = "0.4" + __version__ = "0.40" __pattern__ = r'^https?://(?:w{3}\d+\.mega-debrid\.eu|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/download/file/[^/]+/.+$' diff --git a/module/plugins/hoster/MyvideoDe.py b/module/plugins/hoster/MyvideoDe.py index d4a85c8c0..8af4a9a61 100644 --- a/module/plugins/hoster/MyvideoDe.py +++ b/module/plugins/hoster/MyvideoDe.py @@ -9,7 +9,7 @@ from module.unescape import unescape class MyvideoDe(Hoster): __name__ = "MyvideoDe" __type__ = "hoster" - __version__ = "0.9" + __version__ = "0.90" __pattern__ = r'http://(?:www\.)?myvideo\.de/watch/' diff --git a/module/plugins/hoster/OboomCom.py b/module/plugins/hoster/OboomCom.py index a2a0840c3..588d8f64a 100644 --- a/module/plugins/hoster/OboomCom.py +++ b/module/plugins/hoster/OboomCom.py @@ -13,7 +13,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class OboomCom(Hoster): __name__ = "OboomCom" __type__ = "hoster" - __version__ = "0.3" + __version__ = "0.30" __pattern__ = r'https?://(?:www\.)?oboom\.com/(#(id=|/)?)?(?P\w{8})' diff --git a/module/plugins/hoster/PornhostCom.py b/module/plugins/hoster/PornhostCom.py index a6f415043..71342f3e0 100644 --- a/module/plugins/hoster/PornhostCom.py +++ b/module/plugins/hoster/PornhostCom.py @@ -8,7 +8,7 @@ from module.plugins.Hoster import Hoster class PornhostCom(Hoster): __name__ = "PornhostCom" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?pornhost\.com/(\d+/\d+\.html|\d+)' diff --git a/module/plugins/hoster/PornhubCom.py b/module/plugins/hoster/PornhubCom.py index d1b84771f..1bb787f09 100644 --- a/module/plugins/hoster/PornhubCom.py +++ b/module/plugins/hoster/PornhubCom.py @@ -8,7 +8,7 @@ from module.plugins.Hoster import Hoster class PornhubCom(Hoster): __name__ = "PornhubCom" __type__ = "hoster" - __version__ = "0.5" + __version__ = "0.50" __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=\w+' diff --git a/module/plugins/hoster/RPNetBiz.py b/module/plugins/hoster/RPNetBiz.py index c1e536d39..c4c16cf3c 100644 --- a/module/plugins/hoster/RPNetBiz.py +++ b/module/plugins/hoster/RPNetBiz.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads class RPNetBiz(Hoster): __name__ = "RPNetBiz" __type__ = "hoster" - __version__ = "0.1" + __version__ = "0.10" __description__ = """RPNet.biz hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/hoster/RedtubeCom.py b/module/plugins/hoster/RedtubeCom.py index 5bf624273..d68fbe262 100644 --- a/module/plugins/hoster/RedtubeCom.py +++ b/module/plugins/hoster/RedtubeCom.py @@ -9,7 +9,7 @@ from module.unescape import unescape class RedtubeCom(Hoster): __name__ = "RedtubeCom" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?redtube\.com/\d+' diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 3d4d3be93..0fe4ae0f8 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -8,7 +8,7 @@ from module.plugins.Hoster import Hoster class SimplydebridCom(Hoster): __name__ = "SimplydebridCom" __type__ = "hoster" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php/*' diff --git a/module/plugins/hoster/SoundcloudCom.py b/module/plugins/hoster/SoundcloudCom.py index 71cfb6b27..79c8a2f1e 100644 --- a/module/plugins/hoster/SoundcloudCom.py +++ b/module/plugins/hoster/SoundcloudCom.py @@ -9,7 +9,7 @@ from module.plugins.Hoster import Hoster class SoundcloudCom(Hoster): __name__ = "SoundcloudCom" __type__ = "hoster" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'https?://(?:www\.)?soundcloud\.com/(?P.*?)/(?P.*)' diff --git a/module/plugins/hoster/StreamCz.py b/module/plugins/hoster/StreamCz.py index 95d1e12ba..6813271d0 100644 --- a/module/plugins/hoster/StreamCz.py +++ b/module/plugins/hoster/StreamCz.py @@ -23,7 +23,7 @@ def getInfo(urls): class StreamCz(Hoster): __name__ = "StreamCz" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'https?://(?:www\.)?stream\.cz/[^/]+/\d+.*' diff --git a/module/plugins/hoster/Vipleech4uCom.py b/module/plugins/hoster/Vipleech4uCom.py index 7499294ed..340a3feaa 100644 --- a/module/plugins/hoster/Vipleech4uCom.py +++ b/module/plugins/hoster/Vipleech4uCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo class Vipleech4uCom(DeadHoster): __name__ = "Vipleech4uCom" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?vipleech4u\.com/manager\.php' diff --git a/module/plugins/hoster/XVideosCom.py b/module/plugins/hoster/XVideosCom.py index f70493d04..d9190805d 100644 --- a/module/plugins/hoster/XVideosCom.py +++ b/module/plugins/hoster/XVideosCom.py @@ -10,7 +10,7 @@ from module.plugins.Hoster import Hoster class XVideosCom(Hoster): __name__ = "XVideos.com" __type__ = "hoster" - __version__ = "0.1" + __version__ = "0.10" __pattern__ = r'http://(?:www\.)?xvideos\.com/video(\d+)/.*' diff --git a/module/plugins/hoster/YoupornCom.py b/module/plugins/hoster/YoupornCom.py index 5eb431ec8..4bb2520e6 100644 --- a/module/plugins/hoster/YoupornCom.py +++ b/module/plugins/hoster/YoupornCom.py @@ -8,7 +8,7 @@ from module.plugins.Hoster import Hoster class YoupornCom(Hoster): __name__ = "YoupornCom" __type__ = "hoster" - __version__ = "0.2" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?youporn\.com/watch/.+' diff --git a/module/plugins/hoster/ZDF.py b/module/plugins/hoster/ZDF.py index 04a395e1e..8d3de5b26 100644 --- a/module/plugins/hoster/ZDF.py +++ b/module/plugins/hoster/ZDF.py @@ -11,7 +11,7 @@ from module.plugins.Hoster import Hoster class ZDF(Hoster): __name__ = "ZDF Mediathek" __type__ = "hoster" - __version__ = "0.8" + __version__ = "0.80" __pattern__ = r'http://(?:www\.)?zdf\.de/ZDFmediathek/\D*(\d+)\D*' diff --git a/module/plugins/internal/AbstractExtractor.py b/module/plugins/internal/AbstractExtractor.py index 8a69ebb56..2317ad689 100644 --- a/module/plugins/internal/AbstractExtractor.py +++ b/module/plugins/internal/AbstractExtractor.py @@ -14,7 +14,7 @@ class WrongPassword(Exception): class AbtractExtractor: __name__ = "AbtractExtractor" - __version__ = "0.1" + __version__ = "0.10" __description__ = """Abtract extractor plugin""" __license__ = "GPLv3" diff --git a/module/plugins/internal/UnZip.py b/module/plugins/internal/UnZip.py index e754141a1..053946dbe 100644 --- a/module/plugins/internal/UnZip.py +++ b/module/plugins/internal/UnZip.py @@ -8,7 +8,7 @@ from module.plugins.internal.AbstractExtractor import AbtractExtractor class UnZip(AbtractExtractor): __name__ = "UnZip" - __version__ = "0.1" + __version__ = "0.10" __description__ = """Zip extractor plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 4d578cb15f3d6edd036e438e504739b97660f93e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 16:58:35 +0100 Subject: Spare code cosmetics --- module/plugins/captcha/captcha.py | 25 ++++++------- module/plugins/container/CCF.py | 7 ++-- module/plugins/crypter/FilecryptCc.py | 8 ++--- module/plugins/crypter/NCryptIn.py | 4 +-- module/plugins/crypter/RelinkUs.py | 25 ++++++++----- module/plugins/crypter/SafelinkingNet.py | 2 +- module/plugins/hooks/MergeFiles.py | 61 +++++++++++++++++--------------- module/plugins/hoster/BitshareCom.py | 8 +++-- module/plugins/hoster/CatShareNet.py | 4 +-- module/plugins/hoster/DlFreeFr.py | 8 ++--- module/plugins/hoster/FilecloudIo.py | 6 ++-- module/plugins/hoster/FilepostCom.py | 37 ++++++++++--------- module/plugins/hoster/FileserveCom.py | 6 ++-- module/plugins/hoster/IfileIt.py | 27 +++++++------- module/plugins/hoster/KingfilesNet.py | 30 ++++++++-------- module/plugins/hoster/LoadTo.py | 7 ++-- module/plugins/hoster/MediafireCom.py | 8 +++-- module/plugins/hoster/RapidgatorNet.py | 10 +++--- module/plugins/hoster/RapiduNet.py | 12 +++---- module/plugins/hoster/UploadableCh.py | 4 +-- module/plugins/hoster/UploadedTo.py | 4 +-- module/plugins/hoster/UpstoreNet.py | 6 ++-- 22 files changed, 168 insertions(+), 141 deletions(-) (limited to 'module') diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index 5dcde33fb..0f233ec00 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -81,18 +81,19 @@ class OCR(object): if subset and (digits or lowercase or uppercase): #tmpSub = tempfile.NamedTemporaryFile(suffix=".subset") - tmpSub = open(join("tmp", "tmpSub_%s.subset" % self.__name__), "wb") - tmpSub.write("tessedit_char_whitelist ") - if digits: - tmpSub.write("0123456789") - if lowercase: - tmpSub.write("abcdefghijklmnopqrstuvwxyz") - if uppercase: - tmpSub.write("ABCDEFGHIJKLMNOPQRSTUVWXYZ") - tmpSub.write("\n") - tessparams.append("nobatch") - tessparams.append(abspath(tmpSub.name)) - tmpSub.close() + with open(join("tmp", "tmpSub_%s.subset" % self.__name__), "wb") as tmpSub: + tmpSub.write("tessedit_char_whitelist ") + + if digits: + tmpSub.write("0123456789") + if lowercase: + tmpSub.write("abcdefghijklmnopqrstuvwxyz") + if uppercase: + tmpSub.write("ABCDEFGHIJKLMNOPQRSTUVWXYZ") + + tmpSub.write("\n") + tessparams.append("nobatch") + tessparams.append(abspath(tmpSub.name)) self.logger.debug("run tesseract") self.run(tessparams) diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py index ff7d43e08..bca535175 100644 --- a/module/plugins/container/CCF.py +++ b/module/plugins/container/CCF.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import with_statement + import re from os import makedirs @@ -35,8 +37,7 @@ class CCF(Container): download_folder = self.config['general']['download_folder'] tempdlc_name = save_join(download_folder, "tmp_%s.dlc" % pyfile.name) - tempdlc = open(tempdlc_name, "w") - tempdlc.write(re.search(r'(.*)', tempdlc_content, re.S).group(1)) - tempdlc.close() + with open(tempdlc_name, "w") as tempdlc: + tempdlc.write(re.search(r'(.*)', tempdlc_content, re.S).group(1)) self.urls = [tempdlc_name] diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index fb53e616b..0aa730744 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -107,10 +107,10 @@ class FilecryptCc(Crypter): weblinks = re.findall(self.WEBLINK_PATTERN, self.siteWithLinks) for link in weblinks: - response = self.load("http://filecrypt.cc/Link/%s.html" % link, cookies=True) - link2 = re.search('', response) - response2 = self.load(link2.group(1), just_header=True, cookies=True) - self.links.append(response2['location']) + res = self.load("http://filecrypt.cc/Link/%s.html" % link, cookies=True) + link2 = re.search('', res) + res2 = self.load(link2.group(1), just_header=True, cookies=True) + self.links.append(res2['location']) except Exception, e: self.logDebug("Error decrypting weblinks: %s" % e) diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 3c08e26c1..1d572e538 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -156,9 +156,9 @@ class NCryptIn(Crypter): captcha_key = re.search(r'\?k=(.*?)"', form).group(1) self.logDebug("Resolving ReCaptcha with key [%s]" % captcha_key) recaptcha = ReCaptcha(self) - challenge, code = recaptcha.challenge(captcha_key) + challenge, response = recaptcha.challenge(captcha_key) postData['recaptcha_challenge_field'] = challenge - postData['recaptcha_response_field'] = code + postData['recaptcha_response_field'] = response # Resolve circlecaptcha if "circlecaptcha" in form: diff --git a/module/plugins/crypter/RelinkUs.py b/module/plugins/crypter/RelinkUs.py index 1111118b2..94a73cded 100644 --- a/module/plugins/crypter/RelinkUs.py +++ b/module/plugins/crypter/RelinkUs.py @@ -228,20 +228,29 @@ class RelinkUs(Crypter): def handleWEBLinks(self): self.logDebug("Search for WEB links") + package_links = [] - fw_params = re.findall(self.WEB_FORWARD_REGEX, self.html) - self.logDebug("Decrypting %d Web links" % len(fw_params)) - for index, fw_param in enumerate(fw_params): + params = re.findall(self.WEB_FORWARD_REGEX, self.html) + + self.logDebug("Decrypting %d Web links" % len(params)) + + for index, param in enumerate(params): try: - fw_url = self.WEB_FORWARD_URL + "?%s" % fw_param - self.logDebug("Decrypting Web link %d, %s" % (index + 1, fw_url)) - fw_response = self.load(fw_url, decode=True) - dl_link = re.search(self.WEB_LINK_REGEX, fw_response).group('link') - package_links.append(dl_link) + url = self.WEB_FORWARD_URL + "?%s" % param + + self.logDebug("Decrypting Web link %d, %s" % (index + 1, url)) + + res = self.load(url, decode=True) + link = re.search(self.WEB_LINK_REGEX, res).group('link') + + package_links.append(link) + except Exception, detail: self.logDebug("Error decrypting Web link %s, %s" % (index, detail)) + self.setWait(4) self.wait() + return package_links diff --git a/module/plugins/crypter/SafelinkingNet.py b/module/plugins/crypter/SafelinkingNet.py index 9bb6c3229..709083b51 100644 --- a/module/plugins/crypter/SafelinkingNet.py +++ b/module/plugins/crypter/SafelinkingNet.py @@ -57,7 +57,7 @@ class SafelinkingNet(Crypter): challenge, response = captcha.challenge(captchaKey) postData['adcopy_challenge'] = challenge - postData['adcopy_response'] = response + postData['adcopy_response'] = response self.html = self.load(url, post=postData) if "The password you entered was incorrect" in self.html: diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 767209d21..4de45f958 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +from __future__ import with_statement + import os import re @@ -53,32 +55,35 @@ class MergeFiles(Hook): for name, file_list in files.iteritems(): self.logInfo(_("Starting merging of"), name) - final_file = open(save_join(download_folder, name), "wb") - - for splitted_file in file_list: - self.logDebug("Merging part", splitted_file) - pyfile = self.core.files.getFile(fid_dict[splitted_file]) - pyfile.setStatus("processing") - try: - s_file = open(os.path.join(download_folder, splitted_file), "rb") - size_written = 0 - s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file))) - while True: - f_buffer = s_file.read(self.BUFFER_SIZE) - if f_buffer: - final_file.write(f_buffer) - size_written += self.BUFFER_SIZE - pyfile.setProgress((size_written * 100) / s_file_size) - else: - break - s_file.close() - self.logDebug("Finished merging part", splitted_file) - except Exception, e: - print_exc() - finally: - pyfile.setProgress(100) - pyfile.setStatus("finished") - pyfile.release() - - final_file.close() + + with open(save_join(download_folder, name), "wb") as final_file: + for splitted_file in file_list: + self.logDebug("Merging part", splitted_file) + + pyfile = self.core.files.getFile(fid_dict[splitted_file]) + + pyfile.setStatus("processing") + + try: + with open(os.path.join(download_folder, splitted_file), "rb") as s_file: + size_written = 0 + s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file))) + while True: + f_buffer = s_file.read(self.BUFFER_SIZE) + if f_buffer: + final_file.write(f_buffer) + size_written += self.BUFFER_SIZE + pyfile.setProgress((size_written * 100) / s_file_size) + else: + break + self.logDebug("Finished merging part", splitted_file) + + except Exception, e: + print_exc() + + finally: + pyfile.setProgress(100) + pyfile.setStatus("finished") + pyfile.release() + self.logInfo(_("Finished merging of"), name) diff --git a/module/plugins/hoster/BitshareCom.py b/module/plugins/hoster/BitshareCom.py index 1483e5d1e..17d29680e 100644 --- a/module/plugins/hoster/BitshareCom.py +++ b/module/plugins/hoster/BitshareCom.py @@ -115,10 +115,12 @@ class BitshareCom(SimpleHoster): # Try up to 3 times for i in xrange(3): - challenge, code = recaptcha.challenge() + challenge, response = recaptcha.challenge() res = self.load("http://bitshare.com/files-ajax/" + self.file_id + "/request.html", - post={"request": "validateCaptcha", "ajaxid": self.ajaxid, - "recaptcha_challenge_field": challenge, "recaptcha_response_field": code}) + post={"request" : "validateCaptcha", + "ajaxid" : self.ajaxid, + "recaptcha_challenge_field": challenge, + "recaptcha_response_field" : response}) if self.handleCaptchaErrors(res): break diff --git a/module/plugins/hoster/CatShareNet.py b/module/plugins/hoster/CatShareNet.py index 0caac5913..949a021dd 100644 --- a/module/plugins/hoster/CatShareNet.py +++ b/module/plugins/hoster/CatShareNet.py @@ -50,10 +50,10 @@ class CatShareNet(SimpleHoster): recaptcha = ReCaptcha(self) - challenge, code = recaptcha.challenge() + challenge, response = recaptcha.challenge() self.html = self.load(self.pyfile.url, post={'recaptcha_challenge_field': challenge, - 'recaptcha_response_field': code}) + 'recaptcha_response_field' : response}) m = re.search(self.LINK_PATTERN, self.html) if m is None: diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py index f07d46768..14b74c779 100644 --- a/module/plugins/hoster/DlFreeFr.py +++ b/module/plugins/hoster/DlFreeFr.py @@ -103,11 +103,11 @@ class AdYouLike: if not response: self.plugin.fail("AdYouLike result failed") - return {"_ayl_captcha_engine": self.engine, - "_ayl_env": ayl['all']['env'], - "_ayl_tid": challenge['tid'], + return {"_ayl_captcha_engine" : self.engine, + "_ayl_env" : ayl['all']['env'], + "_ayl_tid" : challenge['tid'], "_ayl_token_challenge": challenge['token'], - "_ayl_response": response} + "_ayl_response" : response} class DlFreeFr(SimpleHoster): diff --git a/module/plugins/hoster/FilecloudIo.py b/module/plugins/hoster/FilecloudIo.py index 495f2268d..cb9782f23 100644 --- a/module/plugins/hoster/FilecloudIo.py +++ b/module/plugins/hoster/FilecloudIo.py @@ -58,9 +58,9 @@ class FilecloudIo(SimpleHoster): if not self.account: self.fail(_("User not logged in")) elif not self.account.logged_in: - captcha_challenge, captcha_response = recaptcha.challenge(captcha_key) - self.account.form_data = {"recaptcha_challenge_field": captcha_challenge, - "recaptcha_response_field": captcha_response} + challenge, response = recaptcha.challenge(captcha_key) + self.account.form_data = {"recaptcha_challenge_field": challenge, + "recaptcha_response_field" : response} self.account.relogin(self.user) self.retry(2) diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py index db5ea20d3..b94892ef4 100644 --- a/module/plugins/hoster/FilepostCom.py +++ b/module/plugins/hoster/FilepostCom.py @@ -92,36 +92,39 @@ class FilepostCom(SimpleHoster): def getJsonResponse(self, get_dict, post_dict, field): - json_response = json_loads(self.load('https://filepost.com/files/get/', get=get_dict, post=post_dict)) - self.logDebug(json_response) + res = json_loads(self.load('https://filepost.com/files/get/', get=get_dict, post=post_dict)) - if not 'js' in json_response: + self.logDebug(res) + + if not 'js' in res: self.error(_("JSON %s 1") % field) - # i changed js_answer to json_response['js'] since js_answer is nowhere set. + # i changed js_answer to res['js'] since js_answer is nowhere set. # i don't know the JSON-HTTP specs in detail, but the previous author - # accessed json_response['js']['error'] as well as js_answer['error']. + # accessed res['js']['error'] as well as js_answer['error']. # see the two lines commented out with "# ~?". - if 'error' in json_response['js']: - if json_response['js']['error'] == 'download_delay': - self.retry(wait_time=json_response['js']['params']['next_download']) + if 'error' in res['js']: + + if res['js']['error'] == 'download_delay': + self.retry(wait_time=res['js']['params']['next_download']) # ~? self.retry(wait_time=js_answer['params']['next_download']) - elif 'Wrong file password' in json_response['js']['error']: - return None - elif 'You entered a wrong CAPTCHA code' in json_response['js']['error']: - return None - elif 'CAPTCHA Code nicht korrekt' in json_response['js']['error']: + + elif ('Wrong file password' in res['js']['error'] + or 'You entered a wrong CAPTCHA code' in res['js']['error'] + or 'CAPTCHA Code nicht korrekt' in res['js']['error']): return None - elif 'CAPTCHA' in json_response['js']['error']: + + elif 'CAPTCHA' in res['js']['error']: self.logDebug("Error response is unknown, but mentions CAPTCHA") return None + else: - self.fail(json_response['js']['error']) + self.fail(res['js']['error']) - if not 'answer' in json_response['js'] or not field in json_response['js']['answer']: + if not 'answer' in res['js'] or not field in res['js']['answer']: self.error(_("JSON %s 2") % field) - return json_response['js']['answer'][field] + return res['js']['answer'][field] getInfo = create_getInfo(FilepostCom) diff --git a/module/plugins/hoster/FileserveCom.py b/module/plugins/hoster/FileserveCom.py index 82d40fba6..871a3dd26 100644 --- a/module/plugins/hoster/FileserveCom.py +++ b/module/plugins/hoster/FileserveCom.py @@ -159,10 +159,10 @@ class FileserveCom(Hoster): recaptcha = ReCaptcha(self) for _i in xrange(5): - challenge, code = recaptcha.challenge(captcha_key) + challenge, response = recaptcha.challenge(captcha_key) res = json_loads(self.load(self.URLS[2], - post={'recaptcha_challenge_field': challenge, - 'recaptcha_response_field': code, + post={'recaptcha_challenge_field' : challenge, + 'recaptcha_response_field' : response, 'recaptcha_shortencode_field': self.file_id})) if not res['success']: self.invalidCaptcha() diff --git a/module/plugins/hoster/IfileIt.py b/module/plugins/hoster/IfileIt.py index b7e37457d..2dae4cd80 100644 --- a/module/plugins/hoster/IfileIt.py +++ b/module/plugins/hoster/IfileIt.py @@ -27,27 +27,30 @@ class IfileIt(SimpleHoster): def handleFree(self): - ukey = re.match(self.__pattern__, self.pyfile.url).group(1) - json_url = 'http://ifile.it/new_download-request.json' + ukey = re.match(self.__pattern__, self.pyfile.url).group(1) + json_url = 'http://ifile.it/new_download-request.json' post_data = {"ukey": ukey, "ab": "0"} + res = json_loads(self.load(json_url, post=post_data)) - json_response = json_loads(self.load(json_url, post=post_data)) - self.logDebug(json_response) - if json_response['status'] == 3: + self.logDebug(res) + + if res['status'] == 3: self.offline() - if json_response['captcha']: + if res['captcha']: captcha_key = re.search(self.RECAPTCHA_PATTERN, self.html).group(1) recaptcha = ReCaptcha(self) post_data['ctype'] = "recaptcha" for _i in xrange(5): - post_data['recaptcha_challenge'], post_data['recaptcha_response'] = recaptcha.challenge(captcha_key) - json_response = json_loads(self.load(json_url, post=post_data)) - self.logDebug(json_response) + challenge, response = recaptcha.challenge(captcha_key) + post_data.update({'recaptcha_challenge': challenge, + 'recaptcha_response' : response}) + res = json_loads(self.load(json_url, post=post_data)) + self.logDebug(res) - if json_response['retry']: + if res['retry']: self.invalidCaptcha() else: self.correctCaptcha() @@ -55,10 +58,10 @@ class IfileIt(SimpleHoster): else: self.fail(_("Incorrect captcha")) - if not "ticket_url" in json_response: + if not "ticket_url" in res: self.error(_("No download URL")) - self.download(json_response['ticket_url']) + self.download(res['ticket_url']) getInfo = create_getInfo(IfileIt) diff --git a/module/plugins/hoster/KingfilesNet.py b/module/plugins/hoster/KingfilesNet.py index c84e3bb0f..13cbf4781 100644 --- a/module/plugins/hoster/KingfilesNet.py +++ b/module/plugins/hoster/KingfilesNet.py @@ -36,17 +36,17 @@ class KingfilesNet(SimpleHoster): def handleFree(self): # Click the free user button - post_data = {'op': "download1", - 'usr_login': "", - 'id': self.info['pattern']['ID'], - 'fname': self.pyfile.name, - 'referer': "", + post_data = {'op' : "download1", + 'usr_login' : "", + 'id' : self.info['pattern']['ID'], + 'fname' : self.pyfile.name, + 'referer' : "", 'method_free': "+"} self.html = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) solvemedia = SolveMedia(self) - captcha_challenge, captcha_response = solvemedia.challenge() + challenge, response = solvemedia.challenge() # Make the downloadlink appear and load the file m = re.search(self.RAND_ID_PATTERN, self.html) @@ -56,15 +56,15 @@ class KingfilesNet(SimpleHoster): rand = m.group(1) self.logDebug("rand = ", rand) - post_data = {'op': "download2", - 'id': self.info['pattern']['ID'], - 'rand': rand, - 'referer': self.pyfile.url, - 'method_free': "+", - 'method_premium': "", - 'adcopy_response': captcha_response, - 'adcopy_challenge': captcha_challenge, - 'down_direct': "1"} + post_data = {'op' : "download2", + 'id' : self.info['pattern']['ID'], + 'rand' : rand, + 'referer' : self.pyfile.url, + 'method_free' : "+", + 'method_premium' : "", + 'adcopy_response' : response, + 'adcopy_challenge': challenge, + 'down_direct' : "1"} self.html = self.load(self.pyfile.url, post=post_data, cookies=True, decode=True) diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 4e55496c6..0a5b26410 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -58,9 +58,12 @@ class LoadTo(SimpleHoster): if captcha_key is None: self.download(download_url) else: - captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) - self.download(download_url, post={"adcopy_challenge": captcha_challenge, "adcopy_response": captcha_response}) + challenge, response = solvemedia.challenge(captcha_key) + + self.download(download_url, post={"adcopy_challenge": challenge, "adcopy_response": response}) + check = self.checkDownload({'404': re.compile("\A

404 Not Found

"), 'html': re.compile("html")}) + if check == "404": self.invalidCaptcha() self.retry() diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 3ed1199f6..cdfa410a9 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -117,6 +117,8 @@ class MediafireCom(SimpleHoster): def checkCaptcha(self): solvemedia = SolveMedia(self) - captcha_challenge, captcha_response = solvemedia.challenge() - self.html = self.load(self.url, post={"adcopy_challenge": captcha_challenge, - "adcopy_response": captcha_response}, decode=True) + challenge, response = solvemedia.challenge() + self.html = self.load(self.url, + post={'adcopy_challenge': challenge, + 'adcopy_response' : response}, + decode=True) diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 7788616a8..cc11fa7c7 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -129,13 +129,11 @@ class RapidgatorNet(SimpleHoster): break else: captcha, captcha_key = self.getCaptcha() - captcha_challenge, captcha_response = captcha.challenge(captcha_key) + challenge, response = captcha.challenge(captcha_key) - self.html = self.load(url, post={ - "DownloadCaptchaForm[captcha]": "", - "adcopy_challenge": captcha_challenge, - "adcopy_response": captcha_response - }) + self.html = self.load(url, post={'DownloadCaptchaForm[captcha]': "", + 'adcopy_challenge' : challenge, + 'adcopy_response' : response}) if "The verification code is incorrect" in self.html: self.invalidCaptcha() diff --git a/module/plugins/hoster/RapiduNet.py b/module/plugins/hoster/RapiduNet.py index e14b18a4f..a3b2cffcd 100644 --- a/module/plugins/hoster/RapiduNet.py +++ b/module/plugins/hoster/RapiduNet.py @@ -57,12 +57,12 @@ class RapiduNet(SimpleHoster): recaptcha = ReCaptcha(self) for _i in xrange(10): - challenge, code = recaptcha.challenge(self.RECAPTCHA_KEY) + challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) jsvars = self.getJsonResponse("https://rapidu.net/ajax.php?a=getCheckCaptcha", {'_go' : None, 'captcha1': challenge, - 'captcha2': code, + 'captcha2': response, 'fileId' : self.info['ID']}) if jsvars['message'] == 'success': self.download(jsvars['url']) @@ -70,13 +70,13 @@ class RapiduNet(SimpleHoster): def getJsonResponse(self, url, post_data): - response = self.load(url, post=post_data, decode=True) - if not response.startswith('{'): + res = self.load(url, post=post_data, decode=True) + if not res.startswith('{'): self.retry() - self.logDebug(url, response) + self.logDebug(url, res) - return json_loads(response) + return json_loads(res) getInfo = create_getInfo(RapiduNet) diff --git a/module/plugins/hoster/UploadableCh.py b/module/plugins/hoster/UploadableCh.py index 77b3d7d8a..3dd796900 100644 --- a/module/plugins/hoster/UploadableCh.py +++ b/module/plugins/hoster/UploadableCh.py @@ -53,13 +53,13 @@ class UploadableCh(SimpleHoster): recaptcha = ReCaptcha(self) - challenge, captcha = recaptcha.challenge(self.RECAPTCHA_KEY) + challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) # Submit the captcha solution self.load("http://www.uploadable.ch/checkReCaptcha.php", cookies=True, post={'recaptcha_challenge_field' : challenge, - 'recaptcha_response_field' : captcha, + 'recaptcha_response_field' : response, 'recaptcha_shortencode_field': self.info['ID']}, decode=True) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 7af6501eb..833468a80 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -206,8 +206,8 @@ class UploadedTo(Hoster): recaptcha = ReCaptcha(self) for _i in xrange(5): - challenge, result = recaptcha.challenge() - options = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": result} + challenge, response = recaptcha.challenge() + options = {"recaptcha_challenge_field": challenge, "recaptcha_response_field": response} self.wait() result = self.load(url, post=options) diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index 239cc92f5..25c424f1f 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -52,9 +52,9 @@ class UpstoreNet(SimpleHoster): self.wait(wait_time) # then, handle the captcha - challenge, code = recaptcha.challenge() - post_data['recaptcha_challenge_field'] = challenge - post_data['recaptcha_response_field'] = code + challenge, response = recaptcha.challenge() + post_data.update({'recaptcha_challenge_field': challenge, + 'recaptcha_response_field' : response}) self.html = self.load(self.pyfile.url, post=post_data, decode=True) -- cgit v1.2.3 From 58656ab0b1b7f79ee31c38b7675f0587269f014f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 10 Dec 2014 02:59:27 +0100 Subject: [CaptchaService] New service AdYouLike + AdsCaptcha detect_key fixup --- module/plugins/hoster/DlFreeFr.py | 85 +------------ module/plugins/internal/CaptchaService.py | 203 +++++++++++++++++++++++------- 2 files changed, 164 insertions(+), 124 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/DlFreeFr.py b/module/plugins/hoster/DlFreeFr.py index 14b74c779..793c81b1c 100644 --- a/module/plugins/hoster/DlFreeFr.py +++ b/module/plugins/hoster/DlFreeFr.py @@ -3,9 +3,9 @@ import pycurl import re -from module.common.json_layer import json_loads from module.network.Browser import Browser from module.network.CookieJar import CookieJar +from module.plugins.internal.CaptchaService import AdYouLike from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns @@ -33,87 +33,10 @@ class CustomBrowser(Browser): return Browser.load(self, *args, **kwargs) -class AdYouLike: - """ - Class to support adyoulike captcha service - """ - ADYOULIKE_INPUT_PATTERN = r'Adyoulike\.create\((.*?)\);' - ADYOULIKE_CALLBACK = r'Adyoulike\.g\._jsonp_5579316662423138' - ADYOULIKE_CHALLENGE_PATTERN = ADYOULIKE_CALLBACK + r'\((.*?)\)' - - - def __init__(self, plugin, engine="adyoulike"): - self.plugin = plugin - self.engine = engine - - - def challenge(self, html): - adyoulike_data_string = None - m = re.search(self.ADYOULIKE_INPUT_PATTERN, html) - if m: - adyoulike_data_string = m.group(1) - else: - self.plugin.fail("Can't read AdYouLike input data") - - # {"adyoulike":{"key":"P~zQ~O0zV0WTiAzC-iw0navWQpCLoYEP"}, - # "all":{"element_id":"ayl_private_cap_92300","lang":"fr","env":"prod"}} - ayl_data = json_loads(adyoulike_data_string) - - res = self.plugin.load("http://api-ayl.appspot.com/challenge", - get={'key' : ayl_data[self.engine]['key'], - 'env' : ayl_data['all']['env'], - 'callback': self.ADYOULIKE_CALLBACK}) - - m = re.search(self.ADYOULIKE_CHALLENGE_PATTERN, res) - challenge_string = None - if m: - challenge_string = m.group(1) - else: - self.plugin.fail("Invalid AdYouLike challenge") - challenge_data = json_loads(challenge_string) - - return ayl_data, challenge_data - - - def result(self, ayl, challenge): - """ - Adyoulike.g._jsonp_5579316662423138 - ({"translations":{"fr":{"instructions_visual":"Recopiez « Soonnight » ci-dessous :"}}, - "site_under":true,"clickable":true,"pixels":{"VIDEO_050":[],"DISPLAY":[],"VIDEO_000":[],"VIDEO_100":[], - "VIDEO_025":[],"VIDEO_075":[]},"medium_type":"image/adyoulike", - "iframes":{"big":""},"shares":{},"id":256, - "token":"e6QuI4aRSnbIZJg02IsV6cp4JQ9~MjA1","formats":{"small":{"y":300,"x":0,"w":300,"h":60}, - "big":{"y":0,"x":0,"w":300,"h":250},"hover":{"y":440,"x":0,"w":300,"h":60}}, - "tid":"SqwuAdxT1EZoi4B5q0T63LN2AkiCJBg5"}) - """ - response = None - try: - instructions_visual = challenge['translations'][ayl['all']['lang']]['instructions_visual'] - m = re.search(u".*«(.*)».*", instructions_visual) - if m: - response = m.group(1).strip() - else: - self.plugin.fail("Can't parse instructions visual") - except KeyError: - self.plugin.fail("No instructions visual") - - #TODO: Supports captcha - - if not response: - self.plugin.fail("AdYouLike result failed") - - return {"_ayl_captcha_engine" : self.engine, - "_ayl_env" : ayl['all']['env'], - "_ayl_tid" : challenge['tid'], - "_ayl_token_challenge": challenge['token'], - "_ayl_response" : response} - - class DlFreeFr(SimpleHoster): __name__ = "DlFreeFr" __type__ = "hoster" - __version__ = "0.25" + __version__ = "0.26" __pattern__ = r'http://(?:www\.)?dl\.free\.fr/(\w+|getfile\.pl\?file=/\w+)' @@ -169,9 +92,7 @@ class DlFreeFr(SimpleHoster): action, inputs = self.parseHtmlForm('action="getfile.pl"') adyoulike = AdYouLike(self) - ayl, challenge = adyoulike.challenge(self.html) - result = adyoulike.result(ayl, challenge) - inputs.update(result) + inputs.update(adyoulike.challenge()) self.load("http://dl.free.fr/getfile.pl", post=inputs) headers = self.getLastHeaders() diff --git a/module/plugins/internal/CaptchaService.py b/module/plugins/internal/CaptchaService.py index 7009e6986..965799e8e 100644 --- a/module/plugins/internal/CaptchaService.py +++ b/module/plugins/internal/CaptchaService.py @@ -4,10 +4,12 @@ import re from random import random +from module.common.json_layer import json_loads + class CaptchaService: __name__ = "CaptchaService" - __version__ = "0.15" + __version__ = "0.16" __description__ = """Base captcha service plugin""" __license__ = "GPLv3" @@ -34,7 +36,7 @@ class CaptchaService: m = re.search(self.KEY_PATTERN, html) if m: - self.key = m.group("KEY") + self.key = m.group(1).strip() self.plugin.logDebug("%s key: %s" % (self.__name__, self.key)) return self.key else: @@ -59,8 +61,8 @@ class ReCaptcha(CaptchaService): __authors__ = [("pyLoad Team", "admin@pyload.org")] - KEY_PATTERN = r'recaptcha(/api|\.net)/(challenge|noscript)\?k=(?P[\w-]+)' - KEY_AJAX_PATTERN = r'Recaptcha\.create\s*\(\s*["\'](?P[\w-]+)' + KEY_PATTERN = r'recaptcha(?:/api|\.net)/(?:challenge|noscript)\?k=([\w-]+)' + KEY_AJAX_PATTERN = r'Recaptcha\.create\s*\(\s*["\']([\w-]+)' def detect_key(self, html=None): @@ -74,7 +76,7 @@ class ReCaptcha(CaptchaService): m = re.search(self.KEY_PATTERN, html) or re.search(self.KEY_AJAX_PATTERN, html) if m: - self.key = m.group("KEY") + self.key = m.group(1).strip() self.plugin.logDebug("ReCaptcha key: %s" % self.key) return self.key else: @@ -91,36 +93,43 @@ class ReCaptcha(CaptchaService): self.plugin.fail(errmsg) raise TypeError(errmsg) - js = self.plugin.req.load("http://www.google.com/recaptcha/api/challenge", get={'k': key}) + html = self.plugin.req.load("http://www.google.com/recaptcha/api/challenge", get={'k': key}) try: - challenge = re.search("challenge : '(.+?)',", js).group(1) - server = re.search("server : '(.+?)',", js).group(1) + challenge = re.search("challenge : '(.+?)',", html).group(1) + server = re.search("server : '(.+?)',", html).group(1) except: - self.plugin.error("ReCaptcha challenge pattern not found") - - result = self.result(server, challenge) + errmsg = _("ReCaptcha challenge pattern not found") + self.plugin.fail(errmsg) + raise ValueError(errmsg) - self.plugin.logDebug("ReCaptcha result: %s" % result, "challenge: %s" % challenge) + self.plugin.logDebug("ReCaptcha challenge: %s" % challenge) - return challenge, result + return challenge, self.result(server, challenge) def result(self, server, challenge): - return self.plugin.decryptCaptcha("%simage" % server, get={'c': challenge}, - cookies=True, forceUser=True, imgtype="jpg") + result = self.plugin.decryptCaptcha("%simage" % server, + get={'c': challenge}, + cookies=True, + forceUser=True, + imgtype="jpg") + + self.plugin.logDebug("ReCaptcha result: %s" % result) + + return result class AdsCaptcha(CaptchaService): __name__ = "AdsCaptcha" - __version__ = "0.05" + __version__ = "0.06" __description__ = """AdsCaptcha captcha service plugin""" __license__ = "GPLv3" __authors__ = [("pyLoad Team", "admin@pyload.org")] - ID_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?[^"\']*CaptchaId=(?P\d+)' - KEY_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?[^"\']*PublicKey=(?P[\w-]+)' + CAPTCHAID_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?[^"\']*CaptchaId=(\d+)' + PUBLICKEY_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?[^"\']*PublicKey=([\w-]+)' def detect_key(self, html=None): @@ -132,18 +141,18 @@ class AdsCaptcha(CaptchaService): self.plugin.fail(errmsg) raise TypeError(errmsg) - m = re.search(self.ID_PATTERN, html) - n = re.search(self.KEY_PATTERN, html) + m = re.search(self.PUBLICKEY_PATTERN, html) + n = re.search(self.CAPTCHAID_PATTERN, html) if m and n: - self.key = (m.group("ID"), m.group("KEY")) - self.plugin.logDebug("AdsCaptcha id|key: %s | %s" % self.key) + self.key = (m.group(1).strip(), n.group(1).strip()) #: key is the tuple(PublicKey, CaptchaId) + self.plugin.logDebug("AdsCaptcha key|id: %s | %s" % self.key) return self.key else: - self.plugin.logDebug("AdsCaptcha id or key not found") + self.plugin.logDebug("AdsCaptcha key or id not found") return None - def challenge(self, key=None): #: key is a tuple(CaptchaId, PublicKey) + def challenge(self, key=None): if not key: if self.detect_key(): key = self.key @@ -152,25 +161,31 @@ class AdsCaptcha(CaptchaService): self.plugin.fail(errmsg) raise TypeError(errmsg) - CaptchaId, PublicKey = key + PublicKey, CaptchaId = key - js = self.plugin.req.load("http://api.adscaptcha.com/Get.aspx", get={'CaptchaId': CaptchaId, 'PublicKey': PublicKey}) + html = self.plugin.req.load("http://api.adscaptcha.com/Get.aspx", get={'CaptchaId': CaptchaId, 'PublicKey': PublicKey}) try: - challenge = re.search("challenge: '(.+?)',", js).group(1) - server = re.search("server: '(.+?)',", js).group(1) + challenge = re.search("challenge: '(.+?)',", html).group(1) + server = re.search("server: '(.+?)',", html).group(1) except: - self.plugin.error("AdsCaptcha challenge pattern not found") - - result = self.result(server, challenge) + errmsg = _("AdsCaptcha challenge pattern not found") + self.plugin.fail(errmsg) + raise ValueError(errmsg) - self.plugin.logDebug("AdsCaptcha result: %s" % result, "challenge: %s" % challenge) + self.plugin.logDebug("AdsCaptcha challenge: %s" % challenge) - return challenge, result + return challenge, self.result(server, challenge) def result(self, server, challenge): - return self.plugin.decryptCaptcha("%sChallenge.aspx" % server, get={'cid': challenge, 'dummy': random()}, - cookies=True, imgtype="jpg") + result = self.plugin.decryptCaptcha("%sChallenge.aspx" % server, + get={'cid': challenge, 'dummy': random()}, + cookies=True, + imgtype="jpg") + + self.plugin.logDebug("AdsCaptcha result: %s" % result) + + return result class SolveMedia(CaptchaService): @@ -182,7 +197,7 @@ class SolveMedia(CaptchaService): __authors__ = [("pyLoad Team", "admin@pyload.org")] - KEY_PATTERN = r'api\.solvemedia\.com/papi/challenge\.(no)?script\?k=(?P.+?)["\']' + KEY_PATTERN = r'api\.solvemedia\.com/papi/challenge\.(?:no)?script\?k=(.+?)["\']' def challenge(self, key=None): @@ -198,16 +213,120 @@ class SolveMedia(CaptchaService): try: challenge = re.search(r'', html).group(1) - server = "http://api.solvemedia.com/papi/media" + server = "http://api.solvemedia.com/papi/media" except: - self.plugin.error("SolveMedia challenge pattern not found") + errmsg = _("SolveMedia challenge pattern not found") + self.plugin.fail(errmsg) + raise ValueError(errmsg) + + self.plugin.logDebug("SolveMedia challenge: %s" % challenge) + + return challenge, self.result(server, challenge) + + + def result(self, server, challenge): + result = self.plugin.decryptCaptcha(server, get={'c': challenge}, imgtype="gif") + + self.plugin.logDebug("SolveMedia result: %s" % result) + + return result + + +class AdYouLike(CaptchaService): + __name__ = "AdYouLike" + __version__ = "0.02" + + __description__ = """AdYouLike captcha service plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + AYL_PATTERN = r'Adyoulike\.create\s*\((.+?)\)' + CALLBACK_PATTERN = r'(Adyoulike\.g\._jsonp_\d+)' + + + def detect_key(self, html=None): + if not html: + if hasattr(self.plugin, "html") and self.plugin.html: + html = self.plugin.html + else: + errmsg = _("AdYouLike html not found") + self.plugin.fail(errmsg) + raise TypeError(errmsg) - result = self.result(server, challenge) + m = re.search(self.AYL_PATTERN, html) + n = re.search(self.CALLBACK_PATTERN, html) + if m and n: + self.key = (m.group(1).strip(), n.group(1).strip()) + self.plugin.logDebug("AdYouLike ayl|callback: %s | %s" % self.key) + return self.key #: key is the tuple(ayl, callback) + else: + self.plugin.logDebug("AdYouLike ayl or callback not found") + return None - self.plugin.logDebug("SolveMedia result: %s" % result, "challenge: %s" % challenge) - return challenge, result + def challenge(self, key=None): + if not key: + if self.detect_key(): + key = self.key + else: + errmsg = _("AdYouLike key not found") + self.plugin.fail(errmsg) + raise TypeError(errmsg) + + ayl, callback = key + + # {"adyoulike":{"key":"P~zQ~O0zV0WTiAzC-iw0navWQpCLoYEP"}, + # "all":{"element_id":"ayl_private_cap_92300","lang":"fr","env":"prod"}} + ayl = json_loads(ayl) + + html = self.plugin.req.load("http://api-ayl.appspot.com/challenge", + get={'key' : ayl['adyoulike']['key'], + 'env' : ayl['all']['env'], + 'callback': callback}) + try: + challenge = json_loads(re.search(callback + r'\s*\((.+?)\)', html).group(1)) + except: + errmsg = _("AdYouLike challenge pattern not found") + self.plugin.fail(errmsg) + raise ValueError(errmsg) + + self.plugin.logDebug("AdYouLike challenge: %s" % challenge) + + return self.result(ayl, challenge) def result(self, server, challenge): - return self.plugin.decryptCaptcha(server, get={'c': challenge}, imgtype="gif") + # Adyoulike.g._jsonp_5579316662423138 + # ({"translations":{"fr":{"instructions_visual":"Recopiez « Soonnight » ci-dessous :"}}, + # "site_under":true,"clickable":true,"pixels":{"VIDEO_050":[],"DISPLAY":[],"VIDEO_000":[],"VIDEO_100":[], + # "VIDEO_025":[],"VIDEO_075":[]},"medium_type":"image/adyoulike", + # "iframes":{"big":""},"shares":{},"id":256, + # "token":"e6QuI4aRSnbIZJg02IsV6cp4JQ9~MjA1","formats":{"small":{"y":300,"x":0,"w":300,"h":60}, + # "big":{"y":0,"x":0,"w":300,"h":250},"hover":{"y":440,"x":0,"w":300,"h":60}}, + # "tid":"SqwuAdxT1EZoi4B5q0T63LN2AkiCJBg5"}) + + if isinstance(server, basestring): + server = json_loads(server) + + if isinstance(challenge, basestring): + challenge = json_loads(challenge) + + try: + instructions_visual = challenge['translations'][server['all']['lang']]['instructions_visual'] + result = re.search(u'«(.+?)»', instructions_visual).group(1).strip() + except: + errmsg = _("AdYouLike result not found") + self.plugin.fail(errmsg) + raise ValueError(errmsg) + + result = {'_ayl_captcha_engine' : "adyoulike", + '_ayl_env' : server['all']['env'], + '_ayl_tid' : challenge['tid'], + '_ayl_token_challenge': challenge['token'], + '_ayl_response' : response} + + self.plugin.logDebug("AdYouLike result: %s" % result) + + return result -- cgit v1.2.3