From 6eee397f5bb655b49059f1027499d0f25b0615d7 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Fri, 20 Apr 2012 01:05:23 +0200 Subject: update uloz.to, uploading.com - closed #466 --- module/plugins/hoster/UlozTo.py | 14 +++++++++----- module/plugins/hoster/UploadingCom.py | 31 +++++++++++++++++++------------ 2 files changed, 28 insertions(+), 17 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index 54138e7e5..de60cb7c7 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -27,14 +27,14 @@ class UlozTo(SimpleHoster): __name__ = "UlozTo" __type__ = "hoster" __pattern__ = r"http://(\w*\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj.cz|zachowajto.pl)/(?:live/)?(?P\w+/[^/?]*)" - __version__ = "0.85" + __version__ = "0.86" __description__ = """uloz.to""" __author_name__ = ("zoidberg") FILE_NAME_PATTERN = r'(?P[^<]+)' FILE_SIZE_PATTERN = r'(?P[^<]+)' FILE_INFO_PATTERN = r'

File (?P[^<]+) is password protected

' - FILE_OFFLINE_PATTERN = r'404 - Page not found|

File was banned

' + FILE_OFFLINE_PATTERN = r'404 - Page not found|

File (has been deleted|was banned)

' FILE_SIZE_REPLACEMENTS = [('([0-9.]+)\s([kMG])B', convertDecimalPrefix)] FILE_URL_REPLACEMENTS = [(r"(?<=http://)([^/]+)", "www.ulozto.net")] @@ -75,8 +75,10 @@ class UlozTo(SimpleHoster): self.doCheckDownload() def handleFree(self): - parsed_url = self.findDownloadURL(premium=False) - + action, inputs = self.parseHtmlForm('id="frm-downloadDialog-freeDownloadForm"') + if not action or not inputs: + self.parseError("free download form") + # get and decrypt captcha captcha_id = self.getStorage("captcha_id") captcha_text = self.getStorage("captcha_text") @@ -95,7 +97,9 @@ class UlozTo(SimpleHoster): self.setStorage("captcha_text", captcha_text) self.multiDL = True - self.download(parsed_url, post={"captcha[id]": captcha_id, "captcha[text]": captcha_text, "freeDownload": "Download"}, cookies=True) + inputs.update({"captcha[id]": captcha_id, "captcha[text]": captcha_text}) + + self.download("http://www.ulozto.net" + action, post=inputs, cookies=True) def handlePremium(self): parsed_url = self.findDownloadURL(premium=True) diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index 1278bfc01..ccb628e77 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -18,20 +18,21 @@ """ import re +from pycurl import FOLLOWLOCATION from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp class UploadingCom(SimpleHoster): __name__ = "UploadingCom" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?uploading\.com/files/(?:get/)?[\w\d]+/?" - __version__ = "0.30" + __version__ = "0.31" __description__ = """Uploading.Com File Download Hoster""" __author_name__ = ("jeix", "mkaay", "zoidberg") __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz") FILE_NAME_PATTERN = r'Download (?P<N>.*?) for free on uploading.com' FILE_SIZE_PATTERN = r'File size: (?P.*?)' - FILE_OFFLINE_PATTERN = r'

The requested file is not found

' + FILE_OFFLINE_PATTERN = r'The requested file is not found' def process(self, pyfile): # set lang to english @@ -47,11 +48,9 @@ class UploadingCom(SimpleHoster): self.file_info = self.getFileInfo() if self.premium: - url = self.handlePremium() + self.handlePremium() else: - url = self.handleFree() - - self.download(url) + self.handleFree() def handlePremium(self): postData = {'action': 'get_link', @@ -61,7 +60,8 @@ class UploadingCom(SimpleHoster): self.html = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData) url = re.search(r'"link"\s*:\s*"(.*?)"', self.html) if url: - return url.group(1).replace("\\/", "/") + url = url.group(1).replace("\\/", "/") + self.download(url) raise Exception("Plugin defect.") @@ -100,11 +100,18 @@ class UploadingCom(SimpleHoster): captcha_url = "http://uploading.com/general/captcha/download%s/?ts=%d" % (self.fileid, timestamp()) postData['captcha_code'] = self.decryptCaptcha(captcha_url) - self.html = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData) + self.html = self.load('http://uploading.com/files/get/?ajax', post=postData) url = re.search(r'"link"\s*:\s*"(.*?)"', self.html) - if url: - return url.group(1).replace("\\/", "/") - - raise Exception("Plugin defect.") + if not url: + self.pluginParseError("URL") + + url = url.group(1).replace("\\/", "/") + self.download(url) + + check = self.checkDownload({"html" : re.compile("\A