From 93592862b520a862c01f80c019e5c4bc43746c19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:54:20 +0200 Subject: [SimpleHoster] Better inline docs + changed "FILE_OFFLINE_PATTERN" to "OFFLINE_PATTERN" --- module/plugins/hoster/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index f69283c47..162d0d8a8 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -45,7 +45,7 @@ class XFileSharingPro(SimpleHoster): FILE_NAME_PATTERN = r'[\d\.\,]+) ?(?P\w+)?\)' FILE_INFO_PATTERN = r'Filename:(?P[^<]+)\s*.*?\((?P[^<]+)\)' - FILE_OFFLINE_PATTERN = r'>\w+ (Not Found|file (was|has been) removed)' + OFFLINE_PATTERN = r'>\w+ (Not Found|file (was|has been) removed)' WAIT_PATTERN = r'.*?>(\d+)' #LONG_WAIT_PATTERN = r'(?P\d+(?=\s*hour))?.*?(?P\d+(?=\s*minute))?.*?(?P\d+(?=\s*second))?' -- cgit v1.2.3 From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/hoster/XFileSharingPro.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 162d0d8a8..fb6a912fa 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -42,21 +42,23 @@ class XFileSharingPro(SimpleHoster): __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + FILE_INFO_PATTERN = r'Filename:(?P[^<]+)\s*.*?\((?P[^<]+)\)' FILE_NAME_PATTERN = r'[\d\.\,]+) ?(?P\w+)?\)' - FILE_INFO_PATTERN = r'Filename:(?P[^<]+)\s*.*?\((?P[^<]+)\)' OFFLINE_PATTERN = r'>\w+ (Not Found|file (was|has been) removed)' WAIT_PATTERN = r'.*?>(\d+)' - #LONG_WAIT_PATTERN = r'(?P\d+(?=\s*hour))?.*?(?P\d+(?=\s*minute))?.*?(?P\d+(?=\s*second))?' - OVR_DOWNLOAD_LINK_PATTERN = r'

Download Link

\s*]*>([^<]+)' - OVR_KILL_LINK_PATTERN = r'

Delete Link

\s*]*>([^<]+)' + + OVR_LINK_PATTERN = r'

Download Link

