summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-08-13 20:53:46 +0200
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-08-13 20:53:46 +0200
commitb6a56f0f36c7b4d6a1582a072430b35848315fee (patch)
tree9cb36e5ae66f8ab110ce8ad15b666acc2ccbcc2f /module/plugins
parentupdate depositfiles, easybytes, add ryushare (diff)
downloadpyload-b6a56f0f36c7b4d6a1582a072430b35848315fee.tar.xz
update multishare account, xfilesharingpro
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/accounts/MultishareCz.py4
-rw-r--r--module/plugins/crypter/EmbeduploadCom.py17
-rw-r--r--module/plugins/hoster/EasybytezCom.py15
-rw-r--r--module/plugins/hoster/XFileSharingPro.py35
-rw-r--r--module/plugins/internal/XFSPAccount.py6
5 files changed, 50 insertions, 27 deletions
diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py
index cc3e430af..39439cbbe 100644
--- a/module/plugins/accounts/MultishareCz.py
+++ b/module/plugins/accounts/MultishareCz.py
@@ -25,7 +25,7 @@ from module.utils import parseFileSize
class MultishareCz(Account):
__name__ = "MultishareCz"
- __version__ = "0.01"
+ __version__ = "0.02"
__type__ = "account"
__description__ = """multishare.cz account plugin"""
__author_name__ = ("zoidberg")
@@ -54,5 +54,5 @@ class MultishareCz(Account):
"jmeno": user
}, decode = True)
- if not u'<title>MultiShare.cz :: Profil uživatele</title>' in html:
+ if '<div class="akce-chyba akce">' in html:
self.wrongPassword() \ No newline at end of file
diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py
index e84a06cc1..8fd70882f 100644
--- a/module/plugins/crypter/EmbeduploadCom.py
+++ b/module/plugins/crypter/EmbeduploadCom.py
@@ -2,12 +2,13 @@
import re
from module.plugins.Crypter import Crypter
+from module.network.HTTPRequest import BadHeader
class EmbeduploadCom(Crypter):
__name__ = "EmbeduploadCom"
__type__ = "crypter"
__pattern__ = r"http://(www\.)?embedupload.com/\?d=.*"
- __version__ = "0.01"
+ __version__ = "0.02"
__description__ = """EmbedUpload.com crypter"""
__config__ = [("preferedHoster", "str", "Prefered hoster list (bar-separated) ", "embedupload"),
("ignoredHoster", "str", "Ignored hoster list (bar-separated) ", "")]
@@ -18,7 +19,8 @@ class EmbeduploadCom(Crypter):
def decrypt(self, pyfile):
self.html = self.load(self.pyfile.url, decode=True)
- tmp_links = new_links = []
+ tmp_links = []
+ new_links = []
found = re.findall(self.LINK_PATTERN, self.html)
if found:
@@ -32,7 +34,7 @@ class EmbeduploadCom(Crypter):
ignored_set = set(self.getConfig("ignoredHoster").split('|'))
ignored_set = map(lambda s: s.lower().split('.')[0], ignored_set)
print "IG", ignored_set
- tmp_links.extend([x[1] for x in found if x[0] in ignored_set])
+ tmp_links.extend([x[1] for x in found if x[0] not in ignored_set])
self.getLocation(tmp_links, new_links)
if new_links:
@@ -42,8 +44,11 @@ class EmbeduploadCom(Crypter):
def getLocation(self, tmp_links, new_links):
for link in tmp_links:
- header = self.load(link, just_header = True)
- if "location" in header:
- new_links.append(header['location'])
+ try:
+ header = self.load(link, just_header = True)
+ if "location" in header:
+ new_links.append(header['location'])
+ except BadHeader:
+ pass
\ No newline at end of file
diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py
index d69b9bfa5..5f3159b20 100644
--- a/module/plugins/hoster/EasybytezCom.py
+++ b/module/plugins/hoster/EasybytezCom.py
@@ -18,20 +18,22 @@
import re
from random import random
+from pycurl import LOW_SPEED_TIME
from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo
class EasybytezCom(XFileSharingPro):
__name__ = "EasybytezCom"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w+).*"
- __version__ = "0.10"
+ __version__ = "0.11"
__description__ = """easybytez.com"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
FILE_NAME_PATTERN = r'<input type="hidden" name="fname" value="(?P<N>[^"]+)"'
FILE_SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[^<]+)\)</font>'
- FILE_INFO_PATTERN = r'<tr><td align=right><b>Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>\s*.*?<small>\((?P<S>[^<]+)\)</small>'
+ FILE_INFO_PATTERN = r'<tr><td align=right><b>Filename:</b></td><td nowrap>(?P<N>[^<]+)</td></tr>\s*.*?<small>\((?P<S>[^<]+)\)</small>'
+ FILE_OFFLINE_PATTERN = r'<h1>File not available</h1>'
DIRECT_LINK_PATTERN = r'(http://(\w+\.easybytez\.com|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)'
OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
@@ -58,6 +60,8 @@ class EasybytezCom(XFileSharingPro):
inputs['up1oad_type'] = 'url'
self.logDebug(action, inputs)
+ #wait for file to upload to easybytez.com
+ self.req.http.c.setopt(LOW_SPEED_TIME, 600)
self.html = self.load(action, post = inputs)
action, inputs = self.parseHtmlForm('F1')
@@ -65,9 +69,12 @@ class EasybytezCom(XFileSharingPro):
self.logDebug(inputs)
if inputs['st'] == 'OK':
self.html = self.load(action, post = inputs)
+ elif inputs['st'] == 'Can not leech file':
+ self.retry(max_tries=20, wait_time=180, reason=inputs['st'])
else:
- self.fail(inputs['st'])
-
+ self.fail(inputs['st'])
+
+ #get easybytez.com link for uploaded file
found = re.search(self.OVR_DOWNLOAD_LINK_PATTERN, self.html)
if not found: self.parseError('DIRECT LINK (OVR)')
self.pyfile.url = found.group(1)
diff --git a/module/plugins/hoster/XFileSharingPro.py b/module/plugins/hoster/XFileSharingPro.py
index ad96cc3b0..63e79e0b3 100644
--- a/module/plugins/hoster/XFileSharingPro.py
+++ b/module/plugins/hoster/XFileSharingPro.py
@@ -20,8 +20,8 @@ import re
from random import random
from urllib import unquote
from urlparse import urlparse
-from pycurl import FOLLOWLOCATION
-from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError
from module.plugins.ReCaptcha import ReCaptcha
from module.utils import html_unescape
@@ -34,7 +34,7 @@ class XFileSharingPro(SimpleHoster):
__name__ = "XFileSharingPro"
__type__ = "hoster"
__pattern__ = r"^unmatchable$"
- __version__ = "0.07"
+ __version__ = "0.08"
__description__ = """XFileSharingPro common hoster base"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -45,6 +45,7 @@ class XFileSharingPro(SimpleHoster):
FILE_OFFLINE_PATTERN = r'<(b|h2)>File Not Found</(b|h2)>'
WAIT_PATTERN = r'<span id="countdown_str">.*?>(\d+)</span>'
+ LONG_WAIT_PATTERN = r'(?P<H>\d+(?=\s*hour))?.*?(?P<M>\d+(?=\s*minute))?.*?(?P<S>\d+(?=\s*second))?'
OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
OVR_KILL_LINK_PATTERN = r'<h2>Delete Link</h2>\s*<textarea[^>]*>([^<]+)'
CAPTCHA_URL_PATTERN = r'(http://[^"\']+?/captchas?/[^"\']+)'
@@ -72,7 +73,7 @@ class XFileSharingPro(SimpleHoster):
self.html = self.load(pyfile.url, cookies = False, decode = True)
try:
self.file_info = self.getFileInfo()
- except:
+ except PluginParseError:
pyfile.name = html_unescape(unquote(urlparse(pyfile.url).path.split("/")[-1]))
self.header = self.load(self.pyfile.url, just_header = True, cookies = True)
@@ -116,9 +117,10 @@ class XFileSharingPro(SimpleHoster):
found = re.search(self.DIRECT_LINK_PATTERN, self.html)
if not found: self.parseError('DIRECT LINK')
self.startDownload(found.group(1))
-
+
def handleOverriden(self):
- self.html = self.load("http://www.%s" % self.HOSTER_NAME)
+ #only tested with easybytez.com
+ self.html = self.load("http://www.%s/" % self.HOSTER_NAME)
action, inputs = self.parseHtmlForm('')
upload_id = "%012d" % int(random()*10**12)
action += upload_id + "&js_on=1&utype=prem&upload_type=url"
@@ -127,16 +129,21 @@ class XFileSharingPro(SimpleHoster):
inputs['up1oad_type'] = 'url'
self.logDebug(action, inputs)
+ #wait for file to upload to easybytez.com
+ self.req.http.c.setopt(LOW_SPEED_TIME, 600)
self.html = self.load(action, post = inputs)
- action, inputs = self.parseHtmlForm('name="F1"')
- if not inputs: parseError('TEXTAREA')
+ action, inputs = self.parseHtmlForm('F1')
+ if not inputs: self.parseError('TEXTAREA')
self.logDebug(inputs)
if inputs['st'] == 'OK':
self.html = self.load(action, post = inputs)
+ elif inputs['st'] == 'Can not leech file':
+ self.retry(max_tries=20, wait_time=180, reason=inputs['st'])
else:
- self.fail(inputs['st'])
-
+ self.fail(inputs['st'])
+
+ #get easybytez.com link for uploaded file
found = re.search(self.OVR_DOWNLOAD_LINK_PATTERN, self.html)
if not found: self.parseError('DIRECT LINK (OVR)')
self.pyfile.url = found.group(1)
@@ -151,12 +158,16 @@ class XFileSharingPro(SimpleHoster):
found = re.search(self.ERROR_PATTERN, self.html)
if found:
self.errmsg = found.group(1)
- self.logWarning(re.sub(self.errmsg, "<.*?>"," "))
+ self.logWarning(re.sub(r"<.*?>"," ",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('(\d+)\s*(hour|minute|second)?', self.errmsg)])
self.setWait(wait_time, True)
self.wait()
+ elif 'limit' in self.errmsg:
+ self.setWait(3600, True)
+ self.wait()
+ self.retry(25)
elif 'captcha' in self.errmsg:
self.invalidCaptcha()
elif 'countdown' or 'Expired session' in self.errmsg:
@@ -167,6 +178,8 @@ class XFileSharingPro(SimpleHoster):
self.fail("File too large for free download")
elif 'requires premium' in self.errmsg:
self.fail("File can be downloaded by premium users only")
+ else:
+ self.fail(self.errmsg)
else:
self.errmsg = None
diff --git a/module/plugins/internal/XFSPAccount.py b/module/plugins/internal/XFSPAccount.py
index 76bbfb9fe..c41dbb3a9 100644
--- a/module/plugins/internal/XFSPAccount.py
+++ b/module/plugins/internal/XFSPAccount.py
@@ -25,7 +25,7 @@ from module.utils import parseFileSize
class XFSPAccount(Account):
__name__ = "XFSPAccount"
- __version__ = "0.03"
+ __version__ = "0.04"
__type__ = "account"
__description__ = """XFileSharingPro account base"""
__author_name__ = ("zoidberg")
@@ -66,8 +66,6 @@ class XFSPAccount(Account):
html = req.load('%slogin.html' % self.MAIN_PAGE, decode = True)
action, inputs = parseHtmlForm('name="FL"', html)
- if not action:
- action = self.MAIN_PAGE
if not inputs:
inputs = {"op": "login",
"redirect": self.MAIN_PAGE}
@@ -75,7 +73,7 @@ class XFSPAccount(Account):
inputs.update({"login": user,
"password": data['password']})
- html = req.load(action, post = inputs, decode = True)
+ html = req.load(self.MAIN_PAGE, post = inputs, decode = True)
if 'Incorrect Login or Password' in html or '>Error<' in html:
self.wrongPassword() \ No newline at end of file