From 3c23d616b55f95e5f383d18c24f2ca875312ed20 Mon Sep 17 00:00:00 2001 From: Pavion Date: Wed, 5 Aug 2015 20:04:06 +0200 Subject: HotFolder.py fix for not being periodical anymore --- module/plugins/hooks/HotFolder.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins') diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index 84db4db17..d1820b224 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -29,6 +29,7 @@ class HotFolder(Addon): def init(self): self.interval = 30 + self.init_periodical() def periodical(self): -- cgit v1.2.3 From d0edd32552a41ad95bfd13dffde2f9017daedc57 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Thu, 6 Aug 2015 01:32:24 +0300 Subject: fix ExternalScripts not working --- module/plugins/hooks/ExternalScripts.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index b7495136a..d5720f68d 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -3,6 +3,7 @@ import os import subprocess +from module.plugins.internal.Plugin import encode from module.plugins.internal.Addon import Addon, Expose from module.utils import fs_encode, save_join as fs_join @@ -10,7 +11,7 @@ from module.utils import fs_encode, save_join as fs_join class ExternalScripts(Addon): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.46" + __version__ = "0.47" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -66,7 +67,8 @@ class ExternalScripts(Addon): self.log_debug(e) return - for file in os.listdir(path): + for filename in os.listdir(path): + file = fs_join(path, filename) if not os.path.isfile(file): continue @@ -83,7 +85,7 @@ class ExternalScripts(Addon): def call(self, script, args=[], lock=False): try: script = os.path.abspath(script) - args = [script] + map(encode, args) + args = [script] + map(lambda arg: encode(arg) if isinstance(arg, basestring) else encode(str(arg)), args) self.log_info(_("EXECUTE [%s] %s") % (os.path.dirname(script), args)) p = subprocess.Popen(args, bufsize=-1) #@NOTE: output goes to pyload -- cgit v1.2.3 From 31fa33b537d361a9ef6133bd65fe2f8e2047d530 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Thu, 6 Aug 2015 10:50:49 +0300 Subject: [ExternalScripts] add registered script information --- module/plugins/hooks/ExternalScripts.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins') diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index d5720f68d..9ad2ac1fa 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -79,6 +79,7 @@ class ExternalScripts(Addon): self.log_warning(_("Script not executable: [%s] %s") % (name, file)) self.scripts[name].append(file) + self.log_info(_("Registered script: [%s] %s") % (name, file)) @Expose -- cgit v1.2.3 From 97f5bc1ef18ba386d7a89246ffee0af256e32a97 Mon Sep 17 00:00:00 2001 From: lazlev Date: Sat, 8 Aug 2015 03:04:25 +0200 Subject: Fix #1691 --- module/plugins/hooks/LinkdecrypterComHook.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins') diff --git a/module/plugins/hooks/LinkdecrypterComHook.py b/module/plugins/hooks/LinkdecrypterComHook.py index 6930afdb5..bf437fb6d 100644 --- a/module/plugins/hooks/LinkdecrypterComHook.py +++ b/module/plugins/hooks/LinkdecrypterComHook.py @@ -21,6 +21,7 @@ class LinkdecrypterComHook(MultiHook): __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + COOKIES = False def get_hosters(self): list = re.search(r'>Supported\(\d+\): (.[\w.\-, ]+)', -- cgit v1.2.3 From 4cdc03879a8ac9b304cd4e59498ff6646fecefcb Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Sat, 8 Aug 2015 21:41:32 +0300 Subject: Update SimpleHoster.py --- module/plugins/internal/SimpleHoster.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 9c310ca27..544e71d1e 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -23,7 +23,7 @@ statusMap = dict((v, k) for k, v in _statusMap.items()) class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.80" + __version__ = "1.81" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -209,12 +209,11 @@ class SimpleHoster(Hoster): self.direct_dl = False self.leech_dl = False - if not self.get_config('use_premium', True): + if not self.get_config('use_premium', True) and self.premium: self.restart(nopremium=True) if self.LOGIN_PREMIUM and not self.premium: self.fail(_("Required premium account not found")) - self.LOGIN_ACCOUNT = True if self.LOGIN_ACCOUNT and not self.account: self.fail(_("Required account not found")) -- cgit v1.2.3 From 28e66d852a66c4db4df7142f641900a0fe996c67 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 9 Aug 2015 03:45:36 +0200 Subject: Fix missing import statement --- module/plugins/internal/Hoster.py | 3 ++- module/plugins/internal/SimpleHoster.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py index a0cdb1e2e..b397a92a6 100644 --- a/module/plugins/internal/Hoster.py +++ b/module/plugins/internal/Hoster.py @@ -3,6 +3,7 @@ from __future__ import with_statement import inspect +import mimetypes import os import random import time @@ -43,7 +44,7 @@ def create_getInfo(klass): class Hoster(Plugin): __name__ = "Hoster" __type__ = "hoster" - __version__ = "0.19" + __version__ = "0.20" __status__ = "testing" __pattern__ = r'^unmatchable$' diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 9c310ca27..d50cbdf9b 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -2,7 +2,6 @@ from __future__ import with_statement -import mimetypes import os import re import time -- cgit v1.2.3 From 60621084b2df088a5c1ac89a4380db081ee72191 Mon Sep 17 00:00:00 2001 From: Jochen Oberreiter Date: Tue, 11 Aug 2015 11:57:14 +0200 Subject: Fix error introduced by function rename Replace all computeChecksum with compute_checksum. Error was introduced by the recent function name changes without refactoring the source correctly. --- module/plugins/hooks/Checksum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 6ecbfcda2..80d93dc39 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -131,7 +131,7 @@ class Checksum(Addon): for key in self.algorithms: if key in data: - checksum = computeChecksum(local_file, key.replace("-", "").lower()) + checksum = compute_checksum(local_file, key.replace("-", "").lower()) if checksum: if checksum is data[key].lower(): self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % @@ -186,7 +186,7 @@ class Checksum(Addon): local_file = fs_encode(fs_join(download_folder, data['NAME'])) algorithm = self.methods.get(file_type, file_type) - checksum = computeChecksum(local_file, algorithm) + checksum = compute_checksum(local_file, algorithm) if checksum is data['HASH']: self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % (data['NAME'], algorithm, checksum)) -- cgit v1.2.3 From f67e83d159df8cfcd745295517cda239563f65c7 Mon Sep 17 00:00:00 2001 From: Jochen Oberreiter Date: Tue, 11 Aug 2015 14:16:55 +0200 Subject: Change comparison from identity to equality Using '==' instead of 'is' for the comparison. --- module/plugins/hooks/Checksum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 80d93dc39..d47c561eb 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -38,7 +38,7 @@ def compute_checksum(local_file, algorithm): class Checksum(Addon): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __status__ = "testing" __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), @@ -133,7 +133,7 @@ class Checksum(Addon): if key in data: checksum = compute_checksum(local_file, key.replace("-", "").lower()) if checksum: - if checksum is data[key].lower(): + if checksum == data[key].lower(): self.log_info(_('File integrity of "%s" verified by %s checksum (%s)') % (pyfile.name, key.upper(), checksum)) break -- cgit v1.2.3 From 4532ccc304ba666d79b1cc783a11eeb6f8e7cedc Mon Sep 17 00:00:00 2001 From: Jochen Oberreiter Date: Tue, 11 Aug 2015 14:33:12 +0200 Subject: Minor change to log output Using `data[key].lower()` instead of `data[key]` to synchronize it with the comparison itself. --- module/plugins/hooks/Checksum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index d47c561eb..da4d35df1 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -139,7 +139,7 @@ class Checksum(Addon): break else: self.log_warning(_("%s checksum for file %s does not match (%s != %s)") % - (key.upper(), pyfile.name, checksum, data[key])) + (key.upper(), pyfile.name, checksum, data[key].lower())) self.check_failed(pyfile, local_file, "Checksums do not match") else: self.log_warning(_("Unsupported hashing algorithm"), key.upper()) -- cgit v1.2.3 From ba1ba7f123e517fef53d03c91308069f9d40ad2c Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Wed, 12 Aug 2015 01:04:03 +0300 Subject: [YoutubeCom] fix #1744 --- module/plugins/hoster/YoutubeCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 865eeef2e..86cca7cf1 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -33,7 +33,7 @@ def which(program): class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" - __version__ = "0.44" + __version__ = "0.45" __status__ = "testing" __pattern__ = r'https?://(?:[^/]*\.)?(youtube\.com|youtu\.be)/watch\?(?:.*&)?v=.+' @@ -54,7 +54,7 @@ class YoutubeCom(Hoster): URL_REPLACEMENTS = [(r'youtu\.be/', 'youtube.com/')] #: Invalid characters that must be removed from the file name - invalidChars = u'\u2605:?><"|\\' + invalid_chars = u'\u2605:?><"|\\' #: name, width, height, quality ranking, 3D formats = {5 : (".flv" , 400 , 240 , 1 , False), -- cgit v1.2.3 From 3d9db13b7ea612f1d78d36f1ce7d6236f9821de8 Mon Sep 17 00:00:00 2001 From: Andrew Ching Date: Wed, 12 Aug 2015 10:55:20 +0800 Subject: [accounts/RapidgatorNet] Fixes #1698 --- module/plugins/accounts/RapidgatorNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index 5ce51a1ec..acd7a547b 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads class RapidgatorNet(Account): __name__ = "RapidgatorNet" __type__ = "account" - __version__ = "0.11" + __version__ = "0.12" __status__ = "testing" __description__ = """Rapidgator.net account plugin""" @@ -30,7 +30,7 @@ class RapidgatorNet(Account): sid = self.get_data(user).get('sid', None) assert sid - html = self.load(urlparse.urljoin(self.API_URL, "info"), + html = self.load(urlparse.urljoin(self.API_URL, "user/info"), get={'sid': sid}) self.log_debug("API:USERINFO", html) @@ -58,7 +58,7 @@ class RapidgatorNet(Account): def login(self, user, password, data, req): try: - html = self.load(urlparse.urljoin(self.API_URL, "login"), + html = self.load(urlparse.urljoin(self.API_URL, "user/login"), post={'username': user, 'password': password}) -- cgit v1.2.3 From 8d34b26b3c9d17f7657af37f975f6e60018d30d2 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Wed, 12 Aug 2015 17:43:53 +0300 Subject: [UploadedTo] add PREMIUM_ONLY_PATTERN --- module/plugins/hoster/UploadedTo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index c90f2bb0f..890a1698a 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class UploadedTo(SimpleHoster): __name__ = "UploadedTo" __type__ = "hoster" - __version__ = "0.96" + __version__ = "0.97" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=|/)(?P\w+)' @@ -31,6 +31,7 @@ class UploadedTo(SimpleHoster): OFFLINE_PATTERN = r'>Page not found' TEMP_OFFLINE_PATTERN = r'uploaded\.net - Maintenance' + PREMIUM_ONLY_PATTERN = r'This file exceeds the max\. filesize which can be downloaded by free users\.' LINK_FREE_PATTERN = r"url:\s*'(.+?)'" LINK_PREMIUM_PATTERN = r'<div class="tfree".*\s*<form method="post" action="(.+?)"' @@ -77,6 +78,7 @@ class UploadedTo(SimpleHoster): self.html = self.load("http://uploaded.net/io/ticket/captcha/%s" % self.info['pattern']['ID'], post={'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) + self.check_errors() super(UploadedTo, self).handle_free(pyfile) self.check_errors() -- cgit v1.2.3 From e74113e89924e48ebcd726bd0499b668431c2c84 Mon Sep 17 00:00:00 2001 From: synweap15 <shamdog+github@gmail.com> Date: Thu, 13 Aug 2015 14:42:45 +0200 Subject: fix RapideoPl account parse_info method signature --- module/plugins/accounts/RapideoPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 42d084bdb..beb49a43a 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -32,7 +32,7 @@ class RapideoPl(Account): _pwd = None - def parse_info(self, name, req): + def parse_info(self, user, password, data, req): self._req = req try: result = json_loads(self.run_auth_query()) -- cgit v1.2.3 From b68358f4125a6a2b14b35ef3339e68fb4db4171e Mon Sep 17 00:00:00 2001 From: synweap15 <shamdog+github@gmail.com> Date: Thu, 13 Aug 2015 14:43:33 +0200 Subject: RapideoPl account version bump --- module/plugins/accounts/RapideoPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index beb49a43a..e9a483927 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -11,7 +11,7 @@ from module.plugins.internal.Account import Account class RapideoPl(Account): __name__ = "RapideoPl" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __status__ = "testing" __description__ = "Rapideo.pl account plugin" -- cgit v1.2.3 From 20d0218b66177399ba923572949862bd6dff8498 Mon Sep 17 00:00:00 2001 From: synweap15 <shamdog+github@gmail.com> Date: Thu, 13 Aug 2015 14:43:53 +0200 Subject: fix NoPremiumPl account parse_info method signature --- module/plugins/accounts/NoPremiumPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index e9dad7647..3a3f3d1ce 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -32,7 +32,7 @@ class NoPremiumPl(Account): _pwd = None - def parse_info(self, name, req): + def parse_info(self, user, password, data, req): self._req = req try: result = json_loads(self.run_auth_query()) -- cgit v1.2.3 From 96dd390398b998c807bf08f94f7334460c8624cd Mon Sep 17 00:00:00 2001 From: synweap15 <shamdog+github@gmail.com> Date: Thu, 13 Aug 2015 14:44:18 +0200 Subject: NoPremiumPl account version bump --- module/plugins/accounts/NoPremiumPl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/NoPremiumPl.py b/module/plugins/accounts/NoPremiumPl.py index 3a3f3d1ce..97e58f5f0 100644 --- a/module/plugins/accounts/NoPremiumPl.py +++ b/module/plugins/accounts/NoPremiumPl.py @@ -11,7 +11,7 @@ from module.plugins.internal.Account import Account class NoPremiumPl(Account): __name__ = "NoPremiumPl" __type__ = "account" - __version__ = "0.03" + __version__ = "0.04" __status__ = "testing" __description__ = "NoPremium.pl account plugin" -- cgit v1.2.3 From 7943a306eb794e826d5ffeb54218f350fbc8e34f Mon Sep 17 00:00:00 2001 From: Jochen Oberreiter <joberreiter@users.noreply.github.com> Date: Fri, 14 Aug 2015 08:14:30 +0200 Subject: Check if search has returned a result Fixes #1753 --- module/plugins/crypter/ShareLinksBiz.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index 6fbe59b38..da91cc065 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -68,8 +68,12 @@ class ShareLinksBiz(Crypter): url = pyfile.url if 's2l.biz' in url: url = self.load(url, just_header=True)['location'] - self.base_url = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1) - self.file_id = re.match(self.__pattern__, url).group('ID') + if re.match(self.__pattern__, url): + self.base_url = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1) + self.file_id = re.match(self.__pattern__, url).group('ID') + else: + self.log_debug("Could not initialize, URL [%s] does not match pattern [%s]" % (url, self.__pattern__)) + self.fail("Unsupported download link") self.package = pyfile.package() -- cgit v1.2.3 From f705acb7621a6a4c9f8f11bf6a30d54b26de6918 Mon Sep 17 00:00:00 2001 From: Jochen Oberreiter <joberreiter@users.noreply.github.com> Date: Fri, 14 Aug 2015 08:25:39 +0200 Subject: Update ShareLinksBiz.py Bump version --- module/plugins/crypter/ShareLinksBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index da91cc065..df6068908 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -10,7 +10,7 @@ from module.plugins.internal.Crypter import Crypter class ShareLinksBiz(Crypter): __name__ = "ShareLinksBiz" __type__ = "crypter" - __version__ = "1.16" + __version__ = "1.17" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P<ID>_?\w+)' -- cgit v1.2.3 From dbf6a1394baff20d25e29ac070a70f1eda2af487 Mon Sep 17 00:00:00 2001 From: Jochen Oberreiter <joberreiter@users.noreply.github.com> Date: Fri, 14 Aug 2015 08:27:08 +0200 Subject: Update FilecryptCc.py Test if regexp search has returned an object before using it. Should fix #1753. --- module/plugins/crypter/FilecryptCc.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index 9f4ad69aa..ac78e9aa8 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -16,7 +16,7 @@ from module.plugins.captcha.ReCaptcha import ReCaptcha class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" - __version__ = "0.18" + __version__ = "0.19" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+' @@ -140,8 +140,9 @@ class FilecryptCc(Crypter): for link in weblinks: res = self.load("%s/Link/%s.html" % (self.base_url, link)) link2 = re.search('<iframe noresize src="(.*)"></iframe>', res) - res2 = self.load(link2.group(1), just_header=True) - self.links.append(res2['location']) + if link2: + res2 = self.load(link2.group(1), just_header=True) + self.links.append(res2['location']) except Exception, e: self.log_debug("Error decrypting weblinks: %s" % e) -- cgit v1.2.3 From 50887266a48f11559591790fb0ab4e743d3bced5 Mon Sep 17 00:00:00 2001 From: estaban <babedoudi@yahoo.fr> Date: Fri, 14 Aug 2015 18:50:45 +0200 Subject: File name not found on OneFichier Updated regexp, website now displays "File Name" instead of "FileName". --- module/plugins/hoster/OneFichierCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index c564dc677..f8b8e2f2a 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -28,7 +28,7 @@ class OneFichierCom(SimpleHoster): COOKIES = [("1fichier.com", "LG", "en")] - NAME_PATTERN = r'>FileName :</td>\s*<td.*>(?P<N>.+?)<' + NAME_PATTERN = r'>File\s*Name :</td>\s*<td.*>(?P<N>.+?)<' SIZE_PATTERN = r'>Size :</td>\s*<td.*>(?P<S>[\d.,]+) (?P<U>[\w^_]+)' OFFLINE_PATTERN = r'File not found !\s*<' -- cgit v1.2.3 From d15432dda3a06c08ad36901a72c6301f958b72e0 Mon Sep 17 00:00:00 2001 From: estaban <babedoudi@yahoo.fr> Date: Fri, 14 Aug 2015 18:52:59 +0200 Subject: Update OneFichierCom.py Increment version --- module/plugins/hoster/OneFichierCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index f8b8e2f2a..04a00d572 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.86" + __version__ = "0.87" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:(?P<ID1>\w+)\.)?(?P<HOST>1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P<ID2>\w+))?' -- cgit v1.2.3 From 67864826ef26c831c9fa216b154917d48b045f72 Mon Sep 17 00:00:00 2001 From: Jochen Oberreiter <joberreiter@users.noreply.github.com> Date: Sun, 16 Aug 2015 21:42:08 +0200 Subject: Update ShareLinksBiz.py Correct regex search for getting captcha url data --- module/plugins/crypter/ShareLinksBiz.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py index df6068908..712b4fff2 100644 --- a/module/plugins/crypter/ShareLinksBiz.py +++ b/module/plugins/crypter/ShareLinksBiz.py @@ -118,7 +118,10 @@ class ShareLinksBiz(Crypter): self.log_debug("Captcha map with [%d] positions" % len(captchaMap.keys())) #: Request user for captcha coords - m = re.search(r'<img src="/captcha.gif\?d=(.*?)&PHPSESSID=(.*?)&legend=1"', self.html) + m = re.search(r'<img src="/captcha.gif\?d=(.+?)&PHPSESSID=(.+?)&legend=1"', self.html) + if not m: + self.log_debug("Captcha url data not found, maybe plugin out of date?") + self.fail("Captcha url data not found") captchaUrl = self.base_url + '/captcha.gif?d=%s&PHPSESSID=%s' % (m.group(1), m.group(2)) self.log_debug("Waiting user for correct position") coords = self.captcha.decrypt(captchaUrl, input_type="gif", output_type='positional') -- cgit v1.2.3 From ad56077057976cd9d2048c732d174843187b3fc4 Mon Sep 17 00:00:00 2001 From: salimimani <salim.imani@outlook.com> Date: Mon, 17 Aug 2015 16:35:49 +0200 Subject: Update MediafireCom.py --- module/plugins/hoster/MediafireCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 3ba191160..5352e0261 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -11,7 +11,7 @@ class MediafireCom(SimpleHoster): __version__ = "0.90" __status__ = "testing" - __pattern__ = r'https?://(?:www\.)?mediafire\.com/(file/|view/\??|download(\.php\?|/)|\?)(?P<ID>\w{15})' + __pattern__ = r'https?://(?:www\.)?mediafire\.com/(file/|view/\??|download(\.php\?|/)|\?)(?P<ID>\w*)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """Mediafire.com hoster plugin""" -- cgit v1.2.3 From d246fcba3455d5351bb4b10b92269639c4d9cb58 Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Wed, 19 Aug 2015 00:59:47 +0300 Subject: Update OneFichierCom.py --- module/plugins/hoster/OneFichierCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 04a00d572..cba67b26c 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.87" + __version__ = "0.88" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:(?P<ID1>\w+)\.)?(?P<HOST>1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P<ID2>\w+))?' -- cgit v1.2.3 From 6bf69f001174e2ebdbdf01c7d733d17829f289fd Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Wed, 19 Aug 2015 01:28:34 +0300 Subject: [UpdateManager] show plugin type one error --- module/plugins/hooks/UpdateManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 117da0633..fb9e28b5d 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -17,7 +17,7 @@ from module.utils import fs_encode, save_join as fs_join class UpdateManager(Addon): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "0.55" + __version__ = "0.56" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), @@ -268,7 +268,7 @@ class UpdateManager(Addon): raise Exception(_("Version mismatch")) except Exception, e: - self.log_error(_("Error updating plugin: %s") % filename, e) + self.log_error(_("Error updating plugin: [%s] %s") % (type, name), e) if self.pyload.debug: traceback.print_exc() -- cgit v1.2.3 From d1aa2d4d2eb4ed1b01943645401d9818eb46b712 Mon Sep 17 00:00:00 2001 From: Gregory G <greg.djg13@gmail.com> Date: Wed, 19 Aug 2015 00:42:11 +0200 Subject: OneFichierCom premium detection fixed --- module/plugins/accounts/OneFichierCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/OneFichierCom.py b/module/plugins/accounts/OneFichierCom.py index 3a0131a3f..e2e84feef 100644 --- a/module/plugins/accounts/OneFichierCom.py +++ b/module/plugins/accounts/OneFichierCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.Account import Account class OneFichierCom(Account): __name__ = "OneFichierCom" __type__ = "account" - __version__ = "0.14" + __version__ = "0.15" __status__ = "testing" __description__ = """1fichier.com account plugin""" @@ -19,7 +19,7 @@ class OneFichierCom(Account): ("Walter Purcaro", "vuolter@gmail.com")] - VALID_UNTIL_PATTERN = r'Your Premium Status will end the (\d+/\d+/\d+)' + VALID_UNTIL_PATTERN = r'Your subscription will end the (\d+-\d+-\d+)' def parse_info(self, user, password, data, req): @@ -35,7 +35,7 @@ class OneFichierCom(Account): self.log_debug("Expire date: " + expiredate) try: - validuntil = time.mktime(time.strptime(expiredate, "%d/%m/%Y")) + validuntil = time.mktime(time.strptime(expiredate, "%Y-%m-%d")) except Exception, e: self.log_error(e) else: -- cgit v1.2.3 From f4d40b4226872cfe5cc7de2c83a88b4bbe2ad408 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@users.noreply.github.com> Date: Wed, 19 Aug 2015 02:37:10 +0200 Subject: Temp fix https://github.com/pyload/pyload/pull/1708 --- module/plugins/internal/SimpleHoster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index d50cbdf9b..69f88081a 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -22,7 +22,7 @@ statusMap = dict((v, k) for k, v in _statusMap.items()) class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.80" + __version__ = "1.81" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -314,7 +314,7 @@ class SimpleHoster(Hoster): elif self.check_download({'Empty file': re.compile(r'\A((.|)(\2|\s)*)\Z')}, file_size=self.info['size'] if 'size' in self.info else 0, size_tolerance=10485760, - delete=True): + delete=False): #@TODO: Make `delete` settable in 0.4.10 self.error(_("Empty file")) else: -- cgit v1.2.3 From 52dafac35c3cbfd110746b981afd80da1632a373 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@users.noreply.github.com> Date: Wed, 19 Aug 2015 02:38:11 +0200 Subject: Spare plugin updates --- module/plugins/accounts/RapidgatorNet.py | 8 ++++---- module/plugins/crypter/DevhostStFolder.py | 2 +- module/plugins/crypter/MultiUpOrg.py | 2 +- module/plugins/hooks/ExternalScripts.py | 2 +- module/plugins/hooks/HotFolder.py | 2 +- module/plugins/hooks/LinkdecrypterComHook.py | 1 - module/plugins/hoster/CrockoCom.py | 2 +- module/plugins/hoster/FileSharkPl.py | 2 +- module/plugins/hoster/FileboomMe.py | 2 +- module/plugins/hoster/MediafireCom.py | 4 ++-- module/plugins/hoster/NarodRu.py | 2 +- module/plugins/hoster/UloziskoSk.py | 2 +- module/plugins/hoster/UnibytesCom.py | 2 +- module/plugins/hoster/UploadedTo.py | 2 +- module/plugins/hoster/UploadheroCom.py | 4 ++-- module/plugins/hoster/YibaishiwuCom.py | 2 +- module/plugins/internal/XFSAccount.py | 4 +++- 17 files changed, 23 insertions(+), 22 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index acd7a547b..2fc266722 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -9,7 +9,7 @@ from module.common.json_layer import json_loads class RapidgatorNet(Account): __name__ = "RapidgatorNet" __type__ = "account" - __version__ = "0.12" + __version__ = "0.13" __status__ = "testing" __description__ = """Rapidgator.net account plugin""" @@ -17,7 +17,7 @@ class RapidgatorNet(Account): __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - API_URL = "http://rapidgator.net/api/user" + API_URL = "http://rapidgator.net/api/user/" def parse_info(self, user, password, data, req): @@ -30,7 +30,7 @@ class RapidgatorNet(Account): sid = self.get_data(user).get('sid', None) assert sid - html = self.load(urlparse.urljoin(self.API_URL, "user/info"), + html = self.load(urlparse.urljoin(self.API_URL, "info"), get={'sid': sid}) self.log_debug("API:USERINFO", html) @@ -58,7 +58,7 @@ class RapidgatorNet(Account): def login(self, user, password, data, req): try: - html = self.load(urlparse.urljoin(self.API_URL, "user/login"), + html = self.load(urlparse.urljoin(self.API_URL, "login"), post={'username': user, 'password': password}) diff --git a/module/plugins/crypter/DevhostStFolder.py b/module/plugins/crypter/DevhostStFolder.py index 8340adeb8..6c50c8480 100644 --- a/module/plugins/crypter/DevhostStFolder.py +++ b/module/plugins/crypter/DevhostStFolder.py @@ -42,7 +42,7 @@ class DevhostStFolder(SimpleCrypter): p = r'href="(.+?)">Back to \w+<' m = re.search(p, self.html) - html = self.load(urlparse.urljoin("http://d-h.st", m.group(1)), + html = self.load(urlparse.urljoin("http://d-h.st/", m.group(1)), cookies=False) p = '\?fld_id=%s.*?">(.+?)<' % self.info['pattern']['ID'] diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py index b4326b679..23e6dfa4a 100644 --- a/module/plugins/crypter/MultiUpOrg.py +++ b/module/plugins/crypter/MultiUpOrg.py @@ -34,7 +34,7 @@ class MultiUpOrg(SimpleCrypter): pattern = r'style="width:97%;text-align:left".*\n.*href="(.*)"' if m_type == "download": dl_pattern = r'href="(.*)">.*\n.*<h5>DOWNLOAD</h5>' - miror_page = urlparse.urljoin("http://www.multiup.org", re.search(dl_pattern, self.html).group(1)) + miror_page = urlparse.urljoin("http://www.multiup.org/", re.search(dl_pattern, self.html).group(1)) self.html = self.load(miror_page) return re.findall(pattern, self.html) diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 9ad2ac1fa..4ec526d35 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -79,7 +79,7 @@ class ExternalScripts(Addon): self.log_warning(_("Script not executable: [%s] %s") % (name, file)) self.scripts[name].append(file) - self.log_info(_("Registered script: [%s] %s") % (name, file)) + self.log_info(_("Registered script: [%s] %s") % (name, file)) @Expose diff --git a/module/plugins/hooks/HotFolder.py b/module/plugins/hooks/HotFolder.py index d1820b224..5a65146b9 100644 --- a/module/plugins/hooks/HotFolder.py +++ b/module/plugins/hooks/HotFolder.py @@ -14,7 +14,7 @@ from module.utils import fs_encode, save_join as fs_join class HotFolder(Addon): __name__ = "HotFolder" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __status__ = "testing" __config__ = [("folder" , "str" , "Folder to observe" , "container"), diff --git a/module/plugins/hooks/LinkdecrypterComHook.py b/module/plugins/hooks/LinkdecrypterComHook.py index bf437fb6d..6930afdb5 100644 --- a/module/plugins/hooks/LinkdecrypterComHook.py +++ b/module/plugins/hooks/LinkdecrypterComHook.py @@ -21,7 +21,6 @@ class LinkdecrypterComHook(MultiHook): __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - COOKIES = False def get_hosters(self): list = re.search(r'>Supported\(\d+\)</b>: <i>(.[\w.\-, ]+)', diff --git a/module/plugins/hoster/CrockoCom.py b/module/plugins/hoster/CrockoCom.py index 8f092ad0c..17e3ee93c 100644 --- a/module/plugins/hoster/CrockoCom.py +++ b/module/plugins/hoster/CrockoCom.py @@ -40,7 +40,7 @@ class CrockoCom(SimpleHoster): for _i in xrange(5): m = re.search(self.CAPTCHA_PATTERN, self.html) if m: - url = urlparse.urljoin("http://crocko.com", m.group(1)) + url = urlparse.urljoin("http://crocko.com/", m.group(1)) self.wait(m.group(2)) self.html = self.load(url) else: diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index 62a7a553f..978861dd6 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -78,7 +78,7 @@ class FileSharkPl(SimpleHoster): if m is None: self.error(_("Download url not found")) - link = urlparse.urljoin("http://fileshark.pl", m.group(1)) + link = urlparse.urljoin("http://fileshark.pl/", m.group(1)) self.html = self.load(link) diff --git a/module/plugins/hoster/FileboomMe.py b/module/plugins/hoster/FileboomMe.py index 2798d9eda..3c11f1d16 100644 --- a/module/plugins/hoster/FileboomMe.py +++ b/module/plugins/hoster/FileboomMe.py @@ -37,7 +37,7 @@ class FileboomMe(SimpleHoster): def handle_free(self, pyfile): - post_url = urljoin(pyfile.url, "/file/" + self.info['pattern']['ID']) + post_url = urljoin(pyfile.url, "file/" + self.info['pattern']['ID']) m = re.search(r'data-slow-id="(\w+)"', self.html) if m: diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py index 5352e0261..21e643171 100644 --- a/module/plugins/hoster/MediafireCom.py +++ b/module/plugins/hoster/MediafireCom.py @@ -8,10 +8,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class MediafireCom(SimpleHoster): __name__ = "MediafireCom" __type__ = "hoster" - __version__ = "0.90" + __version__ = "0.91" __status__ = "testing" - __pattern__ = r'https?://(?:www\.)?mediafire\.com/(file/|view/\??|download(\.php\?|/)|\?)(?P<ID>\w*)' + __pattern__ = r'https?://(?:www\.)?mediafire\.com/(file/|view/\??|download(\.php\?|/)|\?)(?P<ID>\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """Mediafire.com hoster plugin""" diff --git a/module/plugins/hoster/NarodRu.py b/module/plugins/hoster/NarodRu.py index b0d4a4960..a20c23954 100644 --- a/module/plugins/hoster/NarodRu.py +++ b/module/plugins/hoster/NarodRu.py @@ -49,7 +49,7 @@ class NarodRu(SimpleHoster): m = re.search(self.LINK_FREE_PATTERN, self.html) if m: - self.link = urlparse.urljoin("http://narod.ru", m.group(1)) + self.link = urlparse.urljoin("http://narod.ru/", m.group(1)) self.captcha.correct() break diff --git a/module/plugins/hoster/UloziskoSk.py b/module/plugins/hoster/UloziskoSk.py index 7cbcb4d40..12e88cf1c 100644 --- a/module/plugins/hoster/UloziskoSk.py +++ b/module/plugins/hoster/UloziskoSk.py @@ -58,7 +58,7 @@ class UloziskoSk(SimpleHoster): if m is None: self.error(_("CAPTCHA_PATTERN not found")) - captcha_url = urlparse.urljoin("http://www.ulozisko.sk", m.group(1)) + captcha_url = urlparse.urljoin("http://www.ulozisko.sk/", m.group(1)) captcha = self.captcha.decrypt(captcha_url, cookies=True) self.log_debug("CAPTCHA_URL:" + captcha_url + ' CAPTCHA:' + captcha) diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index ac2589f47..d4b7d6dd4 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -65,7 +65,7 @@ class UnibytesCom(SimpleHoster): self.wait(m.group(1) if m else 60, False) elif last_step in ("captcha", "last"): - post_data['captcha'] = self.captcha.decrypt(urlparse.urljoin(domain, "/captcha.jpg")) + post_data['captcha'] = self.captcha.decrypt(urlparse.urljoin(domain, "captcha.jpg")) else: self.fail(_("No valid captcha code entered")) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 890a1698a..697f1febd 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -31,7 +31,7 @@ class UploadedTo(SimpleHoster): OFFLINE_PATTERN = r'>Page not found' TEMP_OFFLINE_PATTERN = r'<title>uploaded\.net - Maintenance' - PREMIUM_ONLY_PATTERN = r'This file exceeds the max\. filesize which can be downloaded by free users\.' + PREMIUM_ONLY_PATTERN = r'This file exceeds the max\. filesize which can be downloaded by free users' LINK_FREE_PATTERN = r"url:\s*'(.+?)'" LINK_PREMIUM_PATTERN = r'<div class="tfree".*\s*<form method="post" action="(.+?)"' diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 2af0f32fc..ded0d60dd 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -44,7 +44,7 @@ class UploadheroCom(SimpleHoster): if m is None: self.error(_("Captcha not found")) - captcha = self.captcha.decrypt(urlparse.urljoin("http://uploadhero.co", m.group(1))) + captcha = self.captcha.decrypt(urlparse.urljoin("http://uploadhero.co/", m.group(1))) self.html = self.load(pyfile.url, get={'code': captcha}) @@ -58,7 +58,7 @@ class UploadheroCom(SimpleHoster): def check_errors(self): m = re.search(self.IP_BLOCKED_PATTERN, self.html) if m: - self.html = self.load(urlparse.urljoin("http://uploadhero.co", m.group(1))) + self.html = self.load(urlparse.urljoin("http://uploadhero.co/", m.group(1))) m = re.search(self.IP_WAIT_PATTERN, self.html) wait_time = (int(m.group(1)) * 60 + int(m.group(2))) if m else 5 * 60 diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index e0e90a311..0c1a028f8 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -37,7 +37,7 @@ class YibaishiwuCom(SimpleHoster): self.log_debug(('FREEUSER' if m.group(2) == "download" else 'GUEST') + ' URL', url) - res = json_loads(self.load(urlparse.urljoin("http://115.com", url), decode=False)) + res = json_loads(self.load(urlparse.urljoin("http://115.com/", url), decode=False)) if "urls" in res: mirrors = res['urls'] diff --git a/module/plugins/internal/XFSAccount.py b/module/plugins/internal/XFSAccount.py index e0f6b1ee8..5a4cc35fb 100644 --- a/module/plugins/internal/XFSAccount.py +++ b/module/plugins/internal/XFSAccount.py @@ -11,7 +11,7 @@ from module.plugins.internal.Plugin import parse_html_form, set_cookie class XFSAccount(Account): __name__ = "XFSAccount" __type__ = "account" - __version__ = "0.42" + __version__ = "0.43" __status__ = "testing" __description__ = """XFileSharing account plugin""" @@ -151,6 +151,8 @@ class XFSAccount(Account): if not self.HOSTER_URL: self.login_fail(_("Missing HOSTER_URL")) + else: + self.HOSTER_URL = self.HOSTER_URL.rstrip('/') + "/" if not self.LOGIN_URL: self.LOGIN_URL = urlparse.urljoin(self.HOSTER_URL, "login.html") -- cgit v1.2.3 From 2d051d0e898745ce862b0621fb992331e14fd8da Mon Sep 17 00:00:00 2001 From: NETHeader <NETHead@gmx.net> Date: Wed, 19 Aug 2015 07:58:22 +0200 Subject: Update SexuriaCom.py Fix to reflect the recent changes of - refactored function names - change of module.plugins.Crypter into module.plugins.internal.Crypter Additionally, some irregular passwords like '-' or 'Kein Passwort' are ignored now. --- module/plugins/crypter/SexuriaCom.py | 63 +++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 26 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/SexuriaCom.py b/module/plugins/crypter/SexuriaCom.py index 7942d5e42..a7448cd4c 100644 --- a/module/plugins/crypter/SexuriaCom.py +++ b/module/plugins/crypter/SexuriaCom.py @@ -1,25 +1,23 @@ # -*- coding: utf-8 -*- import re - from module.plugins.internal.Crypter import Crypter - class SexuriaCom(Crypter): __name__ = "SexuriaCom" __type__ = "crypter" - __version__ = "0.04" + __version__ = "0.10" __status__ = "testing" __pattern__ = r'http://(?:www\.)?sexuria\.com/(v1/)?(Pornos_Kostenlos_.+?_(\d+)\.html|dl_links_\d+_\d+\.html|id=\d+\&part=\d+\&link=\d+)' - __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), - ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] + __config__ = [("use_subfolder", "bool", "Save package to subfolder" , True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Sexuria.com decrypter plugin""" __license__ = "GPLv3" __authors__ = [("NETHead", "NETHead.AT.gmx.DOT.net")] - + #: Constants PATTERN_SUPPORTED_MAIN = r'http://(www\.)?sexuria\.com/(v1/)?Pornos_Kostenlos_.+?_(\d+)\.html' PATTERN_SUPPORTED_CRYPT = r'http://(www\.)?sexuria\.com/(v1/)?dl_links_\d+_(?P<ID>\d+)\.html' PATTERN_SUPPORTED_REDIRECT = r'http://(www\.)?sexuria\.com/out\.php\?id=(?P<ID>\d+)\&part=\d+\&link=\d+' @@ -27,15 +25,17 @@ class SexuriaCom(Crypter): PATTERN_PASSWORD = r'<strong>Passwort: </strong></div></td>.*?bgcolor="#EFEFEF">(?P<PWD>.*?)</td>' PATTERN_DL_LINK_PAGE = r'"(dl_links_\d+_\d+\.html)"' PATTERN_REDIRECT_LINKS = r'value="(http://sexuria\.com/out\.php\?id=\d+\&part=\d+\&link=\d+)" readonly' - + LIST_PWDIGNORE = ["Kein Passwort", "-"] def decrypt(self, pyfile): #: Init self.pyfile = pyfile self.package = pyfile.package() - #: Get package links + #: Decrypt and add links package_name, self.links, folder_name, package_pwd = self.decrypt_links(self.pyfile.url) + if package_pwd: + self.pyfile.package().password = package_pwd self.packages = [(package_name, self.links, folder_name)] @@ -61,35 +61,46 @@ class SexuriaCom(Crypter): elif re.match(self.PATTERN_SUPPORTED_CRYPT, url, re.I): #: Extract info from main file id = re.search(self.PATTERN_SUPPORTED_CRYPT, url, re.I).group('ID') - html = self.load("http://sexuria.com/v1/Pornos_Kostenlos_info_%s.html" % id) - - title = re.search(self.PATTERN_TITLE, html, re.I).group('TITLE').strip() - if title: - name = folder = title - self.log_debug("Package info found, name [%s] and folder [%s]" % (name, folder)) - - pwd = re.search(self.PATTERN_PASSWORD, html, re.I | re.S).group('PWD') - if pwd and pwd not in ("Kein Passwort", "-"): - password = pwd.strip() - self.log_debug("Password info [%s] found" % password) + html = self.load("http://sexuria.com/v1/Pornos_Kostenlos_info_%s.html" % id) #, decode=True + #: Webpage title / Package name + titledata = re.search(self.PATTERN_TITLE, html, re.I) + if not titledata: + self.log_warning("No title data found, has site changed?") + else: + title = titledata.group('TITLE').strip() + if title: + name = folder = title + self.log_debug("Package info found, name [%s] and folder [%s]" % (name, folder)) + #: Password + pwddata = re.search(self.PATTERN_PASSWORD, html, re.I | re.S) + if not pwddata: + self.log_warning("No password data found, has site changed?") + else: + pwd = pwddata.group('PWD').strip() + if pwd and not (pwd in self.LIST_PWDIGNORE): + password = pwd + self.log_debug("Package info found, password [%s]" % password) - #: Process link (dl_link) + #: Process links (dl_link) html = self.load(url) links = re.findall(self.PATTERN_REDIRECT_LINKS, html, re.I) - if len(links) == 0: + if not links: self.log_error(_("Broken for link: %s") % link) else: for link in links: link = link.replace("http://sexuria.com/", "http://www.sexuria.com/") finallink = self.load(link, just_header=True)['location'] - if not finallink or "sexuria.com/" in finallink: + if not finallink or ("sexuria.com/" in finallink): self.log_error(_("Broken for link: %s") % link) else: linklist.append(finallink) - #: Debug log - self.log_debug("%d supported links" % len(linklist)) - for i, link in enumerate(linklist): - self.log_debug("Supported link %d, %s" % (i + 1, link)) + #: Log result + if not linklist: + self.fail(_("Unable to extract links (maybe plugin out of date?)")) + else: + for i, link in enumerate(linklist): + self.log_debug("Supported link %d/%d: %s" % (i+1, len(linklist), link)) + #: All done, return to caller return name, linklist, folder, password -- cgit v1.2.3 From 6f474a36eabda3a018aea0baf7f37dda6ddc44ae Mon Sep 17 00:00:00 2001 From: NETHeader <NETHeader@users.noreply.github.com> Date: Wed, 19 Aug 2015 08:44:08 +0200 Subject: Update SexuriaCom.py Minor whitespace changes --- module/plugins/crypter/SexuriaCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/SexuriaCom.py b/module/plugins/crypter/SexuriaCom.py index a7448cd4c..9ec4b4117 100644 --- a/module/plugins/crypter/SexuriaCom.py +++ b/module/plugins/crypter/SexuriaCom.py @@ -10,7 +10,7 @@ class SexuriaCom(Crypter): __status__ = "testing" __pattern__ = r'http://(?:www\.)?sexuria\.com/(v1/)?(Pornos_Kostenlos_.+?_(\d+)\.html|dl_links_\d+_\d+\.html|id=\d+\&part=\d+\&link=\d+)' - __config__ = [("use_subfolder", "bool", "Save package to subfolder" , True), + __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Sexuria.com decrypter plugin""" -- cgit v1.2.3 From 499df96094d5d5b5977bdc581e0497f3e0a75279 Mon Sep 17 00:00:00 2001 From: NETHeader <NETHeader@users.noreply.github.com> Date: Wed, 19 Aug 2015 18:17:29 +0200 Subject: Update SexuriaCom.py Remove unnecessary comment --- module/plugins/crypter/SexuriaCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/SexuriaCom.py b/module/plugins/crypter/SexuriaCom.py index 9ec4b4117..24a5060b9 100644 --- a/module/plugins/crypter/SexuriaCom.py +++ b/module/plugins/crypter/SexuriaCom.py @@ -61,7 +61,7 @@ class SexuriaCom(Crypter): elif re.match(self.PATTERN_SUPPORTED_CRYPT, url, re.I): #: Extract info from main file id = re.search(self.PATTERN_SUPPORTED_CRYPT, url, re.I).group('ID') - html = self.load("http://sexuria.com/v1/Pornos_Kostenlos_info_%s.html" % id) #, decode=True + html = self.load("http://sexuria.com/v1/Pornos_Kostenlos_info_%s.html" % id) #: Webpage title / Package name titledata = re.search(self.PATTERN_TITLE, html, re.I) if not titledata: -- cgit v1.2.3 From 051604eb336b6d0064cd7317e0616e7de540b444 Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Thu, 20 Aug 2015 02:11:00 +0300 Subject: Create TransmissionRPC.py --- module/plugins/hooks/TransmissionRPC.py | 73 +++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 module/plugins/hooks/TransmissionRPC.py (limited to 'module/plugins') diff --git a/module/plugins/hooks/TransmissionRPC.py b/module/plugins/hooks/TransmissionRPC.py new file mode 100644 index 000000000..7e2c5250a --- /dev/null +++ b/module/plugins/hooks/TransmissionRPC.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- + +import re +import random +import pycurl + +from module.common.json_layer import json_loads, json_dumps +from module.network.HTTPRequest import BadHeader +from module.network.RequestFactory import getRequest as get_request +from module.plugins.internal.Addon import Addon + +class TransmissionRPC(Addon): + __name__ = "TransmissionRPC" + __type__ = "hook" + __status__ = "testing" + + __pattern__ = r"https?://.+\.torrent|magnet:\?.+" + __config__ = [("transmissionrpcurl" , "string" , "Transmission RPC URL" , "http://127.0.0.1:9091/transmission/rpc")] + + __version__ = "0.1" + __description__ = """Send torrent and magnet URLs to Transmission Bittorent daemon via RPC""" + __authors__ = [("GammaC0de", None)] + + + def init(self): + self.event_map = {'linksAdded': "links_added"} + + + def links_added(self, links, pid): + for link in links: + m = re.search(self.__pattern__, link) + if m: + self.log_debug("sending link: %s" % link) + self.SendToTransmission(link) + links.remove(link) + + + def SendToTransmission(self, url): + transmission_rpc_url = self.get_config('transmissionrpcurl') + client_request_id = self.__name__ + "".join(random.choice('0123456789ABCDEF') for _i in xrange(4)) + req = get_request() + + try: + response = self.load(transmission_rpc_url, + post=json_dumps({'arguments': {'filename': url}, + 'method' : 'torrent-add', + 'tag' : client_request_id}), + req=req) + + except BadHeader, e: + if e.code == 409: + headers = dict(re.findall(r"(?P<name>.*?): (?P<value>.*?)\r\n", req.header)) + session_id = headers['X-Transmission-Session-Id'] + req.c.setopt(pycurl.HTTPHEADER, ["X-Transmission-Session-Id: %s" % session_id]) + response = self.load(transmission_rpc_url, + post=json_dumps({'arguments': {'filename': url}, + 'method' : 'torrent-add', + 'tag' : client_request_id}), + req=req) + + else: + self.log_error(e) + + except Exception, e: + self.log_error(e) + + try: + res = json_loads(response) + if "result" in res: + self.log_debug("result: %s" % res['result']) + + except Exception, e: + self.log_error(e) -- cgit v1.2.3 From 0e87bb35a0fe1317998153bc8ef9e5072248ab2a Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Fri, 21 Aug 2015 01:03:21 +0300 Subject: fix #1765 --- module/plugins/internal/SimpleCrypter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 6a3f91a5b..9597116cc 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -10,7 +10,7 @@ from module.utils import fixup, html_unescape class SimpleCrypter(Crypter, SimpleHoster): __name__ = "SimpleCrypter" __type__ = "crypter" - __version__ = "0.60" + __version__ = "0.61" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -91,6 +91,7 @@ class SimpleCrypter(Crypter, SimpleHoster): def decrypt(self, pyfile): + self.links = [] #@TODO: Recheck in 0.4.10 self.prepare() self.check_info() #@TODO: Remove in 0.4.10 -- cgit v1.2.3 From 8aecbf814cad18d4bac507cf88f8b8782b25e889 Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Fri, 21 Aug 2015 01:06:18 +0300 Subject: fix #1765 --- module/plugins/crypter/MultiUpOrg.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/MultiUpOrg.py b/module/plugins/crypter/MultiUpOrg.py index 23e6dfa4a..fb228c3cd 100644 --- a/module/plugins/crypter/MultiUpOrg.py +++ b/module/plugins/crypter/MultiUpOrg.py @@ -9,10 +9,10 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class MultiUpOrg(SimpleCrypter): __name__ = "MultiUpOrg" __type__ = "crypter" - __version__ = "0.04" + __version__ = "0.05" __status__ = "testing" - __pattern__ = r'http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|miror)/\w+(/\w+)?' + __pattern__ = r'http://(?:www\.)?multiup\.org/(en|fr)/(?P<TYPE>project|download|mirror)/\w+(/\w+)?' __config__ = [("use_premium" , "bool", "Use premium account if available" , True), ("use_subfolder" , "bool", "Save package to subfolder" , True), ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] @@ -34,8 +34,8 @@ class MultiUpOrg(SimpleCrypter): pattern = r'style="width:97%;text-align:left".*\n.*href="(.*)"' if m_type == "download": dl_pattern = r'href="(.*)">.*\n.*<h5>DOWNLOAD</h5>' - miror_page = urlparse.urljoin("http://www.multiup.org/", re.search(dl_pattern, self.html).group(1)) - self.html = self.load(miror_page) + mirror_page = urlparse.urljoin("http://www.multiup.org/", re.search(dl_pattern, self.html).group(1)) + self.html = self.load(mirror_page) return re.findall(pattern, self.html) -- cgit v1.2.3 From 10213910fdb5a1c2e7bde50fdd7cdfb99090bf7e Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Sun, 23 Aug 2015 00:45:56 +0300 Subject: Update OneFichierCom.py --- module/plugins/hoster/OneFichierCom.py | 59 +++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index cba67b26c..fcf6842a6 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -2,13 +2,14 @@ import re +from module.network.RequestFactory import getURL as get_url from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" - __version__ = "0.88" + __version__ = "0.89" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:(?P<ID1>\w+)\.)?(?P<HOST>1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P<ID2>\w+))?' @@ -28,6 +29,8 @@ class OneFichierCom(SimpleHoster): COOKIES = [("1fichier.com", "LG", "en")] + DIRECT_LINK = True + NAME_PATTERN = r'>File\s*Name :</td>\s*<td.*>(?P<N>.+?)<' SIZE_PATTERN = r'>Size :</td>\s*<td.*>(?P<S>[\d.,]+) (?P<U>[\w^_]+)' OFFLINE_PATTERN = r'File not found !\s*<' @@ -40,7 +43,61 @@ class OneFichierCom(SimpleHoster): self.resume_download = True + @classmethod + def get_info(cls, url="", html=""): + redirect = url + for i in xrange(10): + try: + headers = dict(re.findall(r"(?P<name>.+?): (?P<value>.+?)\r", get_url(redirect, just_header=True).lower())) + if 'location' in headers and headers['location']: + redirect = headers['location'] + else: + if 'content-type' in headers and headers['content-type'] == "application/octet-stream": + if "filename=" in headers.get('content-disposition'): + name = dict(_i.split("=") for _i in map(str.strip, headers['content-disposition'].split(";"))[1:]['filename'].strip("\"'") + else: + name = url + + info = {'name' : name, + 'size' : long(headers.get('content-length')), + 'status': 3, + 'url' : url} + + else: + info = super(OneFichierCom, cls).get_info(url, html) + + break + + except Exception, e: + info = {'status' : 8, + 'error' : e.message} + + else: + info = {'status' : 8, + 'error' : _("Too many redirects")} + + return info + + + def handle_direct(self, pyfile): + redirect = pyfile.url + for i in xrange(self.get_config("maxredirs", plugin="UserAgentSwitcher")): + + headers = self.load(redirect, just_header=True) + if 'location' in headers and headers['location']: + self.log_debug("Redirect #%d to: %s" % (i, redirect)) + redirect = headers['location'] + else: + if 'content-type' in headers and headers['content-type'] == "application/octet-stream": + self.link = pyfile.url + break + else: + self.fail(_("Too many redirects")) + + def handle_free(self, pyfile): + self.check_errors() + id = self.info['pattern']['ID1'] or self.info['pattern']['ID2'] url, inputs = self.parse_html_form('action="https://1fichier.com/\?%s' % id) -- cgit v1.2.3 From d4616c7bf4f3b353523690decdd30a81d7f9ff04 Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Sun, 23 Aug 2015 22:22:30 +0300 Subject: Update TransmissionRPC.py --- module/plugins/hooks/TransmissionRPC.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/TransmissionRPC.py b/module/plugins/hooks/TransmissionRPC.py index 7e2c5250a..3d10b90c4 100644 --- a/module/plugins/hooks/TransmissionRPC.py +++ b/module/plugins/hooks/TransmissionRPC.py @@ -49,7 +49,7 @@ class TransmissionRPC(Addon): except BadHeader, e: if e.code == 409: - headers = dict(re.findall(r"(?P<name>.*?): (?P<value>.*?)\r\n", req.header)) + headers = dict(re.findall(r"(?P<name>.+?): (?P<value>.+?)\r?\n", req.header)) session_id = headers['X-Transmission-Session-Id'] req.c.setopt(pycurl.HTTPHEADER, ["X-Transmission-Session-Id: %s" % session_id]) response = self.load(transmission_rpc_url, -- cgit v1.2.3 From a2da3c7790b81233a748bd28107e8c6ccdbb0594 Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Sun, 23 Aug 2015 22:24:27 +0300 Subject: Update OneFichierCom.py --- module/plugins/hoster/OneFichierCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index fcf6842a6..93f056377 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -48,7 +48,7 @@ class OneFichierCom(SimpleHoster): redirect = url for i in xrange(10): try: - headers = dict(re.findall(r"(?P<name>.+?): (?P<value>.+?)\r", get_url(redirect, just_header=True).lower())) + headers = dict(re.findall(r"(?P<name>.+?): (?P<value>.+?)\r?\n", get_url(redirect, just_header=True).lower())) if 'location' in headers and headers['location']: redirect = headers['location'] else: -- cgit v1.2.3 From 45feced4c09605dc5e80c4d96e2a4c5e9ee416d4 Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Wed, 26 Aug 2015 15:32:53 +0300 Subject: Update Plugin.py --- module/plugins/internal/Plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 7b45c40a8..8bc5d4a65 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -7,6 +7,7 @@ import inspect import os import re import urllib +import sys if os.name != "nt": import grp @@ -146,7 +147,7 @@ def chunks(iterable, size): class Plugin(object): __name__ = "Plugin" __type__ = "hoster" - __version__ = "0.30" + __version__ = "0.32" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -345,7 +346,7 @@ class Plugin(object): #@TODO: Move to network in 0.4.10 if isinstance(decode, basestring): - res = decode(res, decode) + res = sys.modules[__name__].decode(res, decode) #@TODO: See #1787, use utils.decode() in 0.4.10 if self.pyload.debug: frame = inspect.currentframe() -- cgit v1.2.3 From 47ce7cd62c62d476094070e8d833033209c035e1 Mon Sep 17 00:00:00 2001 From: Bambie42 <Bambie42@users.noreply.github.com> Date: Wed, 26 Aug 2015 14:36:59 +0200 Subject: partly fixes #1756 --- module/plugins/crypter/LinkCryptWs.py | 13 +++++-------- module/plugins/internal/Captcha.py | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py index af13f55f6..557a63cbd 100644 --- a/module/plugins/crypter/LinkCryptWs.py +++ b/module/plugins/crypter/LinkCryptWs.py @@ -31,7 +31,6 @@ class LinkCryptWs(Crypter): def setup(self): - self.captcha = False self.links = [] self.sources = ['cnl', 'web', 'dlc', 'rsdf', 'ccf'] @@ -60,7 +59,6 @@ class LinkCryptWs(Crypter): self.retry(8, 15, _("Can't handle Key-Captcha")) if self.is_captcha_protected(): - self.captcha = True self.unlock_captcha_protection() self.handle_captcha_errors() @@ -165,12 +163,11 @@ class LinkCryptWs(Crypter): def handle_captcha_errors(self): - if self.captcha: - if "Your choice was wrong!" in self.html: - self.captcha.invalid() - self.retry() - else: - self.captcha.correct() + if "Your choice was wrong!" in self.html: + self.captcha.invalid() + self.retry() + else: + self.captcha.correct() def handle_link_source(self, type): diff --git a/module/plugins/internal/Captcha.py b/module/plugins/internal/Captcha.py index c08050ee8..600fd1d34 100644 --- a/module/plugins/internal/Captcha.py +++ b/module/plugins/internal/Captcha.py @@ -120,7 +120,7 @@ class Captcha(Plugin): self.log_warning(_("Error removing: %s") % tmp_img.name, e) traceback.print_exc() - self.log_info(_("Captcha result: ") + result) #@TODO: Remove from here? + #self.log_info(_("Captcha result: ") + result) #@TODO: Remove from here? return result -- cgit v1.2.3 From 92dd8f10b58a6fe20d40e08e081f6311eb8c592d Mon Sep 17 00:00:00 2001 From: B1gG <gerardojgonzalezg@yahoo.es> Date: Thu, 27 Aug 2015 07:45:21 -0430 Subject: Update to resolve issue #1793 This update resolve the issue raised when you try to share a link from YouTube android app to pyLoad client. Issue was that the parser doesn't detect youtu.be as a valid URL for YoutubeCom.py and always use BasePlugin.py instead of, that is why the "__pattern__" need to be modified. The URL_REPLACEMENTS is not appropriate for this short url and was fixed also, in order to construct and typical youtube.com URL, that this script can handle. --- module/plugins/hoster/YoutubeCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 86cca7cf1..9c7421be1 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -36,7 +36,7 @@ class YoutubeCom(Hoster): __version__ = "0.45" __status__ = "testing" - __pattern__ = r'https?://(?:[^/]*\.)?(youtube\.com|youtu\.be)/watch\?(?:.*&)?v=.+' + __pattern__ = r'https?://(?:[^/]*\.)?(youtube\.com/watch\?v=|youtu\.be)(?:.*)' __config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting" , "hd" ), ("fmt" , "int" , "FMT/ITAG Number (0 for auto)", 0 ), (".mp4" , "bool" , "Allow .mp4" , True ), @@ -51,7 +51,7 @@ class YoutubeCom(Hoster): ("zoidberg", "zoidberg@mujmail.cz")] - URL_REPLACEMENTS = [(r'youtu\.be/', 'youtube.com/')] + URL_REPLACEMENTS = [(r'youtu\.be/', 'youtube.com/watch?v=')] #: Invalid characters that must be removed from the file name invalid_chars = u'\u2605:?><"|\\' -- cgit v1.2.3 From dedce876f1f9cb9ad9f8b135ced26bf19fc1dbc7 Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Sat, 29 Aug 2015 16:28:59 +0300 Subject: [Hoster] fix pyfile.name not updated if disposition --- module/plugins/internal/Hoster.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py index b397a92a6..a8b8922bb 100644 --- a/module/plugins/internal/Hoster.py +++ b/module/plugins/internal/Hoster.py @@ -44,7 +44,7 @@ def create_getInfo(klass): class Hoster(Plugin): __name__ = "Hoster" __type__ = "hoster" - __version__ = "0.20" + __version__ = "0.21" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -412,7 +412,7 @@ class Hoster(Plugin): if disposition and newname: finalname = urlparse.urlparse(newname).path.split('/')[-1].split(' filename*=')[0] - if finalname != newname != self.pyfile.name: + if finalname != newname try: os.rename(fs_join(location, newname), fs_join(location, finalname)) @@ -421,8 +421,9 @@ class Hoster(Plugin): finalname = newname self.log_info(_("`%s` saved as `%s`") % (self.pyfile.name, finalname)) - self.pyfile.name = finalname - filename = os.path.join(location, finalname) + + self.pyfile.name = finalname + filename = os.path.join(location, finalname) self.set_permissions(fs_encode(filename)) -- cgit v1.2.3 From 2a3405db57862c5644643fd9b8bad0a74b0c1cbe Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Sat, 29 Aug 2015 23:02:36 +0300 Subject: Update Hoster.py --- module/plugins/internal/Hoster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py index a8b8922bb..924672acf 100644 --- a/module/plugins/internal/Hoster.py +++ b/module/plugins/internal/Hoster.py @@ -412,7 +412,7 @@ class Hoster(Plugin): if disposition and newname: finalname = urlparse.urlparse(newname).path.split('/')[-1].split(' filename*=')[0] - if finalname != newname + if finalname != newname: try: os.rename(fs_join(location, newname), fs_join(location, finalname)) -- cgit v1.2.3 From f44acc14fc6492f9fefbc707618c774d34ac1aeb Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@users.noreply.github.com> Date: Sun, 30 Aug 2015 03:38:54 +0200 Subject: Fix https://github.com/pyload/pyload/issues/1793 --- module/plugins/hoster/YoutubeCom.py | 26 +++----------------------- module/plugins/internal/Plugin.py | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 24 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py index 9c7421be1..5c7c13962 100644 --- a/module/plugins/hoster/YoutubeCom.py +++ b/module/plugins/hoster/YoutubeCom.py @@ -6,37 +6,17 @@ import subprocess import urllib from module.plugins.internal.Hoster import Hoster -from module.plugins.internal.Plugin import replace_patterns +from module.plugins.internal.Plugin import replace_patterns, which from module.utils import html_unescape -def which(program): - """ - Works exactly like the unix command which - Courtesy of http://stackoverflow.com/a/377028/675646 - """ - isExe = lambda x: os.path.isfile(x) and os.access(x, os.X_OK) - - fpath, fname = os.path.split(program) - - if fpath: - if isExe(program): - return program - else: - for path in os.environ['PATH'].split(os.pathsep): - path = path.strip('"') - exe_file = os.path.join(path, program) - if isExe(exe_file): - return exe_file - - class YoutubeCom(Hoster): __name__ = "YoutubeCom" __type__ = "hoster" - __version__ = "0.45" + __version__ = "0.46" __status__ = "testing" - __pattern__ = r'https?://(?:[^/]*\.)?(youtube\.com/watch\?v=|youtu\.be)(?:.*)' + __pattern__ = r'https?://(?:[^/]*\.)?(youtu\.be/|youtube\.com/watch\?(?:.*&)?v=)\w+' __config__ = [("quality", "sd;hd;fullhd;240p;360p;480p;720p;1080p;3072p", "Quality Setting" , "hd" ), ("fmt" , "int" , "FMT/ITAG Number (0 for auto)", 0 ), (".mp4" , "bool" , "Allow .mp4" , True ), diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 7b45c40a8..1e04d388e 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -54,6 +54,26 @@ def fixurl(url): #@TODO: Move to utils in 0.4.10 def timestamp(): return int(time.time() * 1000) + + +#@TODO: Move to utils in 0.4.10 +def which(program): + """ + Works exactly like the unix command which + Courtesy of http://stackoverflow.com/a/377028/675646 + """ + isExe = lambda x: os.path.isfile(x) and os.access(x, os.X_OK) + + fpath, fname = os.path.split(program) + + if fpath: + if isExe(program): + return program + else: + for path in os.environ['PATH'].split(os.pathsep): + exe_file = os.path.join(path.strip('"'), program) + if isExe(exe_file): + return exe_file def seconds_to_midnight(gmt=0): @@ -146,7 +166,7 @@ def chunks(iterable, size): class Plugin(object): __name__ = "Plugin" __type__ = "hoster" - __version__ = "0.30" + __version__ = "0.31" __status__ = "testing" __pattern__ = r'^unmatchable$' -- cgit v1.2.3 From 5c5bf90bdc709a224c20e2d68dd49489cb24a1fe Mon Sep 17 00:00:00 2001 From: estaban <babedoudi@yahoo.fr> Date: Sun, 30 Aug 2015 11:04:22 +0100 Subject: Broken OneFIchierCom plugin Syntax error in commit [https://github.com/pyload/pyload/commit/10213910fdb5a1c2e7bde50fdd7cdfb99090bf7e] which makes importing OneFichierCom break. Please test your code before pull requesting. --- module/plugins/hoster/OneFichierCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py index 93f056377..70229a6ef 100644 --- a/module/plugins/hoster/OneFichierCom.py +++ b/module/plugins/hoster/OneFichierCom.py @@ -9,7 +9,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class OneFichierCom(SimpleHoster): __name__ = "OneFichierCom" __type__ = "hoster" - __version__ = "0.89" + __version__ = "0.90" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(?:(?P<ID1>\w+)\.)?(?P<HOST>1fichier\.com|alterupload\.com|cjoint\.net|d(es)?fichiers\.com|dl4free\.com|megadl\.fr|mesfichiers\.org|piecejointe\.net|pjointe\.com|tenvoi\.com)(?:/\?(?P<ID2>\w+))?' @@ -54,7 +54,7 @@ class OneFichierCom(SimpleHoster): else: if 'content-type' in headers and headers['content-type'] == "application/octet-stream": if "filename=" in headers.get('content-disposition'): - name = dict(_i.split("=") for _i in map(str.strip, headers['content-disposition'].split(";"))[1:]['filename'].strip("\"'") + name = dict(_i.split("=") for _i in map(str.strip, headers['content-disposition'].split(";"))[1:])['filename'].strip("\"'") else: name = url -- cgit v1.2.3 From 7ba2c2414ccc0ac141cea5bfe646d86b7d94a3ad Mon Sep 17 00:00:00 2001 From: Nippey <matthias@dornuweb.de> Date: Wed, 2 Sep 2015 17:39:11 +0200 Subject: Update Checksum.py The "is" operator checks for object equality, but in this case we want to compare integers. Reason of change: 02.09.2015 17:32:23 WARNING HOOK Checksum: File abcdefg.rar has incorrect size: 106954752 B (106954752 expected) --- module/plugins/hooks/Checksum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index da4d35df1..64c5fa3ff 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -38,7 +38,7 @@ def compute_checksum(local_file, algorithm): class Checksum(Addon): __name__ = "Checksum" __type__ = "hook" - __version__ = "0.20" + __version__ = "0.21" __status__ = "testing" __config__ = [("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), @@ -114,7 +114,7 @@ class Checksum(Addon): api_size = int(data['size']) file_size = os.path.getsize(local_file) - if api_size is not file_size: + if api_size != file_size: self.log_warning(_("File %s has incorrect size: %d B (%d expected)") % (pyfile.name, file_size, api_size)) self.check_failed(pyfile, local_file, "Incorrect file size") -- cgit v1.2.3 From 4cd2b7390dd97dc2016ab71f954f191de12f2f46 Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@users.noreply.github.com> Date: Thu, 3 Sep 2015 20:37:17 +0200 Subject: Spare fixes (2) --- module/plugins/accounts/OboomCom.py | 9 ++-- module/plugins/accounts/RapiduNet.py | 2 +- module/plugins/crypter/GoogledriveComFolder.py | 4 +- module/plugins/crypter/LinkCryptWs.py | 2 +- .../plugins/crypter/TNTVillageScambioeticoOrg.py | 4 +- module/plugins/hooks/ExtractArchive.py | 12 ++--- module/plugins/hooks/TransmissionRPC.py | 32 +++++++------ module/plugins/hoster/ShareonlineBiz.py | 4 +- module/plugins/internal/Addon.py | 8 +++- module/plugins/internal/Hoster.py | 53 +++++++++++++--------- module/plugins/internal/Plugin.py | 6 +-- module/plugins/internal/SimpleCrypter.py | 2 +- module/plugins/internal/SimpleHoster.py | 22 +++++---- 13 files changed, 90 insertions(+), 70 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/accounts/OboomCom.py b/module/plugins/accounts/OboomCom.py index 380368b70..a792848ea 100644 --- a/module/plugins/accounts/OboomCom.py +++ b/module/plugins/accounts/OboomCom.py @@ -40,7 +40,7 @@ class OboomCom(Account): get={'auth': user, 'pass': pbkdf2})) - if not result[0] == 200: + if result[0] != 200: self.log_warning(_("Failed to log in: %s") % result[1]) self.login_fail() @@ -52,10 +52,7 @@ class OboomCom(Account): userData = account_data['user'] - if userData['premium'] == "null": - premium = False - else: - premium = True + premium = userData['premium'] != "null" if userData['premium_unix'] == "null": validUntil = -1 @@ -65,7 +62,7 @@ class OboomCom(Account): traffic = userData['traffic'] trafficLeft = traffic['current'] / 1024 #@TODO: Remove `/ 1024` in 0.4.10 - maxTraffic = traffic['max'] / 1024 #@TODO: Remove `/ 1024` in 0.4.10 + maxTraffic = traffic['max'] / 1024 #@TODO: Remove `/ 1024` in 0.4.10 session = account_data['session'] diff --git a/module/plugins/accounts/RapiduNet.py b/module/plugins/accounts/RapiduNet.py index 1ec29bd77..2033d377f 100644 --- a/module/plugins/accounts/RapiduNet.py +++ b/module/plugins/accounts/RapiduNet.py @@ -62,5 +62,5 @@ class RapiduNet(Account): self.log_debug(json) - if not json['message'] == "success": + if json['message'] != "success": self.login_fail() diff --git a/module/plugins/crypter/GoogledriveComFolder.py b/module/plugins/crypter/GoogledriveComFolder.py index 88c7ebab2..e7a5bae2c 100644 --- a/module/plugins/crypter/GoogledriveComFolder.py +++ b/module/plugins/crypter/GoogledriveComFolder.py @@ -6,11 +6,11 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class GoogledriveComFolder(SimpleCrypter): __name__ = "GoogledriveCom" __type__ = "crypter" - __version__ = "0.02" + __version__ = "0.03" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?drive\.google\.com/folderview\?.*id=\w+' - __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), #: Overrides pyload.config['general']['folder_per_package'] + __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] __description__ = """Drive.google.com folder decrypter plugin""" diff --git a/module/plugins/crypter/LinkCryptWs.py b/module/plugins/crypter/LinkCryptWs.py index 557a63cbd..095ca0158 100644 --- a/module/plugins/crypter/LinkCryptWs.py +++ b/module/plugins/crypter/LinkCryptWs.py @@ -152,7 +152,7 @@ class LinkCryptWs(Crypter): unrarpw = sitein[indexi:indexe] - if not (unrarpw == "Password" or "Dateipasswort") : + if unrarpw not in ("Password", "Dateipasswort"): self.log_debug("File password set to: [%s]"% unrarpw) self.pyfile.package().password = unrarpw diff --git a/module/plugins/crypter/TNTVillageScambioeticoOrg.py b/module/plugins/crypter/TNTVillageScambioeticoOrg.py index 6ba1ee19b..e85a8fbb7 100644 --- a/module/plugins/crypter/TNTVillageScambioeticoOrg.py +++ b/module/plugins/crypter/TNTVillageScambioeticoOrg.py @@ -6,11 +6,11 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class TNTVillageScambioeticoOrg(SimpleCrypter): __name__ = "TNTVillageScambioeticoOrg" __type__ = "crypter" - __version__ = "0.02" + __version__ = "0.03" __status__ = "testing" __pattern__ = r'http://(?:www\.)?forum\.tntvillage\.scambioetico\.org/index\.php\?.*showtopic=\d+' - __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), #: Overrides pyload.config['general']['folder_per_package'] + __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] __description__ = """TNTVillage.scambioetico.org decrypter plugin""" diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index eab196160..87cd38ade 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -51,7 +51,7 @@ except ImportError: pass from module.plugins.internal.Addon import Addon, Expose, threaded -from module.plugins.internal.Plugin import replace_patterns +from module.plugins.internal.Plugin import exists, replace_patterns from module.plugins.internal.Extractor import ArchiveError, CRCError, PasswordError from module.utils import fs_encode, save_join as fs_join, uniqify @@ -107,7 +107,7 @@ class ArchiveQueue(object): class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.49" + __version__ = "1.50" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , True ), @@ -288,7 +288,7 @@ class ExtractArchive(Addon): if subfolder: out = fs_join(out, pypack.folder) - if not os.path.exists(out): + if not exists(out): os.makedirs(out) matched = False @@ -313,7 +313,7 @@ class ExtractArchive(Addon): for fname, fid, fout in targets: name = os.path.basename(fname) - if not os.path.exists(fname): + if not exists(fname): self.log_debug(name, "File not found") continue @@ -356,7 +356,7 @@ class ExtractArchive(Addon): for filename in new_files: file = fs_encode(fs_join(os.path.dirname(archive.filename), filename)) - if not os.path.exists(file): + if not exists(file): self.log_debug("New file %s does not exists" % filename) continue @@ -476,7 +476,7 @@ class ExtractArchive(Addon): deltotrash = self.get_config('deltotrash') for f in delfiles: file = fs_encode(f) - if not os.path.exists(file): + if not exists(file): continue if not deltotrash: diff --git a/module/plugins/hooks/TransmissionRPC.py b/module/plugins/hooks/TransmissionRPC.py index 3d10b90c4..9a9ee04b7 100644 --- a/module/plugins/hooks/TransmissionRPC.py +++ b/module/plugins/hooks/TransmissionRPC.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -import re import random +import re + import pycurl from module.common.json_layer import json_loads, json_dumps @@ -9,17 +10,19 @@ from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getRequest as get_request from module.plugins.internal.Addon import Addon + class TransmissionRPC(Addon): - __name__ = "TransmissionRPC" - __type__ = "hook" + __name__ = "TransmissionRPC" + __type__ = "hook" + __version__ = "0.11" __status__ = "testing" __pattern__ = r"https?://.+\.torrent|magnet:\?.+" - __config__ = [("transmissionrpcurl" , "string" , "Transmission RPC URL" , "http://127.0.0.1:9091/transmission/rpc")] + __config__ = [("rpc_url", "str", "Transmission RPC URL", "http://127.0.0.1:9091/transmission/rpc")] - __version__ = "0.1" __description__ = """Send torrent and magnet URLs to Transmission Bittorent daemon via RPC""" - __authors__ = [("GammaC0de", None)] + __license__ = "GPLv3" + __authors__ = [("GammaC0de", None)] def init(self): @@ -27,16 +30,17 @@ class TransmissionRPC(Addon): def links_added(self, links, pid): - for link in links: - m = re.search(self.__pattern__, link) - if m: - self.log_debug("sending link: %s" % link) - self.SendToTransmission(link) - links.remove(link) + pattern = re.compile(self.__pattern__) + urls = [link for link in links if pattern.match(link)] + + for url in urls: + self.log_debug("Sending link: %s" % url) + self.SendToTransmission(url) + links.remove(url) def SendToTransmission(self, url): - transmission_rpc_url = self.get_config('transmissionrpcurl') + transmission_rpc_url = self.get_config('rpc_url') client_request_id = self.__name__ + "".join(random.choice('0123456789ABCDEF') for _i in xrange(4)) req = get_request() @@ -67,7 +71,7 @@ class TransmissionRPC(Addon): try: res = json_loads(response) if "result" in res: - self.log_debug("result: %s" % res['result']) + self.log_debug("Result: %s" % res['result']) except Exception, e: self.log_error(e) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index b5af3ea35..dbe7fe401 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -79,7 +79,7 @@ class ShareonlineBiz(SimpleHoster): post={'dl_free' : "1", 'recaptcha_challenge_field': challenge, 'recaptcha_response_field' : response}) - if not res == "0": + if res != "0": self.captcha.correct() return res else: @@ -136,7 +136,7 @@ class ShareonlineBiz(SimpleHoster): self.log_debug(dlinfo) - if not dlinfo['status'] == "online": + if dlinfo['status'] != "online": self.offline() else: pyfile.name = dlinfo['name'] diff --git a/module/plugins/internal/Addon.py b/module/plugins/internal/Addon.py index 45ca98eac..4ccaaba8b 100644 --- a/module/plugins/internal/Addon.py +++ b/module/plugins/internal/Addon.py @@ -25,7 +25,7 @@ def threaded(fn): class Addon(Plugin): __name__ = "Addon" __type__ = "hook" #@TODO: Change to `addon` in 0.4.10 - __version__ = "0.04" + __version__ = "0.05" __status__ = "testing" __config__ = [] #: [("name", "type", "desc", "default")] @@ -57,6 +57,12 @@ class Addon(Plugin): self.init_events() + #@TODO: Remove in 0.4.10 + def _log(self, level, plugintype, pluginname, messages): + plugintype = "addon" if plugintype is "hook" else plugintype + return super(Addon, self)._log(level, plugintype, pluginname, messages) + + def init_events(self): if self.event_map: for event, funcs in self.event_map.items(): diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py index 924672acf..e6bd14329 100644 --- a/module/plugins/internal/Hoster.py +++ b/module/plugins/internal/Hoster.py @@ -44,7 +44,7 @@ def create_getInfo(klass): class Hoster(Plugin): __name__ = "Hoster" __type__ = "hoster" - __version__ = "0.21" + __version__ = "0.22" __status__ = "testing" __pattern__ = r'^unmatchable$' @@ -432,9 +432,35 @@ class Hoster(Plugin): return self.last_download - def check_download(self, rules, delete=False, file_size=0, size_tolerance=1024, read_size=1048576): + def check_filesize(self, file_size, size_tolerance=1024): """ - Checks the content of the last downloaded file, re match is saved to `lastCheck` + Checks the file size of the last downloaded file + + :param file_size: expected file size + :param size_tolerance: size check tolerance + """ + if not self.last_download: + return + + download_size = os.stat(fs_encode(self.last_download)).st_size + + if download_size < 1: + self.fail(_("Empty file")) + + elif file_size > 0: + diff = abs(file_size - download_size) + + if diff > size_tolerance: + self.fail(_("File size mismatch | Expected file size: %s | Downloaded file size: %s") + % (file_size, download_size)) + + elif diff != 0: + self.log_warning(_("File size is not equal to expected size")) + + + def check_download(self, rules, delete=False, read_size=1048576, file_size=0, size_tolerance=1024): + """ + Checks the content of the last downloaded file, re match is saved to `last_check` :param rules: dict with names and rules to match (compiled regexp or strings) :param delete: delete if matched @@ -447,26 +473,11 @@ class Hoster(Plugin): last_download = fs_encode(self.last_download) if not self.last_download or not exists(last_download): - self.last_download = "" + self.last_download = "" #@NOTE: Bad place... self.fail(self.pyfile.error or _("No file downloaded")) try: - download_size = os.stat(last_download).st_size - - if download_size < 1: - do_delete = True - self.fail(_("Empty file")) - - elif file_size > 0: - diff = abs(file_size - download_size) - - if diff > size_tolerance: - do_delete = True - self.fail(_("File size mismatch | Expected file size: %s | Downloaded file size: %s") - % (file_size, download_size)) - - elif diff != 0: - self.log_warning(_("File size is not equal to expected size")) + self.check_filesize(file_size, size_tolerance) with open(last_download, "rb") as f: content = f.read(read_size) @@ -496,8 +507,8 @@ class Hoster(Plugin): traceback.print_exc() else: + self.log_info(_("File deleted: ") + self.last_download) self.last_download = "" - self.log_info(_("File deleted")) def direct_link(self, url, follow_location=None): diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index 1e04d388e..b0c0bb66e 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -54,9 +54,9 @@ def fixurl(url): #@TODO: Move to utils in 0.4.10 def timestamp(): return int(time.time() * 1000) - - -#@TODO: Move to utils in 0.4.10 + + +#@TODO: Move to utils in 0.4.10 def which(program): """ Works exactly like the unix command which diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 9597116cc..d348f92e2 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -14,7 +14,7 @@ class SimpleCrypter(Crypter, SimpleHoster): __status__ = "testing" __pattern__ = r'^unmatchable$' - __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), #: Overrides pyload.config['general']['folder_per_package'] + __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] __description__ = """Simple decrypter plugin""" diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 69f88081a..968a80b63 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -22,12 +22,13 @@ statusMap = dict((v, k) for k, v in _statusMap.items()) class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.81" + __version__ = "1.82" __status__ = "testing" __pattern__ = r'^unmatchable$' - __config__ = [("use_premium", "bool", "Use premium account if available" , True), - ("fallback" , "bool", "Fallback to free download if premium fails", True)] + __config__ = [("use_premium" , "bool", "Use premium account if available" , True), + ("premium_fallback", "bool", "Fallback to free download if premium fails", True), + ("chk_filesize" , "bool", "Check file size" , True)] __description__ = """Simple hoster plugin""" __license__ = "GPLv3" @@ -294,7 +295,7 @@ class SimpleHoster(Hoster): self.check_file() except Fail, e: #@TODO: Move to PluginThread in 0.4.10 - if self.get_config('fallback', True) and self.premium: + if self.get_config('premium_fallback', True) and self.premium: self.log_warning(_("Premium download failed"), e) self.restart(nopremium=True) @@ -309,15 +310,16 @@ class SimpleHoster(Hoster): self.captcha.invalid() self.retry(10, reason=_("Wrong captcha")) - # 10485760 is 10MB, tolerance is used when comparing displayed size on the hoster website to real size - # For example displayed size can be 1.46GB for example, but real size can be 1.4649853GB elif self.check_download({'Empty file': re.compile(r'\A((.|)(\2|\s)*)\Z')}, - file_size=self.info['size'] if 'size' in self.info else 0, - size_tolerance=10485760, - delete=False): #@TODO: Make `delete` settable in 0.4.10 + delete=True): self.error(_("Empty file")) else: + if self.get_config('chk_filesize', False) and 'size' in self.info: + # 10485760 is 10MB, tolerance is used when comparing displayed size on the hoster website to real size + # For example displayed size can be 1.46GB for example, but real size can be 1.4649853GB + self.check_filesize(self.info['size'], size_tolerance=10485760) + self.log_debug("Using default check rules...") for r, p in self.FILE_ERRORS: errmsg = self.check_download({r: re.compile(p)}) @@ -340,7 +342,7 @@ class SimpleHoster(Hoster): self.check_errors() self.log_info(_("No errors found")) - self.pyfile.error = "" + self.pyfile.error = "" #@TODO: Recheck in 0.4.10 def check_errors(self): -- cgit v1.2.3 From 353a477e9a92883ba83fad471804eb2fe4ee643c Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Fri, 4 Sep 2015 16:21:21 +0300 Subject: Update TransmissionRPC.py --- module/plugins/hooks/TransmissionRPC.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/TransmissionRPC.py b/module/plugins/hooks/TransmissionRPC.py index 9a9ee04b7..2ca06a9ad 100644 --- a/module/plugins/hooks/TransmissionRPC.py +++ b/module/plugins/hooks/TransmissionRPC.py @@ -14,7 +14,7 @@ from module.plugins.internal.Addon import Addon class TransmissionRPC(Addon): __name__ = "TransmissionRPC" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __status__ = "testing" __pattern__ = r"https?://.+\.torrent|magnet:\?.+" @@ -35,11 +35,11 @@ class TransmissionRPC(Addon): for url in urls: self.log_debug("Sending link: %s" % url) - self.SendToTransmission(url) + self.send_to_transmission(url) links.remove(url) - def SendToTransmission(self, url): + def send_to_transmission(self, url): transmission_rpc_url = self.get_config('rpc_url') client_request_id = self.__name__ + "".join(random.choice('0123456789ABCDEF') for _i in xrange(4)) req = get_request() @@ -56,17 +56,24 @@ class TransmissionRPC(Addon): headers = dict(re.findall(r"(?P<name>.+?): (?P<value>.+?)\r?\n", req.header)) session_id = headers['X-Transmission-Session-Id'] req.c.setopt(pycurl.HTTPHEADER, ["X-Transmission-Session-Id: %s" % session_id]) - response = self.load(transmission_rpc_url, - post=json_dumps({'arguments': {'filename': url}, - 'method' : 'torrent-add', - 'tag' : client_request_id}), - req=req) - + try: + response = self.load(transmission_rpc_url, + post=json_dumps({'arguments': {'filename': url}, + 'method' : 'torrent-add', + 'tag' : client_request_id}), + req=req) + + except Exception, e: + self.log_error(e) + return + else: self.log_error(e) + return except Exception, e: self.log_error(e) + return try: res = json_loads(response) -- cgit v1.2.3 From ae83396021a839e85c77d498ae726186c1a5e575 Mon Sep 17 00:00:00 2001 From: emkayyyy <joostzoellner@online.de> Date: Sat, 12 Sep 2015 09:20:52 +0200 Subject: Fix IRCInterface and XMPPInterface Following Error came up when I tried setting up either IRCInterface or XMPPInterface. AttributeError: 'IRCInterface' object has no attribute 'set_daemon' With my change now it works. Might have been caused by the removal of chamelCase. --- module/plugins/hooks/IRCInterface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index 08b1bad0c..5d8928a57 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -18,7 +18,7 @@ from module.utils import formatSize class IRCInterface(Thread, Addon): __name__ = "IRCInterface" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __status__ = "testing" __config__ = [("host" , "str" , "IRC-Server Address" , "Enter your server here!"), @@ -40,7 +40,7 @@ class IRCInterface(Thread, Addon): def __init__(self, core, manager): Thread.__init__(self) Addon.__init__(self, core, manager) - self.set_daemon(True) + self.setDaemon(True) def activate(self): -- cgit v1.2.3 From c5c44335d970195780443d7ac2948e02f0e67ba1 Mon Sep 17 00:00:00 2001 From: Richard Lindner <rlindner81@gmail.com> Date: Sat, 12 Sep 2015 13:55:48 +0200 Subject: fixed Go4UpCom plugin and added parameter for preferred hoster --- module/plugins/crypter/Go4UpCom.py | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) mode change 100644 => 100755 module/plugins/crypter/Go4UpCom.py (limited to 'module/plugins') diff --git a/module/plugins/crypter/Go4UpCom.py b/module/plugins/crypter/Go4UpCom.py old mode 100644 new mode 100755 index 026982014..2d423a1a9 --- a/module/plugins/crypter/Go4UpCom.py +++ b/module/plugins/crypter/Go4UpCom.py @@ -4,18 +4,20 @@ import re import urlparse from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo +import json class Go4UpCom(SimpleCrypter): __name__ = "Go4UpCom" __type__ = "crypter" - __version__ = "0.13" + __version__ = "0.14" __status__ = "testing" __pattern__ = r'http://go4up\.com/(dl/\w{12}|rd/\w{12}/\d+)' __config__ = [("use_premium" , "bool", "Use premium account if available" , True), ("use_subfolder" , "bool", "Save package to subfolder" , True), - ("subfolder_per_pack", "bool", "Create a subfolder for each package", True)] + ("subfolder_per_pack", "bool", "Create a subfolder for each package", True), + ("preferred_hoster" , "int" , "Id of preferred hoster or 0 for all", 0)] __description__ = """Go4Up.com decrypter plugin""" __license__ = "GPLv3" @@ -32,19 +34,20 @@ class Go4UpCom(SimpleCrypter): def get_links(self): links = [] - - m = re.search(r'(/download/gethosts/.+?)"', self.html) - if m: - self.html = self.load(urlparse.urljoin("http://go4up.com/", m.group(1))) - pages = [self.load(url) for url in re.findall(self.LINK_PATTERN, self.html)] - else: - pages = [self.html] - - for html in pages: - try: - links.append(re.search(r'<b><a href="(.+?)"', html).group(1)) - except Exception: - continue + preference = self.get_config("preferred_hoster") + + hosterslink_re = re.search(r'(/download/gethosts/.+?)"', self.html) + if hosterslink_re: + hosters = self.load(urlparse.urljoin("http://go4up.com/", hosterslink_re.group(1))) + for hoster in json.loads(hosters): + if preference != 0 and preference != int(hoster["hostId"]): + continue + pagelink_re = re.search(self.LINK_PATTERN, hoster["link"]) + if pagelink_re: + page = self.load(pagelink_re.group(1)) + link_re = re.search(r'<b><a href="(.+?)"', page) + if link_re: + links.append(link_re.group(1)) return links -- cgit v1.2.3 From a313e7b525178204eef9dd2cf7ad91f5299d6be2 Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Sun, 13 Sep 2015 00:49:51 +0300 Subject: New Hoster - UserscloudCom --- module/plugins/hoster/UserscloudCom.py | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 module/plugins/hoster/UserscloudCom.py (limited to 'module/plugins') diff --git a/module/plugins/hoster/UserscloudCom.py b/module/plugins/hoster/UserscloudCom.py new file mode 100644 index 000000000..6791a6068 --- /dev/null +++ b/module/plugins/hoster/UserscloudCom.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class UserscloudCom(SimpleHoster): + __name__ = "UserscloudCom" + __type__ = "hoster" + __version__ = "0.01" + __status__ = "testing" + + __pattern__ = r'https?://(?:www\.)?userscloud\.com/\w{12}' + + __description__ = """userscloud.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("GammaC0de", None)] + + + NAME_PATTERN = r'<h2 class="strong margin-none">(?P<N>.+?)<' + SIZE_PATTERN = r'<div class="ribbon">(?P<S>[\d.,]+) (?P<U>[\w^_]+)<' + OFFLINE_PATTERN = r'The file you are trying to download is no longer available' + + + def setup(self): + self.multiDL = True + self.resume_download = False + self.chunk_limit = 1 + + def handle_free(self, pyfile): + post_data=dict(re.findall(r'<input type="hidden" name="(.+?)" value="(.*?)">', self.html)) + + self.download(pyfile.url, post=post_data) + +getInfo = create_getInfo(UserscloudCom) -- cgit v1.2.3 From 08e5142a98f49ae9e96b5d016dbee2dfc67a9685 Mon Sep 17 00:00:00 2001 From: GammaC0de <GammaC0de@users.noreply.github.com> Date: Sun, 13 Sep 2015 01:11:25 +0300 Subject: Update UserscloudCom.py --- module/plugins/hoster/UserscloudCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/UserscloudCom.py b/module/plugins/hoster/UserscloudCom.py index 6791a6068..00f8e0324 100644 --- a/module/plugins/hoster/UserscloudCom.py +++ b/module/plugins/hoster/UserscloudCom.py @@ -13,7 +13,7 @@ class UserscloudCom(SimpleHoster): __pattern__ = r'https?://(?:www\.)?userscloud\.com/\w{12}' - __description__ = """userscloud.com hoster plugin""" + __description__ = """Userscloud.com hoster plugin""" __license__ = "GPLv3" __authors__ = [("GammaC0de", None)] -- cgit v1.2.3 From fbb98784866ec884fca5f067436e8117a3b1b24b Mon Sep 17 00:00:00 2001 From: Walter Purcaro <vuolter@users.noreply.github.com> Date: Sun, 13 Sep 2015 03:34:46 +0200 Subject: [UlozTo] Hoster update --- module/plugins/hoster/UlozTo.py | 10 ++++++---- module/plugins/hoster/UserscloudCom.py | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index b402433a4..066d1daf0 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -15,7 +15,7 @@ def convert_decimal_prefix(m): class UlozTo(SimpleHoster): __name__ = "UlozTo" __type__ = "hoster" - __version__ = "1.13" + __version__ = "1.14" __status__ = "testing" __pattern__ = r'http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/(?:live/)?(?P<ID>\w+/[^/?]*)' @@ -27,7 +27,7 @@ class UlozTo(SimpleHoster): INFO_PATTERN = r'<p>File <strong>(?P<N>[^<]+)</strong> is password protected</p>' - NAME_PATTERN = r'<title>(?P<N>[^<]+) \| Uloz\.to' + NAME_PATTERN = r'(?P<N>.+?) \|' SIZE_PATTERN = r'<span id="fileSize">.*?(?P<S>[\d.,]+\s[kMG]?B)</span>' OFFLINE_PATTERN = r'<title>404 - Page not found|

File (has been deleted|was banned)

' @@ -68,7 +68,9 @@ class UlozTo(SimpleHoster): #: New version - better to get new parameters (like captcha reload) because of image url - since 6.12.2013 self.log_debug('Using "new" version') - xapca = self.load("http://www.ulozto.net/reloadXapca.php", get={'rnd': str(int(time.time()))}) + xapca = self.load("http://www.ulozto.net/reloadXapca.php", + get={'rnd': str(int(time.time()))}) + xapca = xapca.replace('sound":"', 'sound":"http:').replace('image":"', 'image":"http:') self.log_debug("xapca = " + str(xapca)) data = json_loads(xapca) @@ -121,7 +123,7 @@ class UlozTo(SimpleHoster): def check_file(self): check = self.check_download({ - 'wrong_captcha': re.compile(r'