\s*]*>([^<]+)' + CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)' RECAPTCHA_URL_PATTERN = r'http://[^"\']+?recaptcha[^"\']+?\?k=([^"\']+)"' CAPTCHA_DIV_PATTERN = r'>Enter code.*?(.*?)' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' + ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?) Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hoster/XFileSharingPro.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index fb6a912fa..d5d1e6507 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -13,8 +13,6 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, see . -# -# @author: zoidberg ############################################################################### import re -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index d5d1e6507..896858cbc 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -258,7 +258,7 @@ class XFileSharingPro(SimpleHoster): self.logDebug(self.HOSTER_NAME, inputs) - if 'op' in inputs and inputs['op'] in ('download2', 'download3'): + if 'op' in inputs and inputs['op'] in ("download2", "download3"): if "password" in inputs: if self.passwords: inputs['password'] = self.passwords.pop(0) -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/hoster/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 896858cbc..d945ea758 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -159,7 +159,7 @@ class XFileSharingPro(SimpleHoster): def handlePremium(self): self.html = self.load(self.pyfile.url, post=self.getPostParameters()) found = re.search(self.LINK_PATTERN, self.html) - if not found: + if found is None: self.parseError('DIRECT LINK') self.startDownload(found.group(1)) @@ -191,7 +191,7 @@ class XFileSharingPro(SimpleHoster): #get easybytez.com link for uploaded file found = re.search(self.OVR_LINK_PATTERN, self.html) - if not found: + if found is None: self.parseError('DIRECT LINK (OVR)') self.pyfile.url = found.group(1) header = self.load(self.pyfile.url, just_header=True) -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hoster/XFileSharingPro.py | 64 ++++++++++++++++---------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index d945ea758..7ad2d27c0 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -119,9 +119,9 @@ class XFileSharingPro(SimpleHoster): self.req.http.c.setopt(FOLLOWLOCATION, 1) location = None - found = re.search(r"Location\s*:\s*(.*)", self.header, re.I) - if found and re.match(self.LINK_PATTERN, found.group(1)): - location = found.group(1).strip() + m = re.search(r"Location\s*:\s*(.*)", self.header, re.I) + if m and re.match(self.LINK_PATTERN, m.group(1)): + location = m.group(1).strip() return location @@ -140,12 +140,12 @@ class XFileSharingPro(SimpleHoster): self.header = self.req.http.header self.req.http.c.setopt(FOLLOWLOCATION, 1) - found = re.search(r"Location\s*:\s*(.*)", self.header, re.I) - if found: + m = re.search(r"Location\s*:\s*(.*)", self.header, re.I) + if m: break - found = re.search(self.LINK_PATTERN, self.html, re.S) - if found: + m = re.search(self.LINK_PATTERN, self.html, re.S) + if m: break else: @@ -154,14 +154,14 @@ class XFileSharingPro(SimpleHoster): else: self.fail("Download link not found") - return found.group(1) + return m.group(1) def handlePremium(self): self.html = self.load(self.pyfile.url, post=self.getPostParameters()) - found = re.search(self.LINK_PATTERN, self.html) - if found is None: + m = re.search(self.LINK_PATTERN, self.html) + if m is None: self.parseError('DIRECT LINK') - self.startDownload(found.group(1)) + self.startDownload(m.group(1)) def handleOverriden(self): #only tested with easybytez.com @@ -190,10 +190,10 @@ class XFileSharingPro(SimpleHoster): self.fail(inputs['st']) #get easybytez.com link for uploaded file - found = re.search(self.OVR_LINK_PATTERN, self.html) - if found is None: + m = re.search(self.OVR_LINK_PATTERN, self.html) + if m is None: self.parseError('DIRECT LINK (OVR)') - self.pyfile.url = found.group(1) + self.pyfile.url = m.group(1) header = self.load(self.pyfile.url, just_header=True) if 'location' in header: # Direct link self.startDownload(self.pyfile.url) @@ -208,9 +208,9 @@ class XFileSharingPro(SimpleHoster): self.download(link, disposition=True) def checkErrors(self): - found = re.search(self.ERROR_PATTERN, self.html) - if found: - self.errmsg = found.group(1) + m = re.search(self.ERROR_PATTERN, self.html) + if m: + self.errmsg = m.group(1) self.logWarning(re.sub(r"<.*?>", " ", self.errmsg)) if 'wait' in self.errmsg: @@ -266,9 +266,9 @@ class XFileSharingPro(SimpleHoster): self.fail("No or invalid passport") if not self.premium: - found = re.search(self.WAIT_PATTERN, self.html) - if found: - wait_time = int(found.group(1)) + 1 + m = re.search(self.WAIT_PATTERN, self.html) + if m: + wait_time = int(m.group(1)) + 1 self.setWait(wait_time, False) else: wait_time = 0 @@ -300,32 +300,32 @@ class XFileSharingPro(SimpleHoster): self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) def handleCaptcha(self, inputs): - found = re.search(self.RECAPTCHA_URL_PATTERN, self.html) - if found: - recaptcha_key = unquote(found.group(1)) + m = re.search(self.RECAPTCHA_URL_PATTERN, self.html) + if m: + recaptcha_key = unquote(m.group(1)) self.logDebug("RECAPTCHA KEY: %s" % recaptcha_key) recaptcha = ReCaptcha(self) inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(recaptcha_key) return 1 else: - found = re.search(self.CAPTCHA_URL_PATTERN, self.html) - if found: - captcha_url = found.group(1) + m = re.search(self.CAPTCHA_URL_PATTERN, self.html) + if m: + captcha_url = m.group(1) inputs['code'] = self.decryptCaptcha(captcha_url) return 2 else: - found = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL) - if found: - captcha_div = found.group(1) + m = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL) + if m: + captcha_div = m.group(1) self.logDebug(captcha_div) numerals = re.findall(r'(\d)', html_unescape(captcha_div)) inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))]) self.logDebug("CAPTCHA", inputs['code'], numerals) return 3 else: - found = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if found: - captcha_key = found.group(1) + m = re.search(self.SOLVEMEDIA_PATTERN, self.html) + if m: + captcha_key = m.group(1) captcha = SolveMedia(self) inputs['adcopy_challenge'], inputs['adcopy_response'] = captcha.challenge(captcha_key) return 4 -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/XFileSharingPro.py | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 7ad2d27c0..32d0272bc 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -1,29 +1,16 @@ # -*- coding: utf-8 -*- -############################################################################### -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, -# or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -############################################################################### - import re + +from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME from random import random from urllib import unquote from urlparse import urlparse -from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError, replace_patterns + +from module.network.RequestFactory import getURL from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError, replace_patterns from module.utils import html_unescape -from module.network.RequestFactory import getURL class XFileSharingPro(SimpleHoster): @@ -34,8 +21,10 @@ class XFileSharingPro(SimpleHoster): """ __name__ = "XFileSharingPro" __type__ = "hoster" - __pattern__ = r'^unmatchable$' __version__ = "0.31" + + __pattern__ = r'^unmatchable$' + __description__ = """XFileSharingPro base hoster plugin""" __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") -- cgit v1.2.3 From b35b8138864bc30a4ebed1a2af199ee8de39671e Mon Sep 17 00:00:00 2001 From: estaban Date: Sat, 30 Aug 2014 00:51:56 +0200 Subject: Fix wait for UptoBox --- module/plugins/hoster/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 32d0272bc..25492fb49 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -21,7 +21,7 @@ class XFileSharingPro(SimpleHoster): """ __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.31" + __version__ = "0.32" __pattern__ = r'^unmatchable$' @@ -204,7 +204,7 @@ class XFileSharingPro(SimpleHoster): if 'wait' in self.errmsg: wait_time = sum([int(v) * {"hour": 3600, "minute": 60, "second": 1}[u] for v, u in - re.findall(r'(\d+)\s*(hour|minute|second)?', self.errmsg)]) + re.findall(r'(\d+)\s*(hour|minute|second)', self.errmsg)]) self.wait(wait_time, True) elif 'captcha' in self.errmsg: self.invalidCaptcha() -- cgit v1.2.3 From df2dcf1ccdbcc5197a224df9946595df907dc749 Mon Sep 17 00:00:00 2001 From: igel-kun Date: Mon, 15 Sep 2014 23:10:37 +0200 Subject: [XFilesharingPro] Embedded urls support --- module/plugins/hoster/XFileSharingPro.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 25492fb49..d7e24e0b0 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -21,7 +21,7 @@ class XFileSharingPro(SimpleHoster): """ __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.32" + __version__ = "0.33" __pattern__ = r'^unmatchable$' @@ -29,6 +29,8 @@ class XFileSharingPro(SimpleHoster): __author_name__ = ("zoidberg", "stickell") __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + + FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files FILE_INFO_PATTERN = r'Filename:(?P[^<]+)\s*.*?\((?P[^<]+)\)' FILE_NAME_PATTERN = r'[\d\.\,]+) ?(?P\w+)?\)' @@ -55,6 +57,7 @@ class XFileSharingPro(SimpleHoster): self.chunkLimit = 1 + def process(self, pyfile): self.prepare() @@ -88,6 +91,7 @@ class XFileSharingPro(SimpleHoster): else: self.handleFree() + def prepare(self): """ Initialize important variables """ if not hasattr(self, "HOSTER_NAME"): @@ -98,6 +102,7 @@ class XFileSharingPro(SimpleHoster): self.captcha = self.errmsg = None self.passwords = self.getPassword().splitlines() + def getDirectDownloadLink(self): """ Get download link for premium users with direct download enabled """ self.req.http.lastURL = self.pyfile.url @@ -114,11 +119,13 @@ class XFileSharingPro(SimpleHoster): return location + def handleFree(self): url = self.getDownloadLink() self.logDebug("Download URL: %s" % url) self.startDownload(url) + def getDownloadLink(self): for i in xrange(5): self.logDebug("Getting download link: #%d" % i) @@ -145,6 +152,7 @@ class XFileSharingPro(SimpleHoster): return m.group(1) + def handlePremium(self): self.html = self.load(self.pyfile.url, post=self.getPostParameters()) m = re.search(self.LINK_PATTERN, self.html) @@ -152,6 +160,7 @@ class XFileSharingPro(SimpleHoster): self.parseError('DIRECT LINK') self.startDownload(m.group(1)) + def handleOverriden(self): #only tested with easybytez.com self.html = self.load("http://www.%s/" % self.HOSTER_NAME) @@ -189,6 +198,7 @@ class XFileSharingPro(SimpleHoster): else: self.retry() + def startDownload(self, link): link = link.strip() if self.captcha: @@ -196,6 +206,7 @@ class XFileSharingPro(SimpleHoster): self.logDebug('DIRECT LINK: %s' % link) self.download(link, disposition=True) + def checkErrors(self): m = re.search(self.ERROR_PATTERN, self.html) if m: @@ -227,6 +238,7 @@ class XFileSharingPro(SimpleHoster): return self.errmsg + def getPostParameters(self): for _ in xrange(3): if not self.errmsg: @@ -288,6 +300,7 @@ class XFileSharingPro(SimpleHoster): else: self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) + def handleCaptcha(self, inputs): m = re.search(self.RECAPTCHA_URL_PATTERN, self.html) if m: -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/hoster/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index d7e24e0b0..e488b256d 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -203,7 +203,7 @@ class XFileSharingPro(SimpleHoster): link = link.strip() if self.captcha: self.correctCaptcha() - self.logDebug('DIRECT LINK: %s' % link) + self.logDebug("DIRECT LINK: %s" % link) self.download(link, disposition=True) -- cgit v1.2.3 From 5e396bcb58a8688e46f663d3a1dfa4d62496bc93 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 17:37:46 +0200 Subject: [FiredriveCom] Fix TEMP_OFFLINE_PATTERN --- module/plugins/hoster/XFileSharingPro.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index e488b256d..18f6ff8bd 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -31,9 +31,11 @@ class XFileSharingPro(SimpleHoster): FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files + FILE_INFO_PATTERN = r'Filename:(?P[^<]+)\s*.*?\((?P[^<]+)\)' FILE_NAME_PATTERN = r'[\d\.\,]+) ?(?P\w+)?\)' + OFFLINE_PATTERN = r'>\w+ (Not Found|file (was|has been) removed)' WAIT_PATTERN = r'.*?>(\d+)' -- cgit v1.2.3 From 8add4efc7dc3eeaa873030930e5bd31d6bdf8126 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 28 Sep 2014 14:57:02 +0200 Subject: [XFileSharingPro] COOKIES preset to english + improved setup routine --- module/plugins/hoster/XFileSharingPro.py | 38 +++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 18f6ff8bd..0c4a7cb97 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -9,7 +9,7 @@ from urlparse import urlparse from module.network.RequestFactory import getURL from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError, replace_patterns +from module.plugins.internal.SimpleHoster import create_getInfo, PluginParseError, replace_patterns, set_cookies, SimpleHoster from module.utils import html_unescape @@ -21,7 +21,7 @@ class XFileSharingPro(SimpleHoster): """ __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.33" + __version__ = "0.34" __pattern__ = r'^unmatchable$' @@ -30,8 +30,12 @@ class XFileSharingPro(SimpleHoster): __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + HOSTER_NAME = None + FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files + COOKIES = [(HOSTER_NAME, "lang", "english")] + FILE_INFO_PATTERN = r'Filename:(?P[^<]+)\s*.*?\((?P[^<]+)\)' FILE_NAME_PATTERN = r'[\d\.\,]+) ?(?P\w+)?\)' @@ -41,6 +45,7 @@ class XFileSharingPro(SimpleHoster): WAIT_PATTERN = r'.*?>(\d+)' OVR_LINK_PATTERN = r'

