From a0fc1dd7dba89dccdb730f8ea0259e4ac9ba7e08 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 14 Nov 2014 00:12:31 +0100 Subject: [Plugin] Fix wait routine (thx rlindner81) --- module/plugins/Plugin.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'module') diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 120dc9a6e..4dadb67b4 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -286,6 +286,12 @@ class Plugin(Base): return True, 10 + def setReconnect(self, reconnect): + reconnect = bool(reconnect) + self.logDebug("Set wantReconnect to: %s (previous: %s)" % (reconnect, self.wantReconnect)) + self.wantReconnect = reconnect + + def setWait(self, seconds, reconnect=None): """Set a specific wait time later used with `wait` @@ -301,16 +307,19 @@ class Plugin(Base): self.pyfile.waitUntil = wait_until if reconnect is not None: - self.logDebug("Set wantReconnect to: %s (previous: %s)" % (reconnect, self.wantReconnect)) - self.wantReconnect = reconnect + self.setReconnect(reconnect) - def wait(self, seconds=0, reconnect=None): + def wait(self, seconds=None, reconnect=None): """ waits the time previously set """ pyfile = self.pyfile - self.setWait(seconds, reconnect) + if seconds is not None: + self.setWait(seconds) + + if reconnect is not None: + self.setReconnect(reconnect) self.waiting = True @@ -321,9 +330,13 @@ class Plugin(Base): "WAITUNTIL: %f" % pyfile.waitUntil, "RECONNECT: %s" % self.wantReconnect) - if not account: + if self.account: self.logDebug("Ignore reconnection due account logged") + while pyfile.waitUntil > time(): + if pyfile.abort: + self.abort() + else: while pyfile.waitUntil > time(): self.thread.m.reconnecting.wait(2) @@ -334,10 +347,6 @@ class Plugin(Base): self.waiting = False self.wantReconnect = False raise Reconnect - else: - while pyfile.waitUntil > time(): - if pyfile.abort: - self.abort() self.waiting = False -- cgit v1.2.3 From e30b7892ed77158dc2e518bf322dc0a0a4430d4e Mon Sep 17 00:00:00 2001 From: Thierry Merle Date: Fri, 14 Nov 2014 01:39:27 +0100 Subject: [RapidgatorNet] Set the language in COOKIES --- module/plugins/hoster/RapidgatorNet.py | 4 +++- module/plugins/hoster/TurbobitNet.py | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index 11d318333..48f16172d 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -14,7 +14,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" - __version__ = "0.25" + __version__ = "0.26" __pattern__ = r'http://(?:www\.)?(rapidgator\.net|rg\.to)/file/\w+' @@ -28,6 +28,8 @@ class RapidgatorNet(SimpleHoster): API_URL = "http://rapidgator.net/api/file" + COOKIES = [(".rapidgator.net", "lang", "en")] + NAME_PATTERN = r'Download file (?P<N>.*)' SIZE_PATTERN = r'File size:\s*(?P[\d.,]+) (?P[\w^_]+)' OFFLINE_PATTERN = r'>(File not found|Error 404)' diff --git a/module/plugins/hoster/TurbobitNet.py b/module/plugins/hoster/TurbobitNet.py index c9d1ede34..6aa7bdd4a 100644 --- a/module/plugins/hoster/TurbobitNet.py +++ b/module/plugins/hoster/TurbobitNet.py @@ -27,14 +27,14 @@ class TurbobitNet(SimpleHoster): ("prOq", None)] - NAME_PATTERN = r'id="file-title">(?P.+?)<' - SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P[\w^_]+)' - OFFLINE_PATTERN = r'

File Not Found

|html\(\'File (?:was )?not found' - URL_REPLACEMENTS = [(__pattern__, "http://turbobit.net/\g.html")] COOKIES = [(".turbobit.net", "user_lang", "en")] + NAME_PATTERN = r'id="file-title">(?P.+?)<' + SIZE_PATTERN = r'class="file-size">(?P[\d.,]+) (?P[\w^_]+)' + OFFLINE_PATTERN = r'

File Not Found

|html\(\'File (?:was )?not found' + LINK_PATTERN = r'(?P/download/redirect/[^"\']+)' LIMIT_WAIT_PATTERN = r'
(\d+)<' -- cgit v1.2.3 From d7d2b0c56e16866313b7f746f94569f085acef01 Mon Sep 17 00:00:00 2001 From: Radek Senfeld Date: Fri, 14 Nov 2014 01:47:39 +0100 Subject: [UlozTo] Fixed hoster and account --- module/plugins/accounts/UlozTo.py | 22 +++++++++++++--------- module/plugins/hoster/UlozTo.py | 4 ++-- module/plugins/internal/SimpleHoster.py | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/plugins/accounts/UlozTo.py b/module/plugins/accounts/UlozTo.py index 2632d2535..ea2562280 100644 --- a/module/plugins/accounts/UlozTo.py +++ b/module/plugins/accounts/UlozTo.py @@ -2,13 +2,15 @@ import re +from urlparse import urljoin + from module.plugins.Account import Account class UlozTo(Account): __name__ = "UlozTo" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __description__ = """Uloz.to account plugin""" __license__ = "GPLv3" @@ -20,9 +22,10 @@ class UlozTo(Account): def loadAccountInfo(self, user, req): - #this cookie gets lost somehow after each request - self.phpsessid = req.cj.getCookie("ULOSESSID") + self.phpsessid = req.cj.getCookie("ULOSESSID") #@NOTE: this cookie gets lost somehow after each request + html = req.load("http://www.ulozto.net/", decode=True) + req.cj.setCookie(".ulozto.net", "ULOSESSID", self.phpsessid) m = re.search(self.TRAFFIC_LEFT_PATTERN, html) @@ -37,12 +40,13 @@ class UlozTo(Account): action = re.findall('
' in html: self.wrongPassword() diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index e4b28e81d..294bd8e17 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -15,7 +15,7 @@ def convertDecimalPrefix(m): class UlozTo(SimpleHoster): __name__ = "UlozTo" __type__ = "hoster" - __version__ = "0.99" + __version__ = "1.00" __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(?:live/)?(?P\w+/[^/?]*)' @@ -37,7 +37,7 @@ class UlozTo(SimpleHoster): VIPLINK_PATTERN = r'' FREE_URL_PATTERN = r'
' + TOKEN_PATTERN = r' Date: Fri, 14 Nov 2014 01:53:24 +0100 Subject: [SimpleCrypter][SimpleHoster] Temp workaround --- module/plugins/internal/SimpleCrypter.py | 5 ++--- module/plugins/internal/SimpleHoster.py | 9 +++------ 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'module') diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 0e43496c4..01d1895a6 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -13,7 +13,7 @@ from module.utils import fixup, html_unescape class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" __type__ = "crypter" - __version__ = "0.28" + __version__ = "0.29" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), #: Overrides core.config['general']['folder_per_package'] @@ -96,8 +96,7 @@ class SimpleCrypter(Crypter): self.pyfile.url = replace_patterns(self.pyfile.url, self.URL_REPLACEMENTS) - if self.html is None: - self.html = self.load(self.pyfile.url, decode=not self.TEXT_ENCODING, cookies=bool(self.COOKIES)) + self.html = self.load(self.pyfile.url, decode=not self.TEXT_ENCODING, cookies=bool(self.COOKIES)) if isinstance(self.TEXT_ENCODING, basestring): self.html = unicode(self.html, self.TEXT_ENCODING) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 1f7753003..2562f0af3 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -200,7 +200,7 @@ def timestamp(): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "0.53" + __version__ = "0.54" __pattern__ = r'^unmatchable$' @@ -274,11 +274,8 @@ class SimpleHoster(Hoster): return direct_link else: self.logDebug(_("No direct download link found")) - self.html = None - self.info = {} - if self.html is None: - self.html = self.load(self.pyfile.url, decode=not self.TEXT_ENCODING, cookies=bool(self.COOKIES)) + self.html = self.load(self.pyfile.url, decode=not self.TEXT_ENCODING, cookies=bool(self.COOKIES)) if isinstance(self.TEXT_ENCODING, basestring): self.html = unicode(self.html, self.TEXT_ENCODING) @@ -296,7 +293,7 @@ class SimpleHoster(Hoster): else: premium_only = hasattr(self, 'PREMIUM_ONLY_PATTERN') and re.search(self.PREMIUM_ONLY_PATTERN, self.html) - if not premium_only and not self.info: #: Usually premium only pages doesn't show any file information + if not premium_only: #: Usually premium only pages doesn't show any file information self.getFileInfo() if self.premium and (not self.FORCE_CHECK_TRAFFIC or self.checkTrafficLeft()): -- cgit v1.2.3 From 38a5cae36ebeb1894fa3c6a5c2f2eb2d58fe293b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 01:39:26 +0100 Subject: [Plugin] Fix wait routine 2 --- module/plugins/Plugin.py | 9 ++++++--- module/plugins/hoster/ShareplaceCom.py | 1 - module/plugins/hoster/YourfilesTo.py | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 4dadb67b4..1be74e896 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -326,9 +326,8 @@ class Plugin(Base): status = pyfile.status pyfile.setStatus("waiting") - self.logDebug("WAIT: %d seconds" % seconds, - "WAITUNTIL: %f" % pyfile.waitUntil, - "RECONNECT: %s" % self.wantReconnect) + self.logInfo(_("Wait: %d seconds") % pyfile.waitUntil - time(), + _("Reconnect: %s") % self.wantReconnect) if self.account: self.logDebug("Ignore reconnection due account logged") @@ -336,6 +335,8 @@ class Plugin(Base): while pyfile.waitUntil > time(): if pyfile.abort: self.abort() + + sleep(1) else: while pyfile.waitUntil > time(): self.thread.m.reconnecting.wait(2) @@ -348,6 +349,8 @@ class Plugin(Base): self.wantReconnect = False raise Reconnect + sleep(1) + self.waiting = False pyfile.status = status diff --git a/module/plugins/hoster/ShareplaceCom.py b/module/plugins/hoster/ShareplaceCom.py index cb0376b10..ccf4bcda5 100644 --- a/module/plugins/hoster/ShareplaceCom.py +++ b/module/plugins/hoster/ShareplaceCom.py @@ -33,7 +33,6 @@ class ShareplaceCom(Hoster): wait_time = self.get_waiting_time() self.setWait(wait_time) - self.logDebug("Waiting %d seconds." % wait_time) self.wait() diff --git a/module/plugins/hoster/YourfilesTo.py b/module/plugins/hoster/YourfilesTo.py index caa259cbd..83ab89110 100644 --- a/module/plugins/hoster/YourfilesTo.py +++ b/module/plugins/hoster/YourfilesTo.py @@ -34,7 +34,6 @@ class YourfilesTo(Hoster): wait_time = self.get_waiting_time() self.setWait(wait_time) - self.logDebug("Waiting %d seconds." % wait_time) self.wait() -- cgit v1.2.3 From 5f150f8c284178ba55cce3ecdf347131cc61ad1a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 01:59:37 +0100 Subject: [LinkCryptWs] Fix typo --- module/plugins/crypter/LinkCryptWs.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py index 67b1a3f02..b90e18490 100644 --- a/module/plugins/crypter/LinkCryptWs.py +++ b/module/plugins/crypter/LinkCryptWs.py @@ -15,7 +15,7 @@ from module.utils import html_unescape class LinkCryptWs(Crypter): __name__ = "LinkCryptWs" __type__ = "crypter" - __version__ = "0.04" + __version__ = "0.05" __pattern__ = r'http://(?:www\.)?linkcrypt\.ws/(dir|container)/(?P\w+)' @@ -38,7 +38,7 @@ class LinkCryptWs(Crypter): self.preferred_sources = ['cnl', 'web', 'dlc', 'rsdf', 'ccf', ] #['cnl', 'rsdf', 'ccf', 'dlc', 'web'] - def prepare(): + def prepare(self): # Init self.package = pyfile.package() self.fileid = re.match(self.__pattern__, pyfile.url).group('ID') @@ -46,7 +46,7 @@ class LinkCryptWs(Crypter): self.req.cj.setCookie(".linkcrypt.ws", "language", "en") # Request package - self.req.http.c.setopt(pycurl.USERAGENT, "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko") #better chance to not get those key-captchas + self.req.http.c.setopt(pycurl.USERAGENT, "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko") #: better chance to not get those key-captchas self.html = self.load(self.pyfile.url) @@ -96,8 +96,6 @@ class LinkCryptWs(Crypter): package_found = True break - package_links = set(package_links) - # Pack if package_links: self.packages = [(package_name, package_links, folder_name)] -- cgit v1.2.3 From c97ffb8cc318f509aad2c7c5c741f0408a2c3eb7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 06:23:06 +0100 Subject: [HTTPRequest] Raise Fail if write response fails --- module/network/HTTPRequest.py | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'module') diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py index df952a690..67ede2854 100644 --- a/module/network/HTTPRequest.py +++ b/module/network/HTTPRequest.py @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - + @author: RaNaN """ @@ -25,11 +25,11 @@ from httplib import responses from logging import getLogger from cStringIO import StringIO -from module.plugins.Plugin import Abort +from module.plugins.Plugin import Abort, Fail def myquote(url): return quote(url.encode('utf_8') if isinstance(url, unicode) else url, safe="%/:=&?~#+!$,;'@()*[]") - + def myurlencode(data): data = dict(data) return urlencode(dict((x.encode('utf_8') if isinstance(x, unicode) else x, \ @@ -231,11 +231,13 @@ class HTTPRequest(): def getResponse(self): """ retrieve response from string io """ - if self.rep is None: return "" - value = self.rep.getvalue() - self.rep.close() - self.rep = StringIO() - return value + if self.rep is None: + return "" + else: + value = self.rep.getvalue() + self.rep.close() + self.rep = StringIO() + return value def decodeResponse(self, rep): """ decode with correct encoding, relies on header """ @@ -258,7 +260,7 @@ class HTTPRequest(): #self.log.debug("Decoded %s" % encoding ) if lookup(encoding).name == 'utf-8' and rep.startswith(BOM_UTF8): encoding = 'utf-8-sig' - + decoder = getincrementaldecoder(encoding)("replace") rep = decoder.decode(rep, True) @@ -266,6 +268,7 @@ class HTTPRequest(): except LookupError: self.log.debug("No Decoder foung for %s" % encoding) + except Exception: self.log.debug("Error when decoding string from %s." % encoding) @@ -275,13 +278,15 @@ class HTTPRequest(): """ writes response """ if self.rep.tell() > 1000000 or self.abort: rep = self.getResponse() - if self.abort: raise Abort() - f = open("response.dump", "wb") - f.write(rep) - f.close() - raise Exception("Loaded Url exceeded limit") - self.rep.write(buf) + if self.abort: + raise Abort() + + with open("response.dump", "wb") as f: + f.write(rep) + raise Fail("Loaded url exceeded size limit") + else: + self.rep.write(buf) def writeHeader(self, buf): """ writes header """ @@ -306,4 +311,4 @@ if __name__ == "__main__": url = "http://pyload.org" c = HTTPRequest() print c.load(url) - + -- cgit v1.2.3 From 253ec9382068a2cc255f6a1e93005ee3da7965a2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 15 Nov 2014 17:21:10 +0100 Subject: [Plugin] Fix typo (thx rlindner81) --- module/plugins/Plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 1be74e896..55d93e357 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -326,7 +326,7 @@ class Plugin(Base): status = pyfile.status pyfile.setStatus("waiting") - self.logInfo(_("Wait: %d seconds") % pyfile.waitUntil - time(), + self.logInfo(_("Wait: %d seconds") % (pyfile.waitUntil - time()), _("Reconnect: %s") % self.wantReconnect) if self.account: -- cgit v1.2.3 From 7d8d0991e4d9848325692f8bbb81df00afe4e065 Mon Sep 17 00:00:00 2001 From: Thierry Merle Date: Sat, 15 Nov 2014 07:14:06 +0100 Subject: [SimpleHoster][OneFichierCom] Fix issue #836 ('status': 3) --- module/plugins/hoster/OneFichierCom.py | 4 ++-- module/plugins/internal/SimpleHoster.py | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 820a4609f..7847a11e9 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" - __version__ = "0.72" + __version__ = "0.73" __pattern__ = r'https?://(?:www\.)?(?:(?P\w+)\.)?(?P1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P\w+))?' @@ -28,7 +28,7 @@ class OneFichierCom(SimpleHoster): OFFLINE_PATTERN = r'File not found !\s*<' - COOKIES = [(".1fichier.com", "LG", "en")] + COOKIES = [("1fichier.com", "LG", "en")] WAIT_PATTERN = r'>You must wait (\d+)' diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 2562f0af3..18df2de92 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -170,10 +170,9 @@ def create_getInfo(plugin): def getInfo(urls): for url in urls: if hasattr(plugin, "COOKIES") and isinstance(plugin.COOKIES, list): - cj = CookieJar(plugin.__name__) - set_cookies(cj, plugin.COOKIES) + set_cookies(plugin.req.cj, plugin.COOKIES) else: - cj = None + plugin.req.cj = None if hasattr(plugin, "URL_REPLACEMENTS"): url = replace_patterns(url, plugin.URL_REPLACEMENTS) @@ -182,11 +181,11 @@ def create_getInfo(plugin): url = replace_patterns(url, plugin.FILE_URL_REPLACEMENTS) if hasattr(plugin, "TEXT_ENCODING"): - html = getURL(url, cookies=bool(cj), decode=not plugin.TEXT_ENCODING) + html = plugin.load(url, decode=not plugin.TEXT_ENCODING, cookies=bool(plugin.COOKIES)) if isinstance(plugin.TEXT_ENCODING, basestring): html = unicode(html, plugin.TEXT_ENCODING) else: - html = getURL(url, cookies=bool(cj), decode=True) + html = plugin.load(url, decode=True, cookies=bool(plugin.COOKIES)) yield parseFileInfo(plugin, url, html) @@ -200,7 +199,7 @@ def timestamp(): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "0.54" + __version__ = "0.55" __pattern__ = r'^unmatchable$' -- cgit v1.2.3 From 63f7688d9f00a1446490406d8e62a07e014da0f0 Mon Sep 17 00:00:00 2001 From: Thierry Merle Date: Sun, 16 Nov 2014 00:36:50 +0100 Subject: [UptoboxCom] Fix ERROR_PATTERN --- module/plugins/hoster/UptoboxCom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/hoster/UptoboxCom.py b/module/plugins/hoster/UptoboxCom.py index eeddb96b6..3c3fa45b0 100644 --- a/module/plugins/hoster/UptoboxCom.py +++ b/module/plugins/hoster/UptoboxCom.py @@ -6,7 +6,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class UptoboxCom(XFSHoster): __name__ = "UptoboxCom" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" __pattern__ = r'https?://(?:www\.)?uptobox\.com/\w{12}' @@ -22,6 +22,8 @@ class UptoboxCom(XFSHoster): LINK_PATTERN = r'"(https?://\w+\.uptobox\.com/d/.*?)"' + ERROR_PATTERN = r'>(You have to wait.+till next download.)<' #@TODO: Check XFSHoster ERROR_PATTERN + def setup(self): self.multiDL = True -- cgit v1.2.3 From 17f00c79d9be1d087cee8da32f0cb8515004c321 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 20 Nov 2014 22:07:41 +0100 Subject: [LinkCryptWs] Fix (thx NETHeader) --- module/plugins/crypter/LinkCryptWs.py | 65 ++++++++++++++--------------------- 1 file changed, 25 insertions(+), 40 deletions(-) (limited to 'module') diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py index b90e18490..578595228 100644 --- a/module/plugins/crypter/LinkCryptWs.py +++ b/module/plugins/crypter/LinkCryptWs.py @@ -15,7 +15,7 @@ from module.utils import html_unescape class LinkCryptWs(Crypter): __name__ = "LinkCryptWs" __type__ = "crypter" - __version__ = "0.05" + __version__ = "0.06" __pattern__ = r'http://(?:www\.)?linkcrypt\.ws/(dir|container)/(?P\w+)' @@ -25,25 +25,21 @@ class LinkCryptWs(Crypter): ("glukgluk", None)] - JK_KEY = "jk" CRYPTED_KEY = "crypted" + JK_KEY = "jk" def setup(self): - self.html = None - self.fileid = None self.captcha = False - self.package = None - - self.preferred_sources = ['cnl', 'web', 'dlc', 'rsdf', 'ccf', ] #['cnl', 'rsdf', 'ccf', 'dlc', 'web'] + self.links = [] + self.sources = ['cnl', 'web', 'dlc', 'rsdf', 'ccf'] def prepare(self): # Init - self.package = pyfile.package() self.fileid = re.match(self.__pattern__, pyfile.url).group('ID') - self.req.cj.setCookie(".linkcrypt.ws", "language", "en") + self.req.cj.setCookie("linkcrypt.ws", "language", "en") # Request package self.req.http.c.setopt(pycurl.USERAGENT, "Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko") #: better chance to not get those key-captchas @@ -51,12 +47,9 @@ class LinkCryptWs(Crypter): def decrypt(self, pyfile): - #check if we have js if not self.js: self.fail(_("Missing JS Engine")) - package_found = None - self.prepare() if not self.isOnline(): @@ -85,23 +78,15 @@ class LinkCryptWs(Crypter): self.get_container_html() # Extract package links - package_links = [] + for type in self.sources: + links = self.handleLinkSource(type) - for type_ in self.preferred_sources: - links = self.handleLinkSource(type_) if links: - if isinstance(links, list): - package_links.extend(links) - else: - package_found = True + self.links.extend(links) break - # Pack - if package_links: - self.packages = [(package_name, package_links, folder_name)] - - elif package_found: - self.core.api.deletePackages([self.package.id]) + if self.links: + self.packages = [(package_name, self.links, folder_name)] def isOnline(self): @@ -187,18 +172,18 @@ class LinkCryptWs(Crypter): self.correctCaptcha() - def handleLinkSource(self, type_): - if type_ is 'cnl': + def handleLinkSource(self, type): + if type == 'cnl': return self.handleCNL2() - elif type_ is 'web': + elif type == 'web': return self.handleWebLinks() - elif type_ in ('rsdf', 'ccf', 'dlc'): - return self.handleContainer(type_) + elif type in ('rsdf', 'ccf', 'dlc'): + return self.handleContainer(type) else: - self.error(_("Unknown source type: %s") % type_) + self.fail(_("Unknown source type: %s") % type) #@TODO: Replace with self.error in 0.4.10 def handleWebLinks(self): @@ -247,17 +232,17 @@ class LinkCryptWs(Crypter): return self.js.eval(line.replace('{}))',"{}).replace('document.open();document.write','').replace(';document.close();',''))")) - def handleContainer(self, type_): + def handleContainer(self, type): package_links = [] - type_ = type_.lower() + type = type.lower() - self.logDebug('Search for %s Container links' % type_.upper()) + self.logDebug('Search for %s Container links' % type.upper()) - if not type_.isalnum(): # check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric) - self.error(_("unknown container type: %s") % type_) + if not type.isalnum(): # check to prevent broken re-pattern (cnl2,rsdf,ccf,dlc,web are all alpha-numeric) + self.fail(_("Unknown container type: %s") % type) #@TODO: Replace with self.error in 0.4.10 for line in self.container_html: - if(type_ in line): + if type in line: jseval = self.handle_javascript(line) clink = re.search(r'href=["\']([^"\']*?)["\']',jseval,re.I) @@ -267,8 +252,8 @@ class LinkCryptWs(Crypter): self.logDebug("clink avaible") package_name, folder_name = self.getPackageInfo() - self.logDebug("Added package with name %s.%s and container link %s" %( package_name, type_, clink.group(1))) - self.core.api.uploadContainer( "%s.%s" %(package_name, type_), self.load(clink.group(1))) + self.logDebug("Added package with name %s.%s and container link %s" %( package_name, type, clink.group(1))) + self.core.api.uploadContainer( "%s.%s" %(package_name, type), self.load(clink.group(1))) return "Found it" return package_links @@ -281,7 +266,7 @@ class LinkCryptWs(Crypter): cnl_line = None for line in self.container_html: - if("cnl" in line): + if "cnl" in line: cnl_line = line break -- cgit v1.2.3 From c370ee8ed94c016d3e4e30b1917bc34e9510be0b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 20 Nov 2014 23:00:45 +0100 Subject: [XFSHoster] Fix StreamcloudEu (thx seoester) --- module/plugins/internal/XFSHoster.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index f54bb5e45..43f6cab83 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -16,7 +16,7 @@ from module.utils import html_unescape class XFSHoster(SimpleHoster): __name__ = "XFSHoster" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" __pattern__ = r'^unmatchable$' @@ -41,7 +41,7 @@ class XFSHoster(SimpleHoster): OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' - WAIT_PATTERN = r'.*?>(\d+)' + WAIT_PATTERN = r'.*?>(\d+)|id="countdown" value=".*?(\d+).*?"' OVR_LINK_PATTERN = r'

Download Link

\s*]*>([^<]+)' LINK_PATTERN = None #: final download url pattern @@ -122,8 +122,6 @@ class XFSHoster(SimpleHoster): data = self.getPostParameters() - # sleep(10) - self.req.http.c.setopt(FOLLOWLOCATION, 0) self.html = self.load(self.pyfile.url, post=data, ref=True, decode=True) @@ -266,7 +264,7 @@ class XFSHoster(SimpleHoster): self.logDebug(inputs) - if 'op' in inputs and inputs['op'] in ("download2", "download3"): + if 'op' in inputs and inputs['op'] in ("download1", "download2", "download3"): if "password" in inputs: if self.passwords: inputs['password'] = self.passwords.pop(0) -- cgit v1.2.3 From 6a608c9587b4baeb0f605622e4916abdd14391d2 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Thu, 20 Nov 2014 23:55:41 +0100 Subject: New crypter FilecryptCc --- module/plugins/crypter/FilecryptCc.py | 165 ++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 module/plugins/crypter/FilecryptCc.py (limited to 'module') diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py new file mode 100644 index 000000000..81efa9e5d --- /dev/null +++ b/module/plugins/crypter/FilecryptCc.py @@ -0,0 +1,165 @@ +# -*- coding: utf-8 -*- + +import base64 +import binascii +import re + +from Crypto.Cipher import AES + +from module.plugins.Crypter import Crypter + + +class FilecryptCc(Crypter): + __name__ = "FilecryptCc" + __type__ = "crypter" + __version__ = "0.03" + + __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/.+' + + __description__ = """Filecrypt.cc decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("zapp-brannigan", "")] + + + DLC_LINK_PATTERN = r'