diff options
Diffstat (limited to 'module/plugins')
23 files changed, 49 insertions, 48 deletions
diff --git a/module/plugins/accounts/EuroshareEu.py b/module/plugins/accounts/EuroshareEu.py index 09f08dc01..e5a05cd7f 100644 --- a/module/plugins/accounts/EuroshareEu.py +++ b/module/plugins/accounts/EuroshareEu.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account class EuroshareEu(Account): __name__ = "EuroshareEu" __type__ = "account" - __version__ = "0.06" + __version__ = "0.07" __status__ = "testing" __description__ = """Euroshare.eu account plugin""" @@ -18,7 +18,6 @@ class EuroshareEu(Account): def grab_info(self, user, password, data): - self.relogin(user) html = self.load("http://euroshare.eu/customer-zone/settings/") m = re.search('id="input_expire_date" value="(\d+\.\d+\.\d+ \d+:\d+)"', html) diff --git a/module/plugins/accounts/HellshareCz.py b/module/plugins/accounts/HellshareCz.py index cdfa9937a..a552a03b6 100644 --- a/module/plugins/accounts/HellshareCz.py +++ b/module/plugins/accounts/HellshareCz.py @@ -9,7 +9,7 @@ from module.plugins.internal.Account import Account class HellshareCz(Account): __name__ = "HellshareCz" __type__ = "account" - __version__ = "0.21" + __version__ = "0.22" __status__ = "testing" __description__ = """Hellshare.cz account plugin""" @@ -21,7 +21,6 @@ class HellshareCz(Account): def grab_info(self, user, password, data): - self.relogin(user) html = self.load("http://www.hellshare.com/") m = re.search(self.CREDIT_LEFT_PATTERN, html) diff --git a/module/plugins/accounts/MegasharesCom.py b/module/plugins/accounts/MegasharesCom.py index 6967a7502..ee9be072b 100644 --- a/module/plugins/accounts/MegasharesCom.py +++ b/module/plugins/accounts/MegasharesCom.py @@ -21,7 +21,6 @@ class MegasharesCom(Account): def grab_info(self, user, password, data): - # self.relogin(user) html = self.load("http://d01.megashares.com/myms.php") premium = False if '>Premium Upgrade<' in html else True diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py index 77facb308..16fa57948 100644 --- a/module/plugins/accounts/MultishareCz.py +++ b/module/plugins/accounts/MultishareCz.py @@ -32,7 +32,6 @@ class MultishareCz(Account): def grab_info(self, user, password, data): - # self.relogin(user) html = self.load("http://www.multishare.cz/profil/") m = re.search(self.TRAFFIC_LEFT_PATTERN, html) diff --git a/module/plugins/accounts/YibaishiwuCom.py b/module/plugins/accounts/YibaishiwuCom.py index ba7454183..695dd79cd 100644 --- a/module/plugins/accounts/YibaishiwuCom.py +++ b/module/plugins/accounts/YibaishiwuCom.py @@ -20,7 +20,6 @@ class YibaishiwuCom(Account): def grab_info(self, user, password, data): - # self.relogin(user) html = self.load("http://115.com/") m = re.search(self.ACCOUNT_INFO_PATTERN, html, re.S) diff --git a/module/plugins/captcha/AdsCaptcha.py b/module/plugins/captcha/AdsCaptcha.py index 613283e53..66f6e2993 100644 --- a/module/plugins/captcha/AdsCaptcha.py +++ b/module/plugins/captcha/AdsCaptcha.py @@ -18,7 +18,7 @@ class AdsCaptcha(CaptchaService): CAPTCHAID_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?.*?CaptchaId=(\d+)' - PUBLICKEY_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?.*?PublicKey=([\w-]+)' + PUBLICKEY_PATTERN = r'api\.adscaptcha\.com/Get\.aspx\?.*?PublicKey=([\w\-]+)' def detect_key(self, data=None): diff --git a/module/plugins/captcha/ReCaptcha.py b/module/plugins/captcha/ReCaptcha.py index a3ac52cb1..379956be6 100644 --- a/module/plugins/captcha/ReCaptcha.py +++ b/module/plugins/captcha/ReCaptcha.py @@ -23,8 +23,8 @@ class ReCaptcha(CaptchaService): ("zapp-brannigan", "fuerst.reinje@web.de")] - KEY_V1_PATTERN = r'(?:recaptcha(?:/api|\.net)/(?:challenge|noscript)\?k=|Recaptcha\.create\s*\(\s*["\'])([\w-]+)' - KEY_V2_PATTERN = r'(?:data-sitekey=["\']|["\']sitekey["\']:\s*["\'])([\w-]+)' + KEY_V1_PATTERN = r'(?:recaptcha(?:/api|\.net)/(?:challenge|noscript)\?k=|Recaptcha\.create\s*\(\s*["\'])([\w\-]+)' + KEY_V2_PATTERN = r'(?:data-sitekey=["\']|["\']sitekey["\']:\s*["\'])([\w\-]+)' def detect_key(self, data=None): diff --git a/module/plugins/captcha/ShareonlineBiz.py b/module/plugins/captcha/ShareonlineBiz.py index edf14df87..19db6c4cd 100644 --- a/module/plugins/captcha/ShareonlineBiz.py +++ b/module/plugins/captcha/ShareonlineBiz.py @@ -14,6 +14,7 @@ class ShareonlineBiz(OCR): __authors__ = [("RaNaN", "RaNaN@pyload.org")] + #: Tesseract at 60% def recognize(self, image): self.load_image(image) self.to_greyscale() @@ -32,5 +33,3 @@ class ShareonlineBiz(OCR): final += self.result_captcha return final - - #: Tesseract at 60% diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index bb9aee1d7..51fdcd30b 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -31,7 +31,7 @@ class FilecryptCc(Crypter): # URL_REPLACEMENTS = [(r'.html$', ""), (r'$', ".html")] #@TODO: Extend SimpleCrypter DLC_LINK_PATTERN = r'onclick="DownloadDLC\(\'(.+)\'\);">' - WEBLINK_PATTERN = r"openLink.?'([\w_-]*)'," + WEBLINK_PATTERN = r"openLink.?'([\w\-]*)'," CAPTCHA_PATTERN = r'class="safety">Sicherheitsabfrage<' INTERNAL_CAPTCHA_PATTERN = r'<img id="nc" src="(.+?)"' diff --git a/module/plugins/crypter/TinyurlCom.py b/module/plugins/crypter/TinyurlCom.py index bff1efa12..2b9a8041f 100644 --- a/module/plugins/crypter/TinyurlCom.py +++ b/module/plugins/crypter/TinyurlCom.py @@ -9,7 +9,7 @@ class TinyurlCom(SimpleCrypter): __version__ = "0.03" __status__ = "testing" - __pattern__ = r'https?://(?:www\.)?(preview\.)?tinyurl\.com/[\w-]+' + __pattern__ = r'https?://(?:www\.)?(preview\.)?tinyurl\.com/[\w\-]+' __description__ = """Tinyurl.com decrypter plugin""" __license__ = "GPLv3" diff --git a/module/plugins/crypter/YoutubeComFolder.py b/module/plugins/crypter/YoutubeComFolder.py index ea09c63f9..302f18ac0 100644 --- a/module/plugins/crypter/YoutubeComFolder.py +++ b/module/plugins/crypter/YoutubeComFolder.py @@ -14,7 +14,7 @@ class YoutubeComFolder(Crypter): __version__ = "1.03" __status__ = "testing" - __pattern__ = r'https?://(?:www\.|m\.)?youtube\.com/(?P<TYPE>user|playlist|view_play_list)(/|.*?[?&](?:list|p)=)(?P<ID>[\w-]+)' + __pattern__ = r'https?://(?:www\.|m\.)?youtube\.com/(?P<TYPE>user|playlist|view_play_list)(/|.*?[?&](?:list|p)=)(?P<ID>[\w\-]+)' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True ), ("subfolder_per_pack", "bool", "Create a subfolder for each package", True ), ("likes" , "bool", "Grab user (channel) liked videos" , False), diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index c752ce6ac..32faebbed 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -11,7 +11,7 @@ from module.utils import fs_encode, save_join as fs_join class ExternalScripts(Addon): __name__ = "ExternalScripts" __type__ = "hook" - __version__ = "0.47" + __version__ = "0.48" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), @@ -118,7 +118,7 @@ class ExternalScripts(Addon): self.info['oldip'] = ip - def after_reconnect(self, ip): + def after_reconnect(self, ip, oldip): lock = self.get_config('lock') for script in self.scripts['after_reconnect']: args = [ip, self.info['oldip']] #@TODO: Use built-in oldip in 0.4.10 diff --git a/module/plugins/hooks/XMPPInterface.py b/module/plugins/hooks/XMPPInterface.py index 77e20cdd4..0f8fb377f 100644 --- a/module/plugins/hooks/XMPPInterface.py +++ b/module/plugins/hooks/XMPPInterface.py @@ -12,7 +12,7 @@ from module.plugins.hooks.IRCInterface import IRCInterface class XMPPInterface(IRCInterface, JabberClient): __name__ = "XMPPInterface" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __status__ = "testing" __config__ = [("jid" , "str" , "Jabber ID" , "user@exmaple-jabber-server.org" ), @@ -218,7 +218,7 @@ class XMPPInterface(IRCInterface, JabberClient): self.disconnect() - def after_reconnect(self, ip): + def after_reconnect(self, ip, oldip): self.connect() diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 42aed2c77..7cc22158d 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -35,7 +35,7 @@ class DateiTo(SimpleHoster): data = {'P': 'I', 'ID': self.info['pattern']['ID']} recaptcha = ReCaptcha(self) - for _i in xrange(10): + for _i in xrange(3): self.log_debug("URL", url, "POST", data) self.html = self.load(url, post=data) self.check_errors() @@ -57,7 +57,7 @@ class DateiTo(SimpleHoster): if url.endswith('recaptcha.php'): data['recaptcha_response_field'], data['recaptcha_challenge_field'] = recaptcha.challenge() else: - self.fail(_("Too bad...")) + return self.link = self.html diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index f92681f60..3301eda7c 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -46,7 +46,7 @@ class LinksnappyCom(MultiHoster): @staticmethod def _get_host(url): host = urlparse.urlsplit(url).netloc - return re.search(r'[\w-]+\.\w+$', host).group(0) + return re.search(r'[\w\-]+\.\w+$', host).group(0) getInfo = create_getInfo(LinksnappyCom) diff --git a/module/plugins/hoster/OpenloadIo.py b/module/plugins/hoster/OpenloadIo.py index 6213a9c09..ee67be95b 100644 --- a/module/plugins/hoster/OpenloadIo.py +++ b/module/plugins/hoster/OpenloadIo.py @@ -10,10 +10,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class OpenloadIo(SimpleHoster): __name__ = "OpenloadIo" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.08" __status__ = "testing" - __pattern__ = r'https?://(?:www\.)?openload\.(?:co|io)/f/([\w-_]+)' + __pattern__ = r'https?://(?:www\.)?openload\.(?:co|io)/(?:f|embed)/([\w\-]+)' __description__ = """Openload.co hoster plugin""" __license__ = "GPLv3" @@ -23,12 +23,14 @@ class OpenloadIo(SimpleHoster): # The API reference, that this implementation uses is available at https://openload.co/api API_URL = 'https://api.openload.co/1' - _FILE_ID_PATTERN = '/f/([\w-_]+)' + _FILE_ID_PATTERN = '/(?:f|embed)/([\w\-]+)' _DOWNLOAD_TICKET_URI_PATTERN = '/file/dlticket?file={0}' _DOWNLOAD_FILE_URI_PATTERN = '/file/dl?file={0}&ticket={1}' _FILE_INFO_URI_PATTERN = '/file/info?file={0}' + OFFLINE_PATTERN = r'>We are sorry' + @classmethod def _load_json(cls, uri): diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 2223068e5..96fec2b48 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ShareonlineBiz(SimpleHoster): __name__ = "ShareonlineBiz" __type__ = "hoster" - __version__ = "0.58" + __version__ = "0.59" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download\.php\?id=|dl/)(?P<ID>\w+)' @@ -45,11 +45,11 @@ class ShareonlineBiz(SimpleHoster): try: if field[1] == "OK": - info['fileid'] = field[0] - info['status'] = 2 - info['name'] = field[2] - info['size'] = field[3] #: In bytes - info['md5'] = field[4].strip().lower().replace("\n\n", "") #: md5 + info['fileid'] = field[0] + info['status'] = 2 + info['name'] = field[2] + info['size'] = field[3] #: In bytes + info['md5'] = field[4].strip().lower().replace("\n\n", "") #: md5 elif field[1] in ("DELETED", "NOTFOUND"): info['status'] = 1 @@ -102,7 +102,7 @@ class ShareonlineBiz(SimpleHoster): def check_download(self): check = self.check_file({'cookie': re.compile(r'<div id="dl_failure"'), - 'fail' : re.compile(r"<title>Share-Online")}) + 'fail' : re.compile(r"<title>Share-Online")}) if check == "cookie": self.retry_captcha(5, 60, _("Cookie failure")) @@ -114,19 +114,23 @@ class ShareonlineBiz(SimpleHoster): def handle_premium(self, pyfile): #: Should be working better loading (account) api internally + self.api_data = dlinfo = {} + html = self.load("https://api.share-online.biz/account.php", get={'username': self.account.user, 'password': self.account.get_login('password'), 'act' : "download", 'lid' : self.info['fileid']}) - self.api_data = dlinfo = {} + self.log_debug(html) for line in html.splitlines(): - key, value = line.split(": ") - dlinfo[key.lower()] = value + try: + key, value = line.split(": ") + dlinfo[key.lower()] = value - self.log_debug(dlinfo) + except ValueError: + pass if dlinfo['status'] != "online": self.offline() diff --git a/module/plugins/hoster/SoundcloudCom.py b/module/plugins/hoster/SoundcloudCom.py index b189ee1ba..a7a45d028 100644 --- a/module/plugins/hoster/SoundcloudCom.py +++ b/module/plugins/hoster/SoundcloudCom.py @@ -12,7 +12,7 @@ class SoundcloudCom(SimpleHoster): __version__ = "0.12" __status__ = "testing" - __pattern__ = r'https?://(?:www\.)?soundcloud\.com/[\w-]+/[\w-]+' + __pattern__ = r'https?://(?:www\.)?soundcloud\.com/[\w\-]+/[\w\-]+' __config__ = [("use_premium", "bool" , "Use premium account if available", True ), ("quality" , "Lower;Higher", "Quality" , "Higher")] diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index cc07770d4..b0df1d97f 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -4,6 +4,7 @@ import re import time from module.common.json_layer import json_loads +from module.plugins.internal.Plugin import timestamp from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -68,13 +69,14 @@ class UlozTo(SimpleHoster): self.log_debug('Using "new" version') xapca = self.load("http://www.ulozto.net/reloadXapca.php", - get={'rnd': str(int(time.time()))}) + get={'rnd': timestamp()}) + xapca = xapca.replace('sound":"', 'sound":"http:').replace('image":"', 'image":"http:') - self.log_debug("xapca = %s" % xapca) + self.log_debug("xapca: %s" % xapca) data = json_loads(xapca) - captcha_value = self.captcha.decrypt(str(data['image'])) - self.log_debug("CAPTCHA HASH: " + data['hash'], "CAPTCHA SALT: " + str(data['salt']), "CAPTCHA VALUE: " + captcha_value) + captcha_value = self.captcha.decrypt(data['image']) + self.log_debug("CAPTCHA HASH: " + data['hash'], "CAPTCHA SALT: %s" % data['salt'], "CAPTCHA VALUE: " + captcha_value) inputs.update({'timestamp': data['timestamp'], 'salt': data['salt'], 'hash': data['hash'], 'captcha_value': captcha_value}) diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index 50006dd27..6af02438f 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -35,7 +35,7 @@ class UnibytesCom(SimpleHoster): self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) - for _i in xrange(8): + for _i in xrange(3): self.log_debug(action, post_data) self.html = self.load(urlparse.urljoin(domain, action), post=post_data) @@ -46,7 +46,7 @@ class UnibytesCom(SimpleHoster): if '>Somebody else is already downloading using your IP-address<' in self.html: self.wait(10 * 60, True) - self.retry() + self.restart(premium=True) if post_data['step'] == "last": m = re.search(self.LINK_FREE_PATTERN, self.html) @@ -67,9 +67,6 @@ class UnibytesCom(SimpleHoster): elif last_step in ("captcha", "last"): post_data['captcha'] = self.captcha.decrypt(urlparse.urljoin(domain, "captcha.jpg")) - else: - self.fail(_("No valid captcha code entered")) - self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index 098143751..4ea286eb8 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -43,6 +43,7 @@ class Xdcc(Hoster): nmn = self.do_download(pyfile.url) self.log_debug("Download of %s finished." % nmn) return + except socket.error, e: if hasattr(e, "errno"): errno = e.errno diff --git a/module/plugins/hoster/YadiSk.py b/module/plugins/hoster/YadiSk.py index 354ba1b4c..418f38926 100644 --- a/module/plugins/hoster/YadiSk.py +++ b/module/plugins/hoster/YadiSk.py @@ -13,7 +13,7 @@ class YadiSk(SimpleHoster): __version__ = "0.06" __status__ = "testing" - __pattern__ = r'https?://yadi\.sk/d/[\w-]+' + __pattern__ = r'https?://yadi\.sk/d/[\w\-]+' __description__ = """Yadi.sk hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/internal/Account.py b/module/plugins/internal/Account.py index ad78403de..f1b85f358 100644 --- a/module/plugins/internal/Account.py +++ b/module/plugins/internal/Account.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import random +import re import time import threading @@ -12,7 +13,7 @@ from module.utils import compare_time, lock class Account(Plugin): __name__ = "Account" __type__ = "account" - __version__ = "0.53" + __version__ = "0.54" __status__ = "testing" __description__ = """Base account plugin""" |