summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-01-16 20:44:19 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2012-01-16 20:44:19 +0100
commita72688b208ed4ba3e98234e995f7bc1eb4afec42 (patch)
treed9b800af34a521db755f5303ca44662b1cbb544a /module/plugins/hoster
parentreverted sloccount (diff)
downloadpyload-a72688b208ed4ba3e98234e995f7bc1eb4afec42.tar.xz
merge in plugin updates
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/BezvadataCz.py4
-rw-r--r--module/plugins/hoster/EasybytezCom.py4
-rw-r--r--module/plugins/hoster/EuroshareEu.py2
-rw-r--r--module/plugins/hoster/FilepostCom.py105
-rw-r--r--module/plugins/hoster/FilesonicCom.py15
-rw-r--r--module/plugins/hoster/FourSharedCom.py4
-rw-r--r--module/plugins/hoster/HotfileCom.py9
-rw-r--r--module/plugins/hoster/LetitbitNet.py64
-rw-r--r--module/plugins/hoster/MediafireCom.py59
-rw-r--r--module/plugins/hoster/MegauploadCom.py11
-rw-r--r--module/plugins/hoster/MultishareCz.py14
-rw-r--r--module/plugins/hoster/OneFichierCom.py130
-rw-r--r--module/plugins/hoster/Premium4Me.py58
-rw-r--r--module/plugins/hoster/UlozTo.py192
-rw-r--r--module/plugins/hoster/WuploadCom.py7
15 files changed, 349 insertions, 329 deletions
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py
index f061fa2b5..a0717ad64 100644
--- a/module/plugins/hoster/BezvadataCz.py
+++ b/module/plugins/hoster/BezvadataCz.py
@@ -23,13 +23,13 @@ class BezvadataCz(SimpleHoster):
__name__ = "BezvadataCz"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)*bezvadata.cz/stahnout/.*"
- __version__ = "0.22"
+ __version__ = "0.23"
__description__ = """BezvaData.cz"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
FILE_NAME_PATTERN = r'<p><b>Soubor: (?P<N>[^<]+)</b></p>'
- FILE_SIZE_PATTERN = r'<li><strong>Velikost:</strong> (?P<S>[0-9.]+) (?P<U>[kKMG])i?)</li>'
+ FILE_SIZE_PATTERN = r'<li><strong>Velikost:</strong> (?P<S>[^<]+)</li>'
FILE_OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen</title>'
DOWNLOAD_FORM_PATTERN = r'<form class="download" action="([^"]+)" method="post" id="frm-stahnoutForm">'
diff --git a/module/plugins/hoster/EasybytezCom.py b/module/plugins/hoster/EasybytezCom.py
index 4c1c885a7..0b46acb83 100644
--- a/module/plugins/hoster/EasybytezCom.py
+++ b/module/plugins/hoster/EasybytezCom.py
@@ -24,7 +24,7 @@ class EasybytezCom(SimpleHoster):
__name__ = "EasybytezCom"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?easybytez.com/(\w{6,}).*"
- __version__ = "0.05"
+ __version__ = "0.06"
__description__ = """easybytez.com"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
@@ -38,7 +38,7 @@ class EasybytezCom(SimpleHoster):
FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)"[^>]*value="([^"]*)"'
WAIT_PATTERN = r'<span id="countdown_str">[^>]*>(\d+)</span> seconds</span>'
- DIRECT_LINK_PATTERN = r'(http://\w+\.easybytez\.com/files/\d+/\w+/[^"<]+)'
+ DIRECT_LINK_PATTERN = r'(http://(\w+\.easybytez\.com|\d+\.\d+\.\d+\.\d+)/files/\d+/\w+/[^"<]+)'
FORM_PATTERN = r'<form name=["\']?%s[^>]*action=["\']?([^"\' ]+)(.*?)</form>'
OVR_DOWNLOAD_LINK_PATTERN = r'<h2>Download Link</h2>\s*<textarea[^>]*>([^<]+)'
diff --git a/module/plugins/hoster/EuroshareEu.py b/module/plugins/hoster/EuroshareEu.py
index a0bfe0ab2..1e1cc0b4b 100644
--- a/module/plugins/hoster/EuroshareEu.py
+++ b/module/plugins/hoster/EuroshareEu.py
@@ -37,7 +37,7 @@ class EuroshareEu(Hoster):
__name__ = "EuroshareEu"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)?euroshare.eu/file/.*"
- __version__ = "0.2b"
+ __version__ = "0.30"
__description__ = """Euroshare.eu"""
__author_name__ = ("zoidberg")
diff --git a/module/plugins/hoster/FilepostCom.py b/module/plugins/hoster/FilepostCom.py
index 42ec0788b..d12fad738 100644
--- a/module/plugins/hoster/FilepostCom.py
+++ b/module/plugins/hoster/FilepostCom.py
@@ -18,7 +18,6 @@
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.network.RequestFactory import getURL
from module.plugins.ReCaptcha import ReCaptcha
from module.common.json_layer import json_loads
from time import time
@@ -26,16 +25,17 @@ from time import time
class FilepostCom(SimpleHoster):
__name__ = "FilepostCom"
__type__ = "hoster"
- __pattern__ = r"https?://(?:www\.)?filepost\.com/files/([^/]+).*"
- __version__ = "0.23"
+ __pattern__ = r"https?://(?:www\.)?(?:filepost\.com/files|fp.io)/([^/]+).*"
+ __version__ = "0.25"
__description__ = """Filepost.com plugin - free only"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- FILE_INFO_PATTERN = r'<h1>(?P<N>[^<]+)</h1>\s*<div class="ul">\s*<ul>\s*<li><span>Size:</span> (?P<S>[0-9.]+) (?P<U>[kKMG])i?B</li>'
+ FILE_INFO_PATTERN = r'<input type="text" id="url" value=\'<a href[^>]*>(?P<N>[^>]+?) - (?P<S>[0-9\.]+ [kKMG]i?B)</a>\' class="inp_text"/>'
+ #FILE_INFO_PATTERN = r'<h1>(?P<N>[^<]+)</h1>\s*<div class="ul">\s*<ul>\s*<li><span>Size:</span> (?P<S>[0-9.]+) (?P<U>[kKMG])i?B</li>'
FILE_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>'
RECAPTCHA_KEY_PATTERN = r"Captcha.init\({\s*key:\s*'([^']+)'"
- FLP_TOKEN_PATTERN = r"store.set\('(?:flp_)?token', '([^']+)'\);"
+ FLP_TOKEN_PATTERN = r"set_store_options\({token: '([^']+)'"
def handleFree(self):
# Find token and captcha key
@@ -49,42 +49,71 @@ class FilepostCom(SimpleHoster):
if not found: self.parseError("Captcha key")
captcha_key = found.group(1)
- url = 'https://filepost.com/files/get/'
-
# Get wait time
get_dict = {'SID' : self.req.cj.getCookie('SID'), 'JsHttpRequest' : str(int(time()*10000)) + '-xml'}
- post_dict = {'action' : 'set_download', 'download' : flp_token, 'code' : file_id}
- json_response = json_loads(self.load(url, get = get_dict, post = post_dict))
- self.logDebug(json_response)
- try:
- self.setWait(int(json_response['js']['answer']['wait_time']))
- except Exception, e:
- self.logError(e)
- self.self.parseError("Wait time")
- self.wait()
-
- # Solve recaptcha
- recaptcha = ReCaptcha(self)
- for i in range(5):
- captcha_challenge, captcha_response = recaptcha.challenge(captcha_key)
- self.logDebug("RECAPTCHA: %s : %s : %s" % (captcha_key, captcha_challenge, captcha_response))
-
- get_dict['JsHttpRequest'] = str(int(time()*10000)) + '-xml'
- post_dict = {'download' : flp_token, 'code' : file_id,
- "recaptcha_challenge_field" : captcha_challenge,
- "recaptcha_response_field" : captcha_response
- }
-
- json_response = json_loads(self.load(url, get = get_dict, post = post_dict))
- try:
- download_url = json_response['js']['answer']['link']
- self.correctCaptcha()
- break
- except:
- self.invalidCaptcha()
- else: self.fail("Invalid captcha")
+ post_dict = {'action' : 'set_download', 'token' : flp_token, 'code' : file_id}
+ wait_time = int(self.getJsonResponse(get_dict, post_dict, 'wait_time'))
+ if wait_time > 0:
+ self.setWait(wait_time)
+ self.wait()
+
+ post_dict = {"token" : flp_token, "code" : file_id, "file_pass" : ''}
+
+ if 'var is_pass_exists = true;' in self.html:
+ # Solve password
+ for file_pass in self.getPassword().splitlines():
+ get_dict['JsHttpRequest'] = str(int(time()*10000)) + '-xml'
+ post_dict['file_pass'] = file_pass
+ self.logInfo("Password protected link, trying " + file_pass)
+
+ download_url = self.getJsonResponse(get_dict, post_dict, 'link')
+ if download_url:
+ break
+
+ else: self.fail("No or incorrect password")
+
+ else:
+ # Solve recaptcha
+ recaptcha = ReCaptcha(self)
+
+ for pokus in range(5):
+ get_dict['JsHttpRequest'] = str(int(time()*10000)) + '-xml'
+ if pokus:
+ post_dict["recaptcha_challenge_field"], post_dict["captcha_response_field"] = recaptcha.challenge(captcha_key)
+ self.logDebug(u"RECAPTCHA: %s : %s : %s" % (captcha_key, post_dict["recaptcha_challenge_field"], post_dict["captcha_response_field"]))
+
+ download_url = self.getJsonResponse(get_dict, post_dict, 'link')
+ if download_url:
+ if pokus: self.correctCaptcha()
+ break
+ elif pokus:
+ self.invalidCaptcha()
+
+ else: self.fail("Invalid captcha")
+
# Download
- self.download(download_url)
+ self.download(download_url)
+
+ def getJsonResponse(self, get_dict, post_dict, field):
+ json_response = json_loads(self.load('https://filepost.com/files/get/', get = get_dict, post = post_dict))
+ self.logDebug(json_response)
+
+ if not 'js' in json_response: self.parseError('JSON %s 1' % field)
+
+ if 'error' in json_response['js']:
+ if json_response['js']['error'] == 'download_delay':
+ self.retry(js_answer['params']['next_download'])
+ elif 'Wrong file password' in json_response['js']['error']:
+ return None
+ elif 'You entered a wrong CAPTCHA code' in json_response['js']['error']:
+ return None
+ else:
+ self.fail(js_answer['error'])
+
+ if not 'answer' in json_response['js'] or not field in json_response['js']['answer']:
+ self.parseError('JSON %s 2' % field)
+
+ return json_response['js']['answer'][field]
getInfo = create_getInfo(FilepostCom) \ No newline at end of file
diff --git a/module/plugins/hoster/FilesonicCom.py b/module/plugins/hoster/FilesonicCom.py
index 6094859ef..f0fbab1d9 100644
--- a/module/plugins/hoster/FilesonicCom.py
+++ b/module/plugins/hoster/FilesonicCom.py
@@ -3,10 +3,11 @@
import re
import string
+from urllib import unquote
from module.plugins.Hoster import Hoster
from module.plugins.ReCaptcha import ReCaptcha
-from module.plugins.Plugin import chunks
+from module.utils import chunks
from module.network.RequestFactory import getURL
from module.common.json_layer import json_loads
@@ -28,9 +29,9 @@ def getInfo(urls):
response = json_loads(getURL(check_url, decode=True))
for item in response["FSApi_Link"]["getInfo"]["response"]["links"]:
if item["status"] != "AVAILABLE":
- result.append((None, 0, 1, ids[str(item["id"])]))
+ result.append((ids[str(item["id"])], 0, 1, ids[str(item["id"])]))
else:
- result.append((item["filename"], item["size"], 2, ids[str(item["id"])]))
+ result.append((unquote(item["filename"]), item["size"], 2, ids[str(item["id"])]))
yield result
@@ -45,8 +46,8 @@ def getId(url):
class FilesonicCom(Hoster):
__name__ = "FilesonicCom"
__type__ = "hoster"
- __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/file/(([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?"
- __version__ = "0.34"
+ __pattern__ = r"http://[\w\.]*?(sharingmatrix|filesonic)\..*?/.*?file/([a-zA-Z0-9]+(/.+)?|[a-z0-9]+/[0-9]+(/.+)?|[0-9]+(/.+)?)"
+ __version__ = "0.35"
__description__ = """FilesonicCom und Sharingmatrix Download Hoster"""
__author_name__ = ("jeix", "paulking")
__author_mail__ = ("jeix@hasnomail.de", "")
@@ -54,7 +55,7 @@ class FilesonicCom(Hoster):
API_ADDRESS = "http://api.filesonic.com"
URL_DOMAIN_PATTERN = r'(?P<prefix>.*?)(?P<domain>.(filesonic|sharingmatrix)\..+?)(?P<suffix>/.*)'
FILE_ID_PATTERN = r'/file/(?P<id>([a-z][0-9]+/)?[a-zA-Z0-9\-._+]+)(/.*)?' #change may break wupload - be careful
- FILE_LINK_PATTERN = r'<p><a href="(http://.+?\.(filesonic|sharingmatrix)\..+?)"><span>Start download'
+ FILE_LINK_PATTERN = r'Your download is ready</p>\s*<a href="(http://[^"]+)'
WAIT_TIME_PATTERN = r'countDownDelay = (?P<wait>\d+)'
WAIT_TM_PATTERN = r"name='tm' value='(.*?)' />"
WAIT_TM_HASH_PATTERN = r"name='tm_hash' value='(.*?)' />"
@@ -97,7 +98,7 @@ class FilesonicCom(Hoster):
#if item["is_premium_only"] != 0 and not self.premium:
# self.fail("need premium account for file")
- self.pyfile.name = item["filename"]
+ self.pyfile.name = unquote(item["filename"])
# Fix the url and resolve the domain to the correct regional variation
url = item["url"]
diff --git a/module/plugins/hoster/FourSharedCom.py b/module/plugins/hoster/FourSharedCom.py
index b1cc252e2..2b27eed28 100644
--- a/module/plugins/hoster/FourSharedCom.py
+++ b/module/plugins/hoster/FourSharedCom.py
@@ -8,7 +8,7 @@ class FourSharedCom(SimpleHoster):
__name__ = "FourSharedCom"
__type__ = "hoster"
__pattern__ = r"http://[\w\.]*?4shared(-china)?\.com/(account/)?(download|get|file|document|photo|video|audio)/.+?/.*"
- __version__ = "0.24"
+ __version__ = "0.25"
__description__ = """4Shared Download Hoster"""
__author_name__ = ("jeix", "zoidberg")
__author_mail__ = ("jeix@hasnomail.de", "zoidberg@mujmail.cz")
@@ -19,7 +19,7 @@ class FourSharedCom(SimpleHoster):
FILE_NAME_REPLACEMENTS = [(r"&#(\d+).", lambda m: unichr(int(m.group(1))))]
DOWNLOAD_BUTTON_PATTERN = '<a href="([^"]+)"\s*class="dbtn'
- DOWNLOAD_URL_PATTERN = "<div class=\"(?:dl|xxlarge bold)\">\s*<a href='([^']+)'"
+ DOWNLOAD_URL_PATTERN = r"<a class=\"linkShowD3\" href='([^']+)'>Download file now</a>"
def handleFree(self):
found = re.search(self.DOWNLOAD_BUTTON_PATTERN, self.html)
diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py
index d36a4df2e..1447e7c9e 100644
--- a/module/plugins/hoster/HotfileCom.py
+++ b/module/plugins/hoster/HotfileCom.py
@@ -2,10 +2,11 @@
# -*- coding: utf-8 -*-
import re
-from module.plugins.Hoster import Hoster, chunks
+from module.plugins.Hoster import Hoster
from module.plugins.ReCaptcha import ReCaptcha
from module.network.RequestFactory import getURL
+from module.plugins.Plugin import chunks
def getInfo(urls):
api_url_base = "http://api.hotfile.com/"
@@ -31,7 +32,7 @@ class HotfileCom(Hoster):
__name__ = "HotfileCom"
__type__ = "hoster"
__pattern__ = r"http://(www.)?hotfile\.com/dl/\d+/[0-9a-zA-Z]+/"
- __version__ = "0.31"
+ __version__ = "0.32"
__description__ = """Hotfile.com Download Hoster"""
__author_name__ = ("sitacuisses","spoob","mkaay")
__author_mail__ = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de")
@@ -56,7 +57,7 @@ class HotfileCom(Hoster):
elif self.account and login:
return self.account.apiCall(method, post, self.user)
post.update({"action": method})
- return self.load("http://api.hotfile.com/", post=post)
+ return self.load("http://api.hotfile.com/", post=post, decode=True)
def process(self, pyfile):
self.wantReconnect = False
@@ -99,7 +100,7 @@ class HotfileCom(Hoster):
self.fail("Form not found in HTML. Can not proceed.")
form_content = form_content.group(0)
- form_posts = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", form_content)
+ form_posts = dict(re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", form_content))
self.html[1] = self.load(self.pyfile.url, post=form_posts)
diff --git a/module/plugins/hoster/LetitbitNet.py b/module/plugins/hoster/LetitbitNet.py
index 8ac4b8f7f..4ff2b9750 100644
--- a/module/plugins/hoster/LetitbitNet.py
+++ b/module/plugins/hoster/LetitbitNet.py
@@ -17,56 +17,41 @@
"""
import re
+from random import random
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class LetitbitNet(SimpleHoster):
__name__ = "LetitbitNet"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*letitbit.net/download/.*"
- __version__ = "0.12"
+ __version__ = "0.13"
__description__ = """letitbit.net"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- FORM_PATTERN = r'<form%s action="([^"]+)" method="post"%s>(.*?)</form>'
- FORM_INPUT_PATTERN = r'<input[^>]* name="([^"]+)" value="([^"]+)" />'
- CHECK_URL_PATTERN = r"ajax_check_url\s*=\s*'([^']+)';"
+ CHECK_URL_PATTERN = r"ajax_check_url\s*=\s*'((http://[^/]+)[^']+)';"
SECONDS_PATTERN = r"seconds\s*=\s*(\d+);"
- FILE_INFO_PATTERN = r'<h1[^>]*>File: <a[^>]*><span>(?P<N>[^<]+)</span></a> [<span>(?P<S>[0-9.]+)\s*(?P<U>[kKMG])i?[Bb]</span>]</h1>'
+ FILE_INFO_PATTERN = r'<h1[^>]*>File: <a[^>]*><span>(?P<N>[^<]+)</span></a>\s*\[<span>(?P<S>[^<]+)</span>]</h1>'
FILE_OFFLINE_PATTERN = r'<div id="download_content" class="hide-block">[^<]*<br>File not found<br /></div>'
- def setup(self):
- self.resumeDownload = self.multiDL = True if self.account else False
- self.chunkLimit = 1
+ def handleFree(self):
+ action, inputs = self.parseHtmlForm('id="ifree_form"')
+ if not action: self.parseError("page 1 / ifree_form")
+ self.pyfile.size = float(inputs['sssize'])
+ #self.logDebug(action, inputs)
+ inputs['desc'] = ""
- def process(self, pyfile):
- self.html = self.load(pyfile.url, decode=True)
- if re.search(self.FILE_OFFLINE_PATTERN, self.html): self.offline()
+ self.html = self.load("http://letitbit.net" + action, post = inputs, cookies = True)
- try:
- action, form = re.search(self.FORM_PATTERN % (' id="ifree_form"', ''), self.html, re.DOTALL).groups()
- inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
- pyfile.name = inputs['name']
- pyfile.size = float(inputs['sssize'])/1024
- except Exception, e:
- self.logError(e)
- self.parseError("page 1 / ifree_form")
+ action, inputs = self.parseHtmlForm('id="d3_form"')
+ if not action: self.parseError("page 2 / d3_form")
+ #self.logDebug(action, inputs)
- #self.logDebug(inputs)
- inputs['desc'] = ""
- self.html = self.load("http://letitbit.net" + action, post = inputs)
-
- try:
- action, form = re.search(self.FORM_PATTERN % ('', ' id="d3_form"'), self.html, re.DOTALL).groups()
- inputs = dict(re.findall(self.FORM_INPUT_PATTERN, form))
- except Exception, e:
- self.logError(e)
- self.parseError("page 2 / d3_form")
+ self.html = self.load(action, post = inputs, cookies = True)
- self.html = self.load(action, post = inputs)
try:
- ajax_check_url = re.search(self.CHECK_URL_PATTERN, self.html).group(1)
+ ajax_check_url, captcha_url = re.search(self.CHECK_URL_PATTERN, self.html).groups()
found = re.search(self.SECONDS_PATTERN, self.html)
seconds = int(found.group(1)) if found else 60
self.setWait(seconds+1)
@@ -75,7 +60,22 @@ class LetitbitNet(SimpleHoster):
self.logError(e)
self.parseError("page 3 / js")
- download_url = self.load(ajax_check_url, post = inputs)
+ response = self.load(ajax_check_url, post = inputs, cookies = True)
+ if response != '1': self.fail('Unknown response (ajax_check_url)')
+
+ for i in range(5):
+ captcha = self.decryptCaptcha('%s/captcha_new.php?rand=%d' % (captcha_url, random() * 100000), cookies = True)
+ response = self.load(captcha_url + '/ajax/check_captcha.php', post = {"code": captcha}, cookies = True)
+ self.logDebug(response)
+ if response.startswith('http://'):
+ download_url = response
+ self.correctCaptcha()
+ break
+ else:
+ self.invalidCaptcha()
+ else:
+ self.fail("No valid captcha solution received")
+
self.download(download_url)
getInfo = create_getInfo(LetitbitNet) \ No newline at end of file
diff --git a/module/plugins/hoster/MediafireCom.py b/module/plugins/hoster/MediafireCom.py
index 14180ff3d..f40071478 100644
--- a/module/plugins/hoster/MediafireCom.py
+++ b/module/plugins/hoster/MediafireCom.py
@@ -58,21 +58,24 @@ class MediafireCom(SimpleHoster):
__name__ = "MediafireCom"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*mediafire\.com/[^?].*"
- __version__ = "0.71"
+ __version__ = "0.73"
__description__ = """Mediafire.com plugin - free only"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- DOWNLOAD_LINK_PATTERN = r'<div class="download_link"[^>]*z-index:(?P<zindex>\d+)[^>]*>\s*<a href="(?P<href>[^"]+)"'
+ DOWNLOAD_LINK_PATTERN = r'<div class="download_link"[^>]*(?:z-index:(?P<zindex>\d+))?[^>]*>\s*<a href="(?P<href>http://[^"]+)"'
JS_KEY_PATTERN = r"DoShow\('mfpromo1'\);[^{]*{((\w+)='';.*?)eval\(\2\);"
JS_ZMODULO_PATTERN = r"\('z-index'\)\) \% (\d+)\)\);"
RECAPTCHA_PATTERN = r'src="http://(?:api.recaptcha.net|www.google.com/recaptcha/api)/challenge\?k=([^"]+)">'
PAGE1_ACTION_PATTERN = r'<link rel="canonical" href="([^"]+)"/>'
- PASSWORD_PATTERN = r";break;}\s*dh\('"
+ 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_OFFLINE_PATTERN = r'class="error_msg_title"> Invalid or Deleted File. </div>'
+
+ def setup(self):
+ self.multiDL = True
def process(self, pyfile):
self.url, result = checkHTMLHeader(pyfile.url)
@@ -92,8 +95,8 @@ class MediafireCom(SimpleHoster):
self.download(self.url, disposition = True)
def handleFree(self):
- passwords = self.getPassword().split()
- while re.search(self.PASSWORD_PATTERN, self.html):
+ passwords = self.getPassword().splitlines()
+ while self.PASSWORD_PATTERN in self.html:
if len(passwords):
password = passwords.pop(0)
self.logInfo("Password protected link, trying " + password)
@@ -101,25 +104,35 @@ class MediafireCom(SimpleHoster):
else:
self.fail("No or incorrect password")
- found = re.search(self.JS_KEY_PATTERN, self.html)
- try:
- result = self.js.eval(found.group(1))
- zmodulo = int(re.search(self.JS_ZMODULO_PATTERN, result).group(1))
- self.logDebug("ZMODULO: %d" % zmodulo)
- except Exception, e:
- self.logDebug(e)
- self.retry(3, 0, "Parse error (MODULO)")
+ links = re.findall(self.DOWNLOAD_LINK_PATTERN, self.html)
+ link_count = len(links)
+ self.logDebug('LINKS ', links)
- vlink = {'zindex': 0, 'href': ''}
- for found in re.finditer(self.DOWNLOAD_LINK_PATTERN, self.html):
- dlink = found.groupdict()
- #self.logDebug(dlink)
- dlink['zindex'] = int(dlink['zindex']) % zmodulo
- if dlink['zindex'] >= vlink['zindex']:
- vlink = dlink
-
- self.logDebug("DOWNLOAD LINK:", vlink)
- self.download(vlink['href'])
+ if link_count == 0:
+ self.retry(3, 0, "No links found")
+
+ elif link_count > 1:
+ found = re.search(self.JS_KEY_PATTERN, self.html)
+ try:
+ result = self.js.eval(found.group(1))
+ zmodulo = int(re.search(self.JS_ZMODULO_PATTERN, result).group(1))
+ self.logDebug("ZMODULO: %d" % zmodulo)
+ except Exception, e:
+ self.logDebug(e)
+ self.parseError("ZMODULO")
+
+ max_index = 0
+ for index, url in links:
+ index = int(index) % zmodulo
+ if index >= max_index:
+ download_url = url
+
+ self.logDebug("DOWNLOAD LINK:", download_url)
+
+ else:
+ zindex, download_url = links[0]
+
+ self.download(download_url)
def checkCaptcha(self):
for i in range(5):
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py
index 100553ebf..81d528668 100644
--- a/module/plugins/hoster/MegauploadCom.py
+++ b/module/plugins/hoster/MegauploadCom.py
@@ -65,7 +65,7 @@ class MegauploadCom(Hoster):
__name__ = "MegauploadCom"
__type__ = "hoster"
__pattern__ = r"http://[\w\.]*?(megaupload)\.com/.*?(\?|&)d=(?P<id>[0-9A-Za-z]+)"
- __version__ = "0.28"
+ __version__ = "0.31"
__description__ = """Megaupload.com Download Hoster"""
__author_name__ = ("spoob")
__author_mail__ = ("spoob@pyload.org")
@@ -74,6 +74,7 @@ class MegauploadCom(Hoster):
API_STATUS_MAPPING = {"0": statusMap['online'], "1": statusMap['offline'], "3": statusMap['temp. offline']}
FILE_URL_PATTERN = r'<a href="([^"]+)" class="download_regular_usual"'
+ PREMIUM_URL_PATTERN = r'href=\"(http://[^\"]*?)\" class=\"download_premium_but\">'
def init(self):
self.html = [None, None]
@@ -125,12 +126,12 @@ class MegauploadCom(Hoster):
if e.args and e.args[0] == 33:
# undirect download and resume , not a good idea
page = self.load(pyfile.url)
- self.download(re.search(r'href=\"(http://[^\"]*?)\" class=\"down_ad_butt1\">', page).group(1))
+ self.download(re.search(self.PREMIUM_URL_PATTERN, page).group(1))
return
else:
raise
- check = self.checkDownload({"dllink": re.compile(r'href=\"(http://[^\"]*?)\" class=\"down_ad_butt1\">')})
+ check = self.checkDownload({"dllink": re.compile(self.PREMIUM_URL_PATTERN)})
if check == "dllink":
self.log.warning(_("You should enable direct Download in your Megaupload Account settings"))
@@ -171,7 +172,7 @@ class MegauploadCom(Hoster):
if "The file that you're trying to download is larger than 1 GB" in self.html[0]:
self.fail(_("You need premium to download files larger than 1 GB"))
- if r'Please enter the password below' in self.html[0]:
+ if re.search(r'<input[^>]*name="filepassword"', self.html[0]):
pw = self.getPassword()
if not pw:
self.fail(_("The file is password protected, enter a password and restart."))
@@ -270,4 +271,4 @@ class MegauploadCom(Hoster):
if re.search("The password you have entered is not correct", self.html[1]):
self.fail(_("Wrong password for download link."))
- return True \ No newline at end of file
+ return True
diff --git a/module/plugins/hoster/MultishareCz.py b/module/plugins/hoster/MultishareCz.py
index a0dda30b8..af7aa94cf 100644
--- a/module/plugins/hoster/MultishareCz.py
+++ b/module/plugins/hoster/MultishareCz.py
@@ -24,7 +24,7 @@ class MultishareCz(SimpleHoster):
__name__ = "MultishareCz"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)?multishare.cz/stahnout/(?P<ID>\d+).*"
- __version__ = "0.34"
+ __version__ = "0.40"
__description__ = """MultiShare.cz"""
__author_name__ = ("zoidberg")
@@ -50,11 +50,12 @@ class MultishareCz(SimpleHoster):
self.download("http://www.multishare.cz/html/download_free.php?ID=%s" % self.fileID)
def handlePremium(self):
- if not self.checkCredit():
+ if not self.checkTrafficLeft():
self.logWarning("Not enough credit left to download file")
self.resetAccount()
self.download("http://www.multishare.cz/html/download_premium.php?ID=%s" % self.fileID)
+ self.checkTrafficLeft()
def handleOverriden(self):
if not self.premium:
@@ -63,18 +64,13 @@ class MultishareCz(SimpleHoster):
self.html = self.load('http://www.multishare.cz/html/mms_ajax.php', post = {"link": self.pyfile.url}, decode = True)
self.getFileInfo()
- if not self.checkCredit():
+ if not self.checkTrafficLeft():
self.fail("Not enough credit left to download file")
url = "http://dl%d.mms.multishare.cz/html/mms_process.php" % round(random()*10000*random())
params = {"u_ID" : self.acc_info["u_ID"], "u_hash" : self.acc_info["u_hash"], "link" : self.pyfile.url}
self.logDebug(url, params)
self.download(url, get = params)
-
- def checkCredit(self):
- self.acc_info = self.account.getAccountInfo(self.user, True)
- self.logInfo("User %s has %i MB left" % (self.user, self.acc_info["trafficleft"]/1024))
-
- return self.pyfile.size / 1024 <= self.acc_info["trafficleft"]
+ self.checkTrafficLeft()
getInfo = create_getInfo(MultishareCz) \ No newline at end of file
diff --git a/module/plugins/hoster/OneFichierCom.py b/module/plugins/hoster/OneFichierCom.py
index 3343c7c8c..16401891b 100644
--- a/module/plugins/hoster/OneFichierCom.py
+++ b/module/plugins/hoster/OneFichierCom.py
@@ -1,80 +1,29 @@
# -*- coding: utf-8 -*-
import re
+from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.plugins.Hoster import Hoster
-from module.network.RequestFactory import getURL
-
-
-def getInfo(urls):
- result = []
-
- for url in urls:
-
- # Get file info html
- id = re.match(OneFichierCom.__pattern__, url).group('id')
- url = 'http://%s.1fichier.com/en' % id # Force response in english
- html = getURL(url)
-
- # Offline?
- if re.search(OneFichierCom.FILE_OFFLINE_PATTERN, html):
- result.append((url, 0, 1, url))
- continue
-
- # Name
- for pattern in OneFichierCom.FILE_NAME_PATTERNS:
- m = re.search(pattern, html)
- if m is not None:
- name = m.group('name').strip()
-
- # Size
- m = re.search(OneFichierCom.FILE_SIZE_PATTERN, html)
- value = float(m.group('size'))
- units = m.group('units')[0].upper()
- pow = {'K' : 1, 'M' : 2, 'G' : 3}[units]
- size = int(value*1024**pow)
-
- # Return info
- result.append((name, size, 2, url))
-
- yield result
-
-
-class OneFichierCom(Hoster):
+class OneFichierCom(SimpleHoster):
__name__ = "OneFichierCom"
__type__ = "hoster"
- __pattern__ = r"http://(?P<id>[a-z0-9]+)\.1fichier\.com(?P<remain>.*)"
- __version__ = "0.3"
+ __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.4"
__description__ = """1fichier.com download hoster"""
- __author_name__ = ("fragonib")
- __author_mail__ = ("fragonib[AT]yahoo[DOT]es")
+ __author_name__ = ("fragonib", "the-razer", "zoidberg")
+ __author_mail__ = ("fragonib[AT]yahoo[DOT]es", "daniel_ AT gmx DOT net", "zoidberg@mujmail.cz")
+
+ FILE_NAME_PATTERN = r'">File name :</th>[\t\r\n ]+<td>(?P<N>.*?)</td>'
+ FILE_SIZE_PATTERN = r'<th>File size :</th>\s+<td>(?P<S>[\d\.]*) (?P<U>\w+)</td>'
+ FILE_OFFLINE_PATTERN = r'The (requested)? file (could not be found|has been deleted)'
+ FILE_URL_REPLACEMENTS = [(r'(http://[^/]*).*', r'\1/en/')]
- FILE_NAME_PATTERNS = (
- r'">File name :</th>[\t\r\n ]+<td>(?P<name>.*?)</td>',
- r">Click here to download (?P<name>.*?)</a>",
- r"content=\"Download the file named (?P<name>.*?)\">",
- r"<title>Download the file\s*:\s*(?P<name>.*?)</title>"
- )
- FILE_SIZE_PATTERN = r"<th>File size :</th>\s+<td>(?P<size>[\d\.]*) (?P<units>\w+)</td>"
- DOWNLOAD_LINK_PATTERN = r'<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;\s+<a href="(?P<url>http://.*?)"'
- FILE_OFFLINE_PATTERN = r"(The requested file could not be found|The file may has been deleted by its owner)"
+ 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"
-
- def setup(self):
- self.html = None
- self.multiDL = False
-
- def process(self, pyfile):
-
- # Get main page (english version)
- url = self.getEnglishURL()
- self.html = self.load(url)
- self.handleErrors()
-
- # Get file info
- pyfile.name = self.getFileName()
- pyfile.size = self.getFileSize()
+
+ def handleFree(self):
+ if self.WAITING_TOKEN in self.html:
+ self.waitAndRetry(60)
# Check for protection
if self.isProtected():
@@ -86,33 +35,7 @@ class OneFichierCom(Hoster):
self.download(downloadLink)
# Check download
- self.handleDownloadedFile()
-
- def getEnglishURL(self):
- id = re.match(self.__pattern__, self.pyfile.url).group('id')
- url = 'http://%s.1fichier.com/en' % id
- return url
-
- def getFileName(self):
- for pattern in self.FILE_NAME_PATTERNS:
- m = re.search(pattern, self.html)
- if m is not None:
- name = m.group('name').strip()
- self.logDebug("Got file name [%s]" % name)
- return name
-
- def getFileSize(self):
- m = re.search(self.FILE_SIZE_PATTERN, self.html)
- if m is not None:
- size = float(m.group('size'))
- units = m.group('units')[0].upper()
- try:
- multiplier = 1024 ** {"K":1, "M":2, "G":3}[units]
- except KeyError:
- multiplier = 1
- bytes = int(size * multiplier)
- self.logDebug("Got file size of [%s] bytes" % bytes)
- return bytes
+ self.checkDownloadedFile()
def isProtected(self):
if self.PASSWORD_PROTECTED_TOKEN in self.html:
@@ -126,16 +49,15 @@ class OneFichierCom(Hoster):
url = m.group('url')
self.logDebug("Got file URL [%s]" % url)
return url
-
- def handleErrors(self):
- if re.search(self.FILE_OFFLINE_PATTERN, self.html) is not None:
- self.logDebug("File not yet available.")
- self.offline()
- def handleDownloadedFile(self):
+ def checkDownloadedFile(self):
check = self.checkDownload({"wait": self.WAITING_TOKEN})
if check == "wait":
- wait = 5
- self.setWait(wait, True)
- self.wait()
- self.retry() \ No newline at end of file
+ self.waitAndRetry(60)
+
+ def waitAndRetry(self, wait_time):
+ self.setWait(wait_time, True)
+ self.wait()
+ self.retry()
+
+getInfo = create_getInfo(OneFichierCom) \ No newline at end of file
diff --git a/module/plugins/hoster/Premium4Me.py b/module/plugins/hoster/Premium4Me.py
new file mode 100644
index 000000000..cd47a9e91
--- /dev/null
+++ b/module/plugins/hoster/Premium4Me.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from urllib import quote
+from module.plugins.Hoster import Hoster
+
+class Premium4Me(Hoster):
+ __name__ = "Premium4Me"
+ __version__ = "0.10"
+ __type__ = "hoster"
+
+ __pattern__ = r"http://premium4.me/.*"
+ __description__ = """premium4.me hoster plugin"""
+ __author_name__ = ("RaNaN", "zoidberg")
+ __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz")
+
+ def setup(self):
+ self.resumeDownload = True
+ self.chunkLimit = 1
+
+ def process(self, pyfile):
+ if not self.account:
+ self.logError(_("Please enter your premium4.me account or deactivate this plugin"))
+ self.fail("No premium4.me account provided")
+
+ self.logDebug("premium4.me: Old URL: %s" % pyfile.url)
+
+ tra = self.getTraffic()
+
+ #raise timeout to 2min
+ self.req.setOption("timeout", 120)
+
+ self.download("http://premium4.me/api/getfile.php?authcode=%s&link=%s" % (self.account.authcode, quote(pyfile.url, "")), disposition=True)
+
+ err = ''
+ if self.req.http.code == '420':
+ # Custom error code send - fail
+ lastDownload = fs_encode(self.lastDownload)
+
+ if exists(lastDownload):
+ f = open(lastDownload, "rb")
+ err = f.read(256).strip()
+ f.close()
+ remove(lastDownload)
+ else:
+ err = 'File does not exist'
+
+ trb = self.getTraffic()
+ self.logInfo("Filesize: %d, Traffic used %d, traffic left %d" % (pyfile.size, tra-trb, trb))
+
+ if err: self.fail(err)
+
+ def getTraffic(self):
+ try:
+ traffic = int(self.load ("http://premium4.me/api/traffic.php?authcode=%s" % self.account.authcode))
+ except:
+ traffic = 0
+ return traffic \ No newline at end of file
diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py
index 53c5cd81f..6b699e39f 100644
--- a/module/plugins/hoster/UlozTo.py
+++ b/module/plugins/hoster/UlozTo.py
@@ -18,121 +18,119 @@
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
-from module.network.RequestFactory import getURL
+
+def convertDecimalPrefix(m):
+ # decimal prefixes used in filesize and traffic
+ return ("%%.%df" % {'k':3,'M':6,'G':9}[m.group(2)] % float(m.group(1))).replace('.','')
class UlozTo(SimpleHoster):
__name__ = "UlozTo"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/.*"
- __version__ = "0.74"
+ __version__ = "0.81"
__description__ = """uloz.to"""
- __config__ = [("reuseCaptcha", "bool", "Reuse captcha", "True"),
- ("captchaUser", "str", "captcha_user", ""),
- ("captchaNb", "str", "captcha_nb", "")]
__author_name__ = ("zoidberg")
- FILE_URL_PATTERN = r'<form name="dwn" action="([^"]+)"'
- FILE_NAME_PATTERN = r'<h2 class="nadpis" style="margin-left:196px;"><a href="[^"]+">(?P<N>[^<]+)</a></h2>'
- CAPTCHA_PATTERN = r'<img style=".*src="([^"]+)" alt="Captcha" class="captcha"'
- CAPTCHA_NB_PATTERN = r'<input class="captcha_nb" type="hidden" name="captcha_nb" value="([0-9]+)" >'
+ FILE_NAME_PATTERN = r'<a share_url="[^&]*&amp;t=(?P<N>[^"]+)"'
+ #FILE_NAME_PATTERN = r'<h2 class="nadpis" style="margin-left:196px;"><a href="[^"]+">(?P<N>[^<]+)</a></h2>'
+ FILE_SIZE_PATTERN = r'<div class="info_velikost" style="top:-55px;">\s*<div>[^<]*\s+(?P<S>[0-9.]+\s[kMG]B)\s*</div>\s*</div>'
+ FILE_SIZE_REPLACEMENTS = [('([0-9.]+)\s([kMG])B', convertDecimalPrefix)]
FILE_OFFLINE_PATTERN = r'http://www.uloz.to/(neexistujici|smazano|nenalezeno)'
+
PASSWD_PATTERN = r'<input type="password" class="text" name="file_password" id="frmfilepasswordForm-file_password" />'
- LIVE_URL_PATTERN = r'<div id="flashplayer"[^>]*>\s*<a href="([^"]+)"'
- LIVE_NAME_PATTERN = r'<a share_url="[^&]*&amp;t=([^"]+)"'
- FILE_SIZE_PATTERN = r'<div class="info_velikost" style="top:-55px;">\s*<div>[^<]*\s+(?P<S>[0-9.]+)\s(?P<U>[kKMG])i?B\s*</div>\s*</div>'
- VIPLINK_PATTERN = r'<a href="[^"]*\?disclaimer=1" class="linkVip">'
-
- def setup(self):
- self.multiDL = False
+ VIPLINK_PATTERN = r'<a href="[^"]*\?disclaimer=1" class="linkVip">'
+ FREE_URL_PATTERN = r'<form name="dwn" action="([^"]+)"'
+ PREMIUM_URL_PATTERN = r'<a onclick[^>]*href="([^"]+)[^>]*class="linkVip"'
+ CAPTCHA_PATTERN = r'<img style=".*src="([^"]+)" alt="Captcha" class="captcha"'
+ CAPTCHA_NB_PATTERN = r'<input class="captcha_nb" type="hidden" name="captcha_nb" value="([0-9]+)" >'
def process(self, pyfile):
+ # check file online
header = self.load(pyfile.url, just_header=True)
if "location" in header:
self.logDebug('LOCATION: ' + header['location'])
if "utm_source=old" in header['location'] or re.search(self.FILE_OFFLINE_PATTERN, header['location']):
- self.offline()
-
+ self.offline()
+
self.html = self.load(pyfile.url, decode=True)
- if self.PASSWD_PATTERN in self.html:
- self.fail("Password protected link")
-
+ # password protected links
+ passwords = self.getPassword().splitlines()
+ while self.PASSWD_PATTERN in self.html:
+ if passwords:
+ password = passwords.pop(0)
+ self.logInfo("Password protected link, trying " + password)
+ self.html = self.load(pyfile.url, get = {"do": "filepasswordForm-submit"}, post={"file_password": password, "fpwdsend": 'Odeslat'}, cookies=True)
+ else:
+ self.fail("No or incorrect password")
+
+ self.file_info = self.getFileInfo()
+
+ # adult content
if re.search(self.VIPLINK_PATTERN, self.html):
self.html = self.load(pyfile.url, get={"disclaimer": "1"})
+
+ if self.premium and self.checkTrafficLeft():
+ self.handlePremium()
+ else:
+ self.handleFree()
+
+ def handleFree(self):
+ parsed_url = self.findDownloadURL(premium=False)
+
+ # get and decrypt captcha
+ captcha = self.getStorage("captchaUser")
+ captcha_nb = self.getStorage("captchaNb")
+ captcha_url = "DUMMY"
+
+ if not captcha or not captcha_nb:
+ found = re.search(self.CAPTCHA_PATTERN, self.html)
+ if not found: self.parseError("CAPTCHA")
+ captcha_url = found.group(1)
+
+ found = re.search(self.CAPTCHA_NB_PATTERN, self.html)
+ if not found: self.parseError("CAPTCHA_NB")
+ captcha_nb = found.group(1)
+
+ captcha = self.decryptCaptcha(captcha_url)
+
+ self.log.debug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha + ' CAPTCHA_NB:' + captcha_nb)
- found = re.search(self.LIVE_URL_PATTERN, self.html)
- if found is not None:
- # Uloz.to LIVE
- parsed_url = found.group(1)
- self.logDebug("LIVE URL:" + parsed_url)
-
- found = re.search(self.LIVE_NAME_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (LIVE_NAME)")
- pyfile.name = found.group(1)
- self.log.debug("LIVE NAME:" + pyfile.name)
-
- self.download(parsed_url)
- else:
- # Uloz.to DATA
- # parse the name from the site and set attribute in pyfile
- found = re.search(self.FILE_NAME_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (FILENAME)")
- pyfile.name = found.group(1)
- self.log.debug("PARSED_NAME:" + pyfile.name)
-
- found = re.search(self.FILE_URL_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (URL)")
- parsed_url = found.group(1)
- self.log.debug("PARSED_URL:" + parsed_url)
-
- # get and decrypt captcha
- reuse_captcha = self.getConfig("reuseCaptcha")
- captcha = self.getConfig("captchaUser")
- captcha_nb = self.getConfig("captchaNb")
- captcha_url = "DUMMY"
-
- if not reuse_captcha or not captcha or not captcha_nb:
- found = re.search(self.CAPTCHA_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (CAPTCHA)")
- captcha_url = found.group(1)
- captcha = self.decryptCaptcha(captcha_url)
- found = re.search(self.CAPTCHA_NB_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (CAPTCHA_NB)")
- captcha_nb = found.group(1)
- self.log.debug('CAPTCHA_URL:' + captcha_url + ' CAPTCHA:' + captcha + ' CAPTCHA_NB:' + captcha_nb)
-
- # download the file, destination is determined by pyLoad
- self.download(parsed_url, post={
- "captcha_user": captcha,
- "captcha_nb": captcha_nb
- })
-
- check = self.checkDownload({
- "wrong_captcha": re.compile(self.CAPTCHA_PATTERN),
- "offline": re.compile(self.FILE_OFFLINE_PATTERN),
- "passwd": self.PASSWD_PATTERN
- })
-
- if check == "wrong_captcha":
- if reuse_captcha:
- self.setConfig("captchaUser", "")
- self.setConfig("captchaNb", "")
- self.invalidCaptcha()
- self.retry(reason="Wrong captcha code")
- elif check == "offline":
- self.offline()
- elif check == "passwd":
- self.fail("Password protected")
-
- if reuse_captcha:
- self.setConfig("captchaUser", captcha)
- self.setConfig("captchaNb", captcha_nb)
-
-getInfo = create_getInfo(UlozTo)
-
- \ No newline at end of file
+ # download and check
+ self.download(parsed_url, post={"captcha_user": captcha, "captcha_nb": captcha_nb}, cookies=True)
+ self.doCheckDownload()
+
+ self.setStorage("captchaUser", captcha)
+ self.setStorage("captchaNb", captcha_nb)
+
+ def handlePremium(self):
+ parsed_url = self.findDownloadURL(premium=True)
+ self.download(parsed_url)
+ self.doCheckDownload()
+
+ def findDownloadURL(self, premium=False):
+ msg = "%s link" % ("Premium" if premium else "Free")
+ found = re.search(self.PREMIUM_URL_PATTERN if premium else self.FREE_URL_PATTERN, self.html)
+ if not found: self.parseError(msg)
+ parsed_url = found.group(1)
+ self.logDebug("%s: %s" % (msg, parsed_url))
+ return parsed_url
+
+ def doCheckDownload(self):
+ check = self.checkDownload({
+ "wrong_captcha": re.compile(self.CAPTCHA_PATTERN),
+ "offline": re.compile(self.FILE_OFFLINE_PATTERN),
+ "passwd": self.PASSWD_PATTERN
+ })
+
+ if check == "wrong_captcha":
+ self.delStorage("captchaUser")
+ self.delStorage("captchaNb")
+ self.invalidCaptcha()
+ self.retry(reason="Wrong captcha code")
+ elif check == "offline":
+ self.offline()
+ elif check == "passwd":
+ self.fail("Wrong password")
+
+getInfo = create_getInfo(UlozTo) \ No newline at end of file
diff --git a/module/plugins/hoster/WuploadCom.py b/module/plugins/hoster/WuploadCom.py
index 11b61ae59..ffb082cbe 100644
--- a/module/plugins/hoster/WuploadCom.py
+++ b/module/plugins/hoster/WuploadCom.py
@@ -3,11 +3,12 @@
import re
import string
+from urllib import unquote
from types import MethodType
from module.plugins.Hoster import Hoster
-from module.plugins.Plugin import chunks
+from module.utils import chunks
from module.network.RequestFactory import getURL
from module.common.json_layer import json_loads
@@ -31,7 +32,7 @@ def getInfo(urls):
if item["status"] != "AVAILABLE":
result.append((None, 0, 1, ids[str(item["id"])]))
else:
- result.append((item["filename"], item["size"], 2, ids[str(item["id"])]))
+ result.append((unquote(item["filename"]), item["size"], 2, ids[str(item["id"])]))
yield result
@@ -47,7 +48,7 @@ class WuploadCom(Hoster):
__name__ = "WuploadCom"
__type__ = "hoster"
__pattern__ = r"http://[\w\.]*?wupload\..*?/file/(([a-z][0-9]+/)?[0-9]+)(/.*)?"
- __version__ = "0.1"
+ __version__ = "0.2"
__description__ = """Wupload com"""
__author_name__ = ("jeix", "paulking")
__author_mail__ = ("jeix@hasnomail.de", "")