Download Link

\s*]*>([^<]+)' + LINK_PATTERN = None #: final download url pattern CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)' RECAPTCHA_URL_PATTERN = r'http://[^"\']+?recaptcha[^"\']+?\?k=([^"\']+)"' @@ -51,13 +56,24 @@ class XFileSharingPro(SimpleHoster): def setup(self): + self.chunkLimit = 1 + if self.__name__ == "XFileSharingPro": - self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] self.multiDL = True + self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] + self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() + self.COOKIES = [(self.HOSTER_NAME, "lang", "english")] else: self.resumeDownload = self.multiDL = self.premium + if not self.HOSTER_NAME: + self.fail("Missing HOSTER_NAME") - self.chunkLimit = 1 + if not LINK_PATTERN: + pattr = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+)' + self.LINK_PATTERN = pattr % self.HOSTER_NAME + + if isinstance(self.COOKIES, list): + set_cookies(self.req.cj, self.COOKIES) def process(self, pyfile): @@ -74,8 +90,8 @@ class XFileSharingPro(SimpleHoster): try: # Due to a 0.4.9 core bug self.load would use cookies even if # cookies=False. Workaround using getURL to avoid cookies. - # Can be reverted in 0.5 as the cookies bug has been fixed. - self.html = getURL(pyfile.url, decode=True) + # Can be reverted in 0.4.10 as the cookies bug has been fixed. + self.html = getURL(pyfile.url, decode=True, cookies=self.COOKIES) self.file_info = self.getFileInfo() except PluginParseError: self.file_info = None @@ -96,12 +112,8 @@ class XFileSharingPro(SimpleHoster): def prepare(self): """ Initialize important variables """ - if not hasattr(self, "HOSTER_NAME"): - self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1) - if not hasattr(self, "LINK_PATTERN"): - self.LINK_PATTERN = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+)' % self.HOSTER_NAME - - self.captcha = self.errmsg = None + self.captcha = None + self.errmsg = None self.passwords = self.getPassword().splitlines() @@ -110,7 +122,7 @@ class XFileSharingPro(SimpleHoster): self.req.http.lastURL = self.pyfile.url self.req.http.c.setopt(FOLLOWLOCATION, 0) - self.html = self.load(self.pyfile.url, cookies=True, decode=True) + self.html = self.load(self.pyfile.url, decode=True) self.header = self.req.http.header self.req.http.c.setopt(FOLLOWLOCATION, 1) -- cgit v1.2.3 From 2e4101c6b373867d556a410901efb8c85c56593f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 28 Sep 2014 16:27:29 +0200 Subject: Prepare method improves setup one --- module/plugins/hoster/XFileSharingPro.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 0c4a7cb97..cd53c98b0 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -21,13 +21,13 @@ class XFileSharingPro(SimpleHoster): """ __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.34" + __version__ = "0.35" __pattern__ = r'^unmatchable$' __description__ = """XFileSharingPro base hoster plugin""" - __author_name__ = ("zoidberg", "stickell") - __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") + __author_name__ = ("zoidberg", "stickell", "Walter Purcaro") + __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "vuolter@gmail.com") HOSTER_NAME = None @@ -65,8 +65,12 @@ class XFileSharingPro(SimpleHoster): self.COOKIES = [(self.HOSTER_NAME, "lang", "english")] else: self.resumeDownload = self.multiDL = self.premium - if not self.HOSTER_NAME: - self.fail("Missing HOSTER_NAME") + + + def prepare(self): + """ Initialize important variables """ + if not self.HOSTER_NAME: + self.fail("Missing HOSTER_NAME") if not LINK_PATTERN: pattr = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+)' @@ -75,6 +79,10 @@ class XFileSharingPro(SimpleHoster): if isinstance(self.COOKIES, list): set_cookies(self.req.cj, self.COOKIES) + self.captcha = None + self.errmsg = None + self.passwords = self.getPassword().splitlines() + def process(self, pyfile): self.prepare() @@ -110,13 +118,6 @@ class XFileSharingPro(SimpleHoster): self.handleFree() - def prepare(self): - """ Initialize important variables """ - self.captcha = None - self.errmsg = None - self.passwords = self.getPassword().splitlines() - - def getDirectDownloadLink(self): """ Get download link for premium users with direct download enabled """ self.req.http.lastURL = self.pyfile.url -- cgit v1.2.3 From a59a0d1e2420419fed57ab281d30c6be8d3a9a1e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 28 Sep 2014 19:55:37 +0200 Subject: [XFileSharingPro] Fixed typo --- module/plugins/hoster/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index cd53c98b0..233a1fed3 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -21,7 +21,7 @@ class XFileSharingPro(SimpleHoster): """ __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.35" + __version__ = "0.36" __pattern__ = r'^unmatchable$' @@ -72,7 +72,7 @@ class XFileSharingPro(SimpleHoster): if not self.HOSTER_NAME: self.fail("Missing HOSTER_NAME") - if not LINK_PATTERN: + if not self.LINK_PATTERN: pattr = r'(http://([^/]*?%s|\d+\.\d+\.\d+\.\d+)(:\d+)?(/d/|(?:/files)?/\d+/\w+/)[^"\'<]+)' self.LINK_PATTERN = pattr % self.HOSTER_NAME -- cgit v1.2.3 From e4042057fcc010f4e3bcb60bb4a27b42efacf48b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 08:35:26 +0200 Subject: [XFileSharingPro] Captcha refactoring + pattern improvement --- module/plugins/hoster/XFileSharingPro.py | 73 +++++++++++++++++--------------- 1 file changed, 40 insertions(+), 33 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 233a1fed3..8edfd8988 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -21,7 +21,7 @@ class XFileSharingPro(SimpleHoster): """ __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.36" + __version__ = "0.37" __pattern__ = r'^unmatchable$' @@ -40,7 +40,7 @@ class XFileSharingPro(SimpleHoster): FILE_NAME_PATTERN = r'[\d\.\,]+) ?(?P\w+)?\)' - OFFLINE_PATTERN = r'>\w+ (Not Found|file (was|has been) removed)' + OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' WAIT_PATTERN = r'.*?>(\d+)' @@ -48,11 +48,11 @@ class XFileSharingPro(SimpleHoster): LINK_PATTERN = None #: final download url pattern CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)' - RECAPTCHA_URL_PATTERN = r'http://[^"\']+?recaptcha[^"\']+?\?k=([^"\']+)"' - CAPTCHA_DIV_PATTERN = r'>Enter code.*?(.*?)' - SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' + CAPTCHA_DIV_PATTERN = r'>Enter code.*?(.+?)' + RECAPTCHA_PATTERN = None + SOLVEMEDIA_PATTERN = None - ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.*?)]*>(.+?)(\d)', html_unescape(captcha_div)) - inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))]) - self.logDebug("CAPTCHA", inputs['code'], numerals) - return 3 - else: - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m: - captcha_key = m.group(1) - captcha = SolveMedia(self) - inputs['adcopy_challenge'], inputs['adcopy_response'] = captcha.challenge(captcha_key) - return 4 + + m = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL) + if m: + captcha_div = m.group(1) + self.logDebug(captcha_div) + numerals = re.findall(r'(\d)', html_unescape(captcha_div)) + inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))]) + self.logDebug("CAPTCHA", inputs['code'], numerals) + return 2 + + recaptcha = ReCaptcha(self) + try: + captcha_key = re.search(self.RECAPTCHA_PATTERN, self.html).group(1) + except: + captcha_key = recaptcha.detect_key() + + if captcha_key: + self.logDebug("RECAPTCHA KEY: %s" % captcha_key) + inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) + return 3 + + solvemedia = SolveMedia(self) + try: + captcha_key = re.search(self.SOLVEMEDIA_PATTERN, self.html).group(1) + except: + captcha_key = solvemedia.detect_key() + + if captcha_key: + inputs['adcopy_challenge'], inputs['adcopy_response'] = solvemedia.challenge(captcha_key) + return 4 + return 0 -- cgit v1.2.3 From 6a3a5045ba429d89b795ccc76a145b16c7e83cba Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 09:01:05 +0200 Subject: [XFileSharingPro] TEMP_OFFLINE_PATTERN --- module/plugins/hoster/XFileSharingPro.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 8edfd8988..c95e52e73 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -41,6 +41,7 @@ class XFileSharingPro(SimpleHoster): FILE_SIZE_PATTERN = r'You have requested .*\((?P[\d\.\,]+) ?(?P\w+)?\)' OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' + TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' WAIT_PATTERN = r'.*?>(\d+)' -- cgit v1.2.3 From 0d4b92d58e6d4e959aeaa780cf29b8d88f46610a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 3 Oct 2014 14:00:46 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/XFileSharingPro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index c95e52e73..18e0920fc 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -173,7 +173,7 @@ class XFileSharingPro(SimpleHoster): self.html = self.load(self.pyfile.url, post=self.getPostParameters()) m = re.search(self.LINK_PATTERN, self.html) if m is None: - self.parseError('DIRECT LINK') + self.parseError('LINK_PATTERN not found') self.startDownload(m.group(1)) @@ -194,7 +194,7 @@ class XFileSharingPro(SimpleHoster): action, inputs = self.parseHtmlForm('F1') if not inputs: - self.parseError('TEXTAREA') + self.parseError('TEXTAREA not found') self.logDebug(self.HOSTER_NAME, inputs) if inputs['st'] == 'OK': self.html = self.load(action, post=inputs) @@ -206,7 +206,7 @@ class XFileSharingPro(SimpleHoster): #get easybytez.com link for uploaded file m = re.search(self.OVR_LINK_PATTERN, self.html) if m is None: - self.parseError('DIRECT LINK (OVR)') + self.parseError('OVR_LINK_PATTERN not found') self.pyfile.url = m.group(1) header = self.load(self.pyfile.url, just_header=True) if 'location' in header: # Direct link -- cgit v1.2.3 From 675dec650ee14137d9e613dcb780776257568654 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 13:11:04 +0200 Subject: [XFileSharingPro] Code cosmetics --- module/plugins/hoster/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 18e0920fc..6d97cf6ca 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -242,7 +242,7 @@ class XFileSharingPro(SimpleHoster): self.retry(25) elif 'countdown' in self.errmsg or 'Expired' in self.errmsg: self.retry() - elif 'maintenance' in self.errmsg: + elif 'maintenance' in self.errmsg or 'maintainance' in self.errmsg: self.tempOffline() elif 'download files up to' in self.errmsg: self.fail("File too large for free download") -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hoster/XFileSharingPro.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 6d97cf6ca..d9f311fa1 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -26,8 +26,9 @@ class XFileSharingPro(SimpleHoster): __pattern__ = r'^unmatchable$' __description__ = """XFileSharingPro base hoster plugin""" - __author_name__ = ("zoidberg", "stickell", "Walter Purcaro") - __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "vuolter@gmail.com") + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] HOSTER_NAME = None -- cgit v1.2.3 From b7bc4c7a920cb6e768948d8489af40bf36a72810 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 16:04:14 +0200 Subject: [XFileSharingPro] Rename to XFSPHoster --- module/plugins/hoster/XFileSharingPro.py | 361 ------------------------------- 1 file changed, 361 deletions(-) delete mode 100644 module/plugins/hoster/XFileSharingPro.py (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py deleted file mode 100644 index d9f311fa1..000000000 --- a/module/plugins/hoster/XFileSharingPro.py +++ /dev/null @@ -1,361 +0,0 @@ -# -*- coding: utf-8 -*- - -import re - -from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME -from random import random -from urllib import unquote -from urlparse import urlparse - -from module.network.RequestFactory import getURL -from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia -from module.plugins.internal.SimpleHoster import create_getInfo, PluginParseError, replace_patterns, set_cookies, SimpleHoster -from module.utils import html_unescape - - -class XFileSharingPro(SimpleHoster): - """ - Common base for XFileSharingPro hosters like EasybytezCom, CramitIn, FiledinoCom... - Some hosters may work straight away when added to __pattern__ - However, most of them will NOT work because they are either down or running a customized version - """ - __name__ = "XFileSharingPro" - __type__ = "hoster" - __version__ = "0.37" - - __pattern__ = r'^unmatchable$' - - __description__ = """XFileSharingPro base hoster plugin""" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it"), - ("Walter Purcaro", "vuolter@gmail.com")] - - - HOSTER_NAME = None - - FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files - - COOKIES = [(HOSTER_NAME, "lang", "english")] - - FILE_INFO_PATTERN = r'Filename:(?P[^<]+)\s*.*?\((?P[^<]+)\)' - FILE_NAME_PATTERN = r'[\d\.\,]+) ?(?P\w+)?\)' - - OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' - TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' - - WAIT_PATTERN = r'.*?>(\d+)' - - OVR_LINK_PATTERN = r'

Download Link

\s*]*>([^<]+)' - LINK_PATTERN = None #: final download url pattern - - CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)' - CAPTCHA_DIV_PATTERN = r'>Enter code.*?(.+?)' - RECAPTCHA_PATTERN = None - SOLVEMEDIA_PATTERN = None - - ERROR_PATTERN = r'class=["\']err["\'][^>]*>(.+?)", " ", self.errmsg)) - - if 'wait' in self.errmsg: - wait_time = sum([int(v) * {"hour": 3600, "minute": 60, "second": 1}[u] for v, u in - re.findall(r'(\d+)\s*(hour|minute|second)', self.errmsg)]) - self.wait(wait_time, True) - elif 'captcha' in self.errmsg: - self.invalidCaptcha() - elif 'premium' in self.errmsg and 'require' in self.errmsg: - self.fail("File can be downloaded by premium users only") - elif 'limit' in self.errmsg: - self.wait(1 * 60 * 60, True) - self.retry(25) - elif 'countdown' in self.errmsg or 'Expired' in self.errmsg: - self.retry() - elif 'maintenance' in self.errmsg or 'maintainance' in self.errmsg: - self.tempOffline() - elif 'download files up to' in self.errmsg: - self.fail("File too large for free download") - else: - self.fail(self.errmsg) - - else: - self.errmsg = None - - return self.errmsg - - - def getPostParameters(self): - for _ in xrange(3): - if not self.errmsg: - self.checkErrors() - - if hasattr(self, "FORM_PATTERN"): - action, inputs = self.parseHtmlForm(self.FORM_PATTERN) - else: - action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) - - if not inputs: - action, inputs = self.parseHtmlForm('F1') - if not inputs: - if self.errmsg: - self.retry() - else: - self.parseError("Form not found") - - self.logDebug(self.HOSTER_NAME, inputs) - - if 'op' in inputs and inputs['op'] in ("download2", "download3"): - if "password" in inputs: - if self.passwords: - inputs['password'] = self.passwords.pop(0) - else: - self.fail("No or invalid passport") - - if not self.premium: - m = re.search(self.WAIT_PATTERN, self.html) - if m: - wait_time = int(m.group(1)) + 1 - self.setWait(wait_time, False) - else: - wait_time = 0 - - self.captcha = self.handleCaptcha(inputs) - - if wait_time: - self.wait() - - self.errmsg = None - return inputs - - else: - inputs['referer'] = self.pyfile.url - - if self.premium: - inputs['method_premium'] = "Premium Download" - if 'method_free' in inputs: - del inputs['method_free'] - else: - inputs['method_free'] = "Free Download" - if 'method_premium' in inputs: - del inputs['method_premium'] - - self.html = self.load(self.pyfile.url, post=inputs, ref=True) - self.errmsg = None - - else: - self.parseError('FORM: %s' % (inputs['op'] if 'op' in inputs else 'UNKNOWN')) - - - def handleCaptcha(self, inputs): - m = re.search(self.CAPTCHA_URL_PATTERN, self.html) - if m: - captcha_url = m.group(1) - inputs['code'] = self.decryptCaptcha(captcha_url) - return 1 - - m = re.search(self.CAPTCHA_DIV_PATTERN, self.html, re.DOTALL) - if m: - captcha_div = m.group(1) - self.logDebug(captcha_div) - numerals = re.findall(r'(\d)', html_unescape(captcha_div)) - inputs['code'] = "".join([a[1] for a in sorted(numerals, key=lambda num: int(num[0]))]) - self.logDebug("CAPTCHA", inputs['code'], numerals) - return 2 - - recaptcha = ReCaptcha(self) - try: - captcha_key = re.search(self.RECAPTCHA_PATTERN, self.html).group(1) - except: - captcha_key = recaptcha.detect_key() - - if captcha_key: - self.logDebug("RECAPTCHA KEY: %s" % captcha_key) - inputs['recaptcha_challenge_field'], inputs['recaptcha_response_field'] = recaptcha.challenge(captcha_key) - return 3 - - solvemedia = SolveMedia(self) - try: - captcha_key = re.search(self.SOLVEMEDIA_PATTERN, self.html).group(1) - except: - captcha_key = solvemedia.detect_key() - - if captcha_key: - inputs['adcopy_challenge'], inputs['adcopy_response'] = solvemedia.challenge(captcha_key) - return 4 - - return 0 - - -getInfo = create_getInfo(XFileSharingPro) -- cgit v1.2.3 From 1c4bd7a76450052b28dba609c04c5c4fcad0d014 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 16:34:26 +0200 Subject: [XFileSharingPro] Restore --- module/plugins/hoster/XFileSharingPro.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 module/plugins/hoster/XFileSharingPro.py (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py new file mode 100644 index 000000000..9c46e8120 --- /dev/null +++ b/module/plugins/hoster/XFileSharingPro.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +import re + +from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo + + +class XFileSharingPro(XFSPHoster): + __name__ = "XFileSharingPro" + __type__ = "hoster" + __version__ = "0.38" + + __pattern__ = r'^unmatchable$' + + __description__ = """XFileSharingPro dummy hoster plugin for hook""" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files + + + def setup(self): + self.chunkLimit = 1 + self.multiDL = True + + self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] + self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() + + +getInfo = create_getInfo(XFileSharingPro) -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hoster/XFileSharingPro.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 9c46e8120..e670dc5af 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -13,6 +13,7 @@ class XFileSharingPro(XFSPHoster): __pattern__ = r'^unmatchable$' __description__ = """XFileSharingPro dummy hoster plugin for hook""" + __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] -- cgit v1.2.3 From a0c5df1aca6bfb58120044079a3fdde560612a1e Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Oct 2014 15:25:43 +0200 Subject: [XFileSharingPro][XFileSharingProFolder] Account pairing routine --- module/plugins/hoster/XFileSharingPro.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index e670dc5af..4eb6e95d3 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo class XFileSharingPro(XFSPHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.38" + __version__ = "0.39" __pattern__ = r'^unmatchable$' @@ -20,12 +20,23 @@ class XFileSharingPro(XFSPHoster): FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files + def init(self): + self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] + self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() + + account_name = "".join([str.capitalize() for str in self.HOSTER_NAME.split('.')]) + self.account = self.core.accountManager.getAccountPlugin(account_name) + + if self.account and self.account.canUse(): + self.user, data = self.account.selectAccount() + self.req = self.account.getAccountRequest(self.user) + self.premium = self.account.isPremium(self.user) + + def setup(self): self.chunkLimit = 1 + self.resumeDownload = self.premium self.multiDL = True - self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] - self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() - getInfo = create_getInfo(XFileSharingPro) -- cgit v1.2.3 From 8edb5481e04da44a227e18c76fc4073297721f4f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Oct 2014 16:29:41 +0200 Subject: [XFileSharingPro] Fixes --- module/plugins/hoster/XFileSharingPro.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 4eb6e95d3..fc348c90f 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -25,12 +25,16 @@ class XFileSharingPro(XFSPHoster): self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() account_name = "".join([str.capitalize() for str in self.HOSTER_NAME.split('.')]) - self.account = self.core.accountManager.getAccountPlugin(account_name) + account = self.core.accountManager.getAccountPlugin(account_name) - if self.account and self.account.canUse(): - self.user, data = self.account.selectAccount() - self.req = self.account.getAccountRequest(self.user) - self.premium = self.account.isPremium(self.user) + if account and account.canUse(): + self.user, data = account.selectAccount() + self.req = account.getAccountRequest(self.user) + self.premium = account.isPremium(self.user) + + self.account = account + else: + self.account.HOSTER_NAME = self.HOSTER_NAME def setup(self): -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hoster/XFileSharingPro.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index fc348c90f..562a0f1f5 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -6,15 +6,15 @@ from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo class XFileSharingPro(XFSPHoster): - __name__ = "XFileSharingPro" - __type__ = "hoster" + __name__ = "XFileSharingPro" + __type__ = "hoster" __version__ = "0.39" __pattern__ = r'^unmatchable$' __description__ = """XFileSharingPro dummy hoster plugin for hook""" - __license__ = "GPLv3" - __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files -- cgit v1.2.3 From 2719f47c583056d108129642e84cd943a2889a3b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 30 Oct 2014 17:18:31 +0100 Subject: [XFileSharingPro] Fix hoster pairing with account --- module/plugins/hoster/XFileSharingPro.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 562a0f1f5..0ac2e97bd 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo class XFileSharingPro(XFSPHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.39" + __version__ = "0.40" __pattern__ = r'^unmatchable$' @@ -21,6 +21,8 @@ class XFileSharingPro(XFSPHoster): def init(self): + self.file_info = {} + self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() @@ -28,13 +30,15 @@ class XFileSharingPro(XFSPHoster): account = self.core.accountManager.getAccountPlugin(account_name) if account and account.canUse(): - self.user, data = account.selectAccount() - self.req = account.getAccountRequest(self.user) - self.premium = account.isPremium(self.user) - self.account = account - else: + elif self.account: self.account.HOSTER_NAME = self.HOSTER_NAME + else: + return + + self.user, data = self.account.selectAccount() + self.req = self.account.getAccountRequest(self.user) + self.premium = self.account.isPremium(self.user) def setup(self): -- cgit v1.2.3 From a98047d04df2790e63f5f5e6c1068821da1f36ae Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Nov 2014 22:42:58 +0100 Subject: [XFileSharingPro] Fix hoster and crypter plugins --- module/plugins/hoster/XFileSharingPro.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 0ac2e97bd..060f05992 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -2,13 +2,13 @@ import re -from module.plugins.internal.XFSPHoster import XFSPHoster, create_getInfo +from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo -class XFileSharingPro(XFSPHoster): +class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.40" + __version__ = "0.41" __pattern__ = r'^unmatchable$' @@ -17,22 +17,29 @@ class XFileSharingPro(XFSPHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - FILE_URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files + URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files + + + def _log(self, type, args): + msg = " | ".join([str(a).strip() for a in args if a]) + logger = getattr(self.log, type) + logger("%s: %s: %s" % (self.__name__, self.HOSTER_NAME, msg or _("%s MARK" % type.upper()))) def init(self): - self.file_info = {} + super(XFileSharingPro, self).init() self.__pattern__ = self.core.pluginManager.hosterPlugins[self.__name__]['pattern'] - self.HOSTER_NAME = re.match(self.__pattern__, self.pyfile.url).group(1).lower() - account_name = "".join([str.capitalize() for str in self.HOSTER_NAME.split('.')]) - account = self.core.accountManager.getAccountPlugin(account_name) + self.HOSTER_DOMAIN = re.match(self.__pattern__, self.pyfile.url).group(1).lower() + self.HOSTER_NAME = "".join([str.capitalize() for str in self.HOSTER_DOMAIN.split('.')]) + + account = self.core.accountManager.getAccountPlugin(self.HOSTER_NAME) if account and account.canUse(): self.account = account elif self.account: - self.account.HOSTER_NAME = self.HOSTER_NAME + self.account.HOSTER_DOMAIN = self.HOSTER_DOMAIN else: return -- cgit v1.2.3 From f74309f89923317eeaaca31d74dff10590ed3d40 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 4 Nov 2014 23:42:46 +0100 Subject: [XFSHoster] Use URL_REPLACEMENTS to clean url --- module/plugins/hoster/XFileSharingPro.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index 060f05992..c3f8b6f41 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.41" + __version__ = "0.42" __pattern__ = r'^unmatchable$' @@ -17,9 +17,6 @@ class XFileSharingPro(XFSHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - URL_REPLACEMENTS = [(r'/embed-(\w{12}).*', r'/\1')] #: support embedded files - - def _log(self, type, args): msg = " | ".join([str(a).strip() for a in args if a]) logger = getattr(self.log, type) -- cgit v1.2.3 From b5a88f7283fbf3c6177ca4d87e27accc893ea0a8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 23 Nov 2014 05:56:48 +0100 Subject: Fix URL_REPLACEMENTS in XFSHoster plugins --- module/plugins/hoster/XFileSharingPro.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/XFileSharingPro.py') diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py index c3f8b6f41..0acad3dba 100644 --- a/module/plugins/hoster/XFileSharingPro.py +++ b/module/plugins/hoster/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" - __version__ = "0.42" + __version__ = "0.43" __pattern__ = r'^unmatchable$' @@ -17,6 +17,9 @@ class XFileSharingPro(XFSHoster): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + URL_REPLACEMENTS = [("/embed-", "/")] + + def _log(self, type, args): msg = " | ".join([str(a).strip() for a in args if a]) logger = getattr(self.log, type) -- cgit v1.2.3