summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-18 18:08:15 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2012-09-18 18:08:15 +0200
commit5ebf3e854216b4b25e273f8873f7203c5a82fadd (patch)
treee2c7c30fdcae6c014c00d2262d89ea606bc83309
parentmerged stable into default (diff)
parentBacked out changeset e7db858d5ab2 (diff)
downloadpyload-5ebf3e854216b4b25e273f8873f7203c5a82fadd.tar.xz
merge newest changes
-rw-r--r--module/plugins/addons/Checksum.py21
-rw-r--r--module/plugins/addons/IRCInterface.py28
-rw-r--r--module/plugins/addons/UnSkipOnFail.py97
-rw-r--r--module/plugins/hoster/BasePlugin.py14
-rw-r--r--module/plugins/hoster/IfolderRu.py33
-rw-r--r--module/plugins/hoster/MediafireCom.py10
-rw-r--r--module/plugins/hoster/NowDownloadEu.py62
-rw-r--r--module/plugins/hoster/OneFichierCom.py13
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py12
-rw-r--r--module/plugins/hoster/ZippyshareCom.py3
-rw-r--r--module/plugins/internal/SimpleHoster.py4
11 files changed, 242 insertions, 55 deletions
diff --git a/module/plugins/addons/Checksum.py b/module/plugins/addons/Checksum.py
index cb6f4bfe8..aec4bd0d7 100644
--- a/module/plugins/addons/Checksum.py
+++ b/module/plugins/addons/Checksum.py
@@ -18,6 +18,7 @@
"""
from __future__ import with_statement
import hashlib, zlib
+from os import remove
from os.path import getsize, isfile
from module.utils import save_join, fs_encode
@@ -49,7 +50,7 @@ def computeChecksum(local_file, algorithm):
class Checksum(Hook):
__name__ = "Checksum"
- __version__ = "0.05"
+ __version__ = "0.06"
__description__ = "Verify downloaded file size and checksum (enable in general preferences)"
__config__ = [("activated", "bool", "Activated", True),
("action", "fail;retry;nothing", "What to do if check fails?", "retry"),
@@ -80,11 +81,15 @@ class Checksum(Hook):
self.logDebug(data)
- download_folder = self.config['general']['download_folder']
- local_file = fs_encode(save_join(download_folder, pyfile.package().folder, pyfile.name))
+ if not pyfile.plugin.lastDownload:
+ self.checkFailed(pyfile, None, "No file downloaded")
+
+ local_file = fs_encode(pyfile.plugin.lastDownload)
+ #download_folder = self.config['general']['download_folder']
+ #local_file = fs_encode(save_join(download_folder, pyfile.package().folder, pyfile.name))
if not isfile(local_file):
- self.checkFailed(pyfile, "File does not exist")
+ self.checkFailed(pyfile, None, "File does not exist")
# validate file size
if "size" in data:
@@ -92,7 +97,7 @@ class Checksum(Hook):
file_size = getsize(local_file)
if api_size != file_size:
self.logWarning("File %s has incorrect size: %d B (%d expected)" % (pyfile.name, file_size, api_size))
- self.checkFailed(pyfile, "Incorrect file size")
+ self.checkFailed(pyfile, local_file, "Incorrect file size")
del data['size']
# validate checksum
@@ -109,15 +114,17 @@ class Checksum(Hook):
return
else:
self.logWarning("%s checksum for file %s does not match (%s != %s)" % (key.upper(), pyfile.name, checksum, data[key]))
- self.checkFailed(pyfile, "Checksums do not match")
+ self.checkFailed(pyfile, local_file, "Checksums do not match")
else:
self.logWarning("Unsupported hashing algorithm: %s" % key.upper())
else:
self.logWarning("Unable to validate checksum for file %s" % (pyfile.name))
- def checkFailed(self, pyfile, msg):
+ def checkFailed(self, pyfile, local_file, msg):
action = self.getConfig("action")
if action == "fail":
pyfile.plugin.fail(reason = msg)
elif action == "retry":
+ if local_file:
+ remove(local_file)
pyfile.plugin.retry(reason = msg, max_tries = self.getConfig("max_tries")) \ No newline at end of file
diff --git a/module/plugins/addons/IRCInterface.py b/module/plugins/addons/IRCInterface.py
index ddaa40613..c261fc6f3 100644
--- a/module/plugins/addons/IRCInterface.py
+++ b/module/plugins/addons/IRCInterface.py
@@ -30,6 +30,7 @@ import re
from module.plugins.Addon import Addon
from module.network.RequestFactory import getURL
from module.utils import formatSize
+from module.Api import PackageDoesNotExists, FileDoesNotExists
from pycurl import FORM_FILE
@@ -236,25 +237,25 @@ class IRCInterface(Thread, Addon):
return lines
def event_queue(self, args):
- ps = self.api.getQueue()
+ ps = self.api.getQueueData()
if not ps:
return ["INFO: There are no packages in queue."]
lines = []
for pack in ps:
- lines.append('PACKAGE #%s: "%s" with %d links.' % (pack.pid, pack.name, len(pack.fids) ))
+ lines.append('PACKAGE #%s: "%s" with %d links.' % (pack.pid, pack.name, len(pack.links) ))
return lines
def event_collector(self, args):
- ps = self.api.getCollector()
+ ps = self.api.getCollectorData()
if not ps:
return ["INFO: No packages in collector!"]
lines = []
for pack in ps:
- lines.append('PACKAGE #%s: "%s" with %d links.' % (pack.pid, pack.name, len(pack.fids) ))
+ lines.append('PACKAGE #%s: "%s" with %d links.' % (pack.pid, pack.name, len(pack.links) ))
return lines
@@ -262,12 +263,14 @@ class IRCInterface(Thread, Addon):
if not args:
return ['ERROR: Use info like this: info <id>']
- info = self.api.getFileData(int(args[0]))
+ info = None
+ try:
+ info = self.api.getFileData(int(args[0]))
- if not info:
+ except FileDoesNotExists:
return ["ERROR: Link doesn't exists."]
- return ['LINK #%s: %s (%s) [%s][%s]' % (info.fid, info.name, info.format_size, info.status_msg,
+ return ['LINK #%s: %s (%s) [%s][%s]' % (info.fid, info.name, info.format_size, info.statusmsg,
info.plugin)]
def event_packinfo(self, args):
@@ -275,9 +278,11 @@ class IRCInterface(Thread, Addon):
return ['ERROR: Use packinfo like this: packinfo <id>']
lines = []
- pack = self.api.getPackageData(int(args[0]))
+ pack = None
+ try:
+ pack = self.api.getPackageData(int(args[0]))
- if not pack:
+ except PackageDoesNotExists:
return ["ERROR: Package doesn't exists."]
id = args[0]
@@ -369,7 +374,9 @@ class IRCInterface(Thread, Addon):
return ["ERROR: Push package to queue like this: push <package id>"]
id = int(args[0])
- if not self.api.getPackage_data(id):
+ try:
+ info = self.api.getPackageInfo(id)
+ except PackageDoesNotExists:
return ["ERROR: Package #%d does not exist." % id]
self.api.pushToQueue(id)
@@ -419,7 +426,6 @@ class IRCInterface(Thread, Addon):
class IRCError(Exception):
def __init__(self, value):
- Exception.__init__(value)
self.value = value
def __str__(self):
return repr(self.value)
diff --git a/module/plugins/addons/UnSkipOnFail.py b/module/plugins/addons/UnSkipOnFail.py
new file mode 100644
index 000000000..4b7a58be8
--- /dev/null
+++ b/module/plugins/addons/UnSkipOnFail.py
@@ -0,0 +1,97 @@
+# -*- 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 <http://www.gnu.org/licenses/>.
+
+ @author: hgg
+"""
+from os.path import basename
+
+from module.utils import fs_encode
+from module.plugins.Hook import Hook
+from module.PyFile import PyFile
+
+class UnSkipOnFail(Hook):
+ __name__ = 'UnSkipOnFail'
+ __version__ = '0.01'
+ __description__ = 'When a download fails, restart "skipped" duplicates.'
+ __config__ = [('activated', 'bool', 'Activated', True),]
+ __author_name__ = ('hagg',)
+ __author_mail__ = ('')
+
+ def downloadFailed(self, pyfile):
+ pyfile_name = basename(pyfile.name)
+ pid = pyfile.package().id
+ msg = 'look for skipped duplicates for %s (pid:%s)...'
+ self.logInfo(msg % (pyfile_name, pid))
+ dups = self.findDuplicates(pyfile)
+ for link in dups:
+ # check if link is "skipped"(=4)
+ if link.status == 4:
+ lpid = link.packageID
+ self.logInfo('restart "%s" (pid:%s)...' % (pyfile_name, lpid))
+ self.setLinkStatus(link, "queued")
+
+ def findDuplicates(self, pyfile):
+ """ Search all packages for duplicate links to "pyfile".
+ Duplicates are links that would overwrite "pyfile".
+ To test on duplicity the package-folder and link-name
+ of twolinks are compared (basename(link.name)).
+ So this method returns a list of all links with equal
+ package-folders and filenames as "pyfile", but except
+ the data for "pyfile" iotselöf.
+ It does MOT check the link's status.
+ """
+ dups = []
+ pyfile_name = fs_encode(basename(pyfile.name))
+ # get packages (w/o files, as most file data is useless here)
+ queue = self.core.api.getQueue()
+ for package in queue:
+ # check if package-folder equals pyfile's package folder
+ if fs_encode(package.folder) == fs_encode(pyfile.package().folder):
+ # now get packaged data w/ files/links
+ pdata = self.core.api.getPackageData(package.pid)
+ if pdata.links:
+ for link in pdata.links:
+ link_name = fs_encode(basename(link.name))
+ # check if link name collides with pdata's name
+ if link_name == pyfile_name:
+ # at last check if it is not pyfile itself
+ if link.fid != pyfile.id:
+ dups.append(link)
+ return dups
+
+ def setLinkStatus(self, link, new_status):
+ """ Change status of "link" to "new_status".
+ "link" has to be a valid FileData object,
+ "new_status" has to be a valid status name
+ (i.e. "queued" for this Plugin)
+ It creates a temporary PyFile object using
+ "link" data, changes its status, and tells
+ the core.files-manager to save its data.
+ """
+ pyfile = PyFile(self.core.files,
+ link.fid,
+ link.url,
+ link.name,
+ link.size,
+ link.status,
+ link.error,
+ link.plugin,
+ link.packageID,
+ link.order)
+ pyfile.setStatus(new_status)
+ self.core.files.save()
+ pyfile.release()
+
diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py
index f1e3006d0..1ac33931f 100644
--- a/module/plugins/hoster/BasePlugin.py
+++ b/module/plugins/hoster/BasePlugin.py
@@ -12,10 +12,10 @@ class BasePlugin(Hoster):
__name__ = "BasePlugin"
__type__ = "hoster"
__pattern__ = r"^unmatchable$"
- __version__ = "0.15"
+ __version__ = "0.151"
__description__ = """Base Plugin when any other didnt fit"""
- __author_name__ = ("RaNaN")
- __author_mail__ = ("RaNaN@pyload.org")
+ __author_name__ = ("RaNaN", 'hagg')
+ __author_mail__ = ("RaNaN@pyload.org", '')
def setup(self):
self.chunkLimit = -1
@@ -54,6 +54,8 @@ class BasePlugin(Hoster):
self.req.addAuth(pwd)
self.downloadFile(pyfile)
+ elif e.code == 404:
+ self.offline()
else:
raise
@@ -65,6 +67,10 @@ class BasePlugin(Hoster):
header = self.load(pyfile.url, just_header = True)
#self.logDebug(header)
+ # self.load does not raise a BadHeader on 404 responses, do it here
+ if header.has_key('code') and header['code'] == 404:
+ raise BadHeader(404)
+
if 'location' in header:
self.logDebug("Location: " + header['location'])
url = unquote(header['location'])
@@ -86,4 +92,4 @@ class BasePlugin(Hoster):
if not name: name = url
pyfile.name = name
self.logDebug("Filename: %s" % pyfile.name)
- self.download(url, disposition=True) \ No newline at end of file
+ self.download(url, disposition=True)
diff --git a/module/plugins/hoster/IfolderRu.py b/module/plugins/hoster/IfolderRu.py
index b84f77c5c..a21cc748b 100644
--- a/module/plugins/hoster/IfolderRu.py
+++ b/module/plugins/hoster/IfolderRu.py
@@ -24,9 +24,9 @@ from module.network.RequestFactory import getURL
class IfolderRu(SimpleHoster):
__name__ = "IfolderRu"
__type__ = "hoster"
- __pattern__ = r"http://(?:[^.]*\.)?ifolder.ru/(\d+).*"
- __version__ = "0.35"
- __description__ = """ifolder.ru"""
+ __pattern__ = r"http://(?:[^.]*\.)?(?:ifolder.ru|rusfolder.com)/(?P<ID>\d+).*"
+ __version__ = "0.36"
+ __description__ = """rusfolder.com / ifolder.ru"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -35,9 +35,7 @@ class IfolderRu(SimpleHoster):
FILE_SIZE_PATTERN = ur'(?:<div><span>)?Размер:(?:</span>)? <b>(?P<S>[^<]+)</b><(?:/div|br)>'
FILE_OFFLINE_PATTERN = ur'<p>Файл номер <b>[^<]*</b> (не найден|удален) !!!</p>'
- SESSION_ID_PATTERN = r'<a href=(http://ints.ifolder.ru/ints/sponsor/\?bi=\d*&session=([^&]+)&u=[^>]+)>'
- FORM1_PATTERN = r'<form method=post name="form1" ID="Form1" style="margin-bottom:200px">(.*?)</form>'
- FORM_INPUT_PATTERN = r'<input[^>]* name="?([^" ]+)"? value="?([^" ]+)"?[^>]*>'
+ SESSION_ID_PATTERN = r'<a href=(http://ints.(?:rusfolder.com|ifolder.ru)/ints/sponsor/\?bi=\d*&session=([^&]+)&u=[^>]+)>'
INTS_SESSION_PATTERN = r'\(\'ints_session\'\);\s*if\(tag\)\{tag.value = "([^"]+)";\}'
HIDDEN_INPUT_PATTERN = r"var v = .*?name='([^']+)' value='1'"
DOWNLOAD_LINK_PATTERN = r'<a id="download_file_href" href="([^"]+)"'
@@ -48,33 +46,30 @@ class IfolderRu(SimpleHoster):
self.chunkLimit = 1
def process(self, pyfile):
- file_id = re.search(self.__pattern__, pyfile.url).group(1)
- self.html = self.load("http://ifolder.ru/%s" % file_id, cookies=True, decode=True)
+ file_id = re.search(self.__pattern__, pyfile.url).group('ID')
+ self.html = self.load("http://rusfolder.com/%s" % file_id, cookies=True, decode=True)
self.getFileInfo()
- url = "http://ints.ifolder.ru/ints/?ifolder.ru/%s?ints_code=" % file_id
+ url = "http://ints.rusfolder.com/ints/?rusfolder.com/%s?ints_code=" % file_id
self.html = self.load(url, cookies=True, decode=True)
url, session_id = re.search(self.SESSION_ID_PATTERN, self.html).groups()
self.html = self.load(url, cookies=True, decode=True)
- url = "http://ints.ifolder.ru/ints/frame/?session=%s" % session_id
+ url = "http://ints.rusfolder.com/ints/frame/?session=%s" % session_id
self.html = self.load(url, cookies=True)
self.setWait(31, False)
self.wait()
- captcha_url = "http://ints.ifolder.ru/random/images/?session=%s" % session_id
+ captcha_url = "http://ints.rusfolder.com/random/images/?session=%s" % session_id
for i in range(5):
- self.html = self.load(url, cookies=True)
-
- inputs = {}
- form = re.search(self.FORM1_PATTERN, self.html, re.DOTALL).group(1)
- inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
- inputs['ints_session'] = re.search(self.INTS_SESSION_PATTERN, form).group(1)
- inputs['Submit1'] = u"Подтвердить".encode("utf-8")
+ self.html = self.load(url, cookies=True)
+ action, inputs = self.parseHtmlForm('ID="Form1"')
+ inputs['ints_session'] = re.search(self.INTS_SESSION_PATTERN, self.html).group(1)
inputs[re.search(self.HIDDEN_INPUT_PATTERN, self.html).group(1)] = '1'
inputs['confirmed_number'] = self.decryptCaptcha(captcha_url, cookies = True)
+ inputs['action'] = '1'
self.logDebug(inputs)
self.html = self.load(url, decode = True, cookies = True, post = inputs)
@@ -85,7 +80,7 @@ class IfolderRu(SimpleHoster):
else:
self.fail("Invalid captcha")
- self.html = self.load("http://ifolder.ru/%s?ints_code=%s" % (file_id, session_id), decode=True, cookies = True)
+ self.html = self.load("http://rusfolder.com/%s?ints_code=%s" % (file_id, session_id), decode=True, cookies = True)
download_url = re.search(self.DOWNLOAD_LINK_PATTERN, self.html).group(1)
self.correctCaptcha()
diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py
index dce16118f..1069e5e1a 100644
--- a/module/plugins/hoster/MediafireCom.py
+++ b/module/plugins/hoster/MediafireCom.py
@@ -57,8 +57,8 @@ def getInfo(urls):
class MediafireCom(SimpleHoster):
__name__ = "MediafireCom"
__type__ = "hoster"
- __pattern__ = r"http://(\w*\.)*mediafire\.com/(file/|(download.php)?\?)(\w{11}|\w{15})($|/)"
- __version__ = "0.76"
+ __pattern__ = r"http://(?:\w*\.)*mediafire\.com/(file/|(view/?|download.php)?\?)(\w{11}|\w{15})($|/)"
+ __version__ = "0.77"
__description__ = """Mediafire.com plugin - free only"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -71,13 +71,15 @@ class MediafireCom(SimpleHoster):
PASSWORD_PATTERN = r'<form name="form_password"'
FILE_NAME_PATTERN = r'<META NAME="description" CONTENT="(?P<N>[^"]+)"/>'
- FILE_SIZE_PATTERN = r'>Download\s*<span>\((?P<S>[^)]+)\)</span>'
+ FILE_INFO_PATTERN = r"oFileSharePopup\.ald\('(?P<ID>[^']*)','(?P<N>[^']*)','(?P<S>[^']*)','','(?P<sha256>[^']*)'\)"
FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>'
def setup(self):
self.multiDL = False
def process(self, pyfile):
+ pyfile.url = re.sub(r'/view/?\?', '/?', pyfile.url)
+
self.url, result = checkHTMLHeader(pyfile.url)
self.logDebug('Location (%d): %s' % (result, self.url))
@@ -85,7 +87,7 @@ class MediafireCom(SimpleHoster):
self.html = self.load(self.url, decode = True)
self.checkCaptcha()
self.multiDL = True
- self.getFileInfo()
+ self.check_data = self.getFileInfo()
if self.account:
self.handlePremium()
diff --git a/module/plugins/hoster/NowDownloadEu.py b/module/plugins/hoster/NowDownloadEu.py
new file mode 100644
index 000000000..fa699a278
--- /dev/null
+++ b/module/plugins/hoster/NowDownloadEu.py
@@ -0,0 +1,62 @@
+# -*- 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 <http://www.gnu.org/licenses/>.
+
+ @author: zoidberg
+"""
+
+import re
+from random import random
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
+
+class NowDownloadEu(SimpleHoster):
+ __name__ = "NowDownloadEu"
+ __type__ = "hoster"
+ __pattern__ = r"http://(www\.)?nowdownload\.(eu|co)/dl/(?P<ID>[a-z0-9]+)"
+ __version__ = "0.01"
+ __description__ = """NowDownloadEu"""
+ __author_name__ = ("godofdream")
+ FILE_INFO_PATTERN = r'Downloading</span> <br> (?P<N>.*) (?P<S>[0-9,.]+) (?P<U>[kKMG])i?B </h4>'
+ FILE_OFFLINE_PATTERN = r'(This file does not exist!)'
+ FILE_TOKEN_PATTERN = r'"(/api/token\.php\?token=[a-z0-9]+)"'
+ FILE_CONTINUE_PATTERN = r'"(/dl2/[a-z0-9]+/[a-z0-9]+)"'
+ FILE_WAIT_PATTERN = r'\.countdown\(\{until: \+(\d+),'
+ FILE_DOWNLOAD_LINK = r'"(http://f\d+\.nowdownload\.eu/dl/[a-z0-9]+/[a-z0-9]+/[^<>"]*?)"'
+ def setup(self):
+ self.wantReconnect = False
+ self.multiDL = True
+ self.chunkLimit = -1
+ self.resumeDownload = True
+
+ def handleFree(self):
+ tokenlink = re.search(self.FILE_TOKEN_PATTERN, self.html)
+ continuelink = re.search(self.FILE_CONTINUE_PATTERN, self.html)
+ if (not tokenlink) or (not continuelink): self.fail('Plugin out of Date')
+
+ wait = 60
+ found = re.search(self.FILE_WAIT_PATTERN, self.html)
+ if found: wait = int(found.group(1))
+
+ self.html = self.load("http://www.nowdownload.eu" + str(tokenlink.group(1)))
+ self.setWait(wait)
+ self.wait()
+
+ self.html = self.load("http://www.nowdownload.eu" + str(continuelink.group(1)))
+
+ url = re.search(self.FILE_DOWNLOAD_LINK, self.html)
+ if not url: self.fail('Download Link not Found (Plugin out of Date?)')
+ self.logDebug('Download link: ' + str(url.group(1)))
+ self.download(str(url.group(1)))
+
+getInfo = create_getInfo(NowDownloadEu) \ No newline at end of file
diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py
index 128942b75..3a4ff7275 100644
--- a/module/plugins/hoster/OneFichierCom.py
+++ b/module/plugins/hoster/OneFichierCom.py
@@ -7,7 +7,7 @@ class OneFichierCom(SimpleHoster):
__name__ = "OneFichierCom"
__type__ = "hoster"
__pattern__ = r"(http://(\w+)\.((1fichier|d(es)?fichiers|pjointe)\.(com|fr|net|org)|(cjoint|mesfichiers|piecejointe|oi)\.(org|net)|tenvoi\.(com|org|net)|dl4free\.com|alterupload\.com|megadl.fr))"
- __version__ = "0.43"
+ __version__ = "0.44"
__description__ = """1fichier.com download hoster"""
__author_name__ = ("fragonib", "the-razer", "zoidberg")
__author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", "zoidberg@mujmail.cz")
@@ -19,7 +19,7 @@ class OneFichierCom(SimpleHoster):
DOWNLOAD_LINK_PATTERN = r'<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;\s+<a href="(?P<url>http://.*?)"'
PASSWORD_PROTECTED_TOKEN = "protected by password"
- WAITING_TOKEN = "Please wait a few seconds"
+ WAITING_PATTERN = "you must wait (\d+) minutes"
def process(self, pyfile):
found = re.search(self.__pattern__, pyfile.url)
@@ -27,8 +27,9 @@ class OneFichierCom(SimpleHoster):
url = "http://%s.%s/en/" % (found.group(2), found.group(3))
self.html = self.load(url, decode = True)
- if self.WAITING_TOKEN in self.html:
- self.waitAndRetry(120)
+ found = re.search(self.WAITING_PATTERN, self.html)
+ if found:
+ self.waitAndRetry(int(found.group(1)) * 60)
self.getFileInfo()
@@ -46,9 +47,9 @@ class OneFichierCom(SimpleHoster):
self.checkDownloadedFile()
def checkDownloadedFile(self):
- check = self.checkDownload({"wait": self.WAITING_TOKEN})
+ check = self.checkDownload({"wait": self.WAITING_PATTERN})
if check == "wait":
- self.waitAndRetry(60)
+ self.waitAndRetry(int(self.lastcheck.group(1)) * 60)
def waitAndRetry(self, wait_time):
self.setWait(wait_time, True)
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index b40cd51dd..e47aa0e5e 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -43,7 +43,7 @@ class ShareonlineBiz(Hoster):
__name__ = "ShareonlineBiz"
__type__ = "hoster"
__pattern__ = r"http://[\w\.]*?(share\-online\.biz|egoshare\.com)/(download.php\?id\=|dl/)[\w]+"
- __version__ = "0.33"
+ __version__ = "0.34"
__description__ = """Shareonline.biz Download Hoster"""
__author_name__ = ("spoob", "mkaay", "zoidberg")
__author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz")
@@ -130,6 +130,16 @@ class ShareonlineBiz(Hoster):
self.wait()
self.download(download_url)
+ # check download
+ check = self.checkDownload({
+ "cookie": re.compile(r'<div id="dl_failure"'),
+ "fail": re.compile(r"<title>Share-Online")
+ })
+ if check == "cookie":
+ self.retry(5, 60, "Cookie failure")
+ elif check == "fail":
+ self.retry(5, 300, "Download failed")
+
def checkErrors(self):
found = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL)
diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py
index 6b0b01003..84974e7ba 100644
--- a/module/plugins/hoster/ZippyshareCom.py
+++ b/module/plugins/hoster/ZippyshareCom.py
@@ -10,7 +10,7 @@ class ZippyshareCom(SimpleHoster):
__name__ = "ZippyshareCom"
__type__ = "hoster"
__pattern__ = r"(?P<HOST>http://www\d{0,2}\.zippyshare.com)/v(?:/|iew.jsp.*key=)(?P<KEY>\d+)"
- __version__ = "0.36"
+ __version__ = "0.37"
__description__ = """Zippyshare.com Download Hoster"""
__author_name__ = ("spoob", "zoidberg")
__author_mail__ = ("spoob@pyload.org", "zoidberg@mujmail.cz")
@@ -18,6 +18,7 @@ class ZippyshareCom(SimpleHoster):
FILE_NAME_PATTERN = r'>Name:</font>\s*<font [^>]*>(?P<N>[^<]+)</font><br />'
FILE_SIZE_PATTERN = r'>Size:</font>\s*<font [^>]*>(?P<S>[0-9.,]+) (?P<U>[kKMG]+)i?B</font><br />'
+ FILE_INFO_PATTERN = r'document\.getElementById\(\'dlbutton\'\)\.href = "[^;]*/(?P<N>[^"]+)";'
FILE_OFFLINE_PATTERN = r'>File does not exist on this server</div>'
DOWNLOAD_URL_PATTERN = r"<script type=\"text/javascript\">([^<]*?)document\.getElementById\('dlbutton'\).href = ([^;]+);"
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py
index 5056b22b2..a2e246d44 100644
--- a/module/plugins/internal/SimpleHoster.py
+++ b/module/plugins/internal/SimpleHoster.py
@@ -39,7 +39,7 @@ def set_cookies(cj, cookies):
cj.setCookie(domain, name, value)
def parseHtmlTagAttrValue(attr_name, tag):
- m = re.search(r"%s\s*=\s*([\"']?)((?<=\")[^\"]+|(?<=')[^']+|[^\s\"'][^>\s]+)\1" % attr_name, tag)
+ m = re.search(r"%s\s*=\s*([\"']?)((?<=\")[^\"]+|(?<=')[^']+|[^>\s\"'][^>\s]*)\1" % attr_name, tag, re.I)
return m.group(2) if m else None
def parseHtmlForm(attr_str, html):
@@ -129,7 +129,7 @@ class PluginParseError(Exception):
class SimpleHoster(Hoster):
__name__ = "SimpleHoster"
- __version__ = "0.25"
+ __version__ = "0.26"
__pattern__ = None
__type__ = "hoster"
__description__ = """Base hoster plugin"""