diff options
| author | 2012-04-20 01:05:23 +0200 | |
|---|---|---|
| committer | 2012-04-20 01:05:23 +0200 | |
| commit | 6eee397f5bb655b49059f1027499d0f25b0615d7 (patch) | |
| tree | 70d72caf6d70380ab42179c4a936d533fa2493bd /module/plugins | |
| parent | closed #571 should fix the error message (diff) | |
| download | pyload-6eee397f5bb655b49059f1027499d0f25b0615d7.tar.xz | |
update uloz.to, uploading.com - closed #466
Diffstat (limited to 'module/plugins')
| -rw-r--r-- | module/plugins/hoster/UlozTo.py | 14 | ||||
| -rw-r--r-- | module/plugins/hoster/UploadingCom.py | 31 | 
2 files changed, 28 insertions, 17 deletions
| 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<id>\w+/[^/?]*)" -    __version__ = "0.85" +    __version__ = "0.86"      __description__ = """uloz.to"""      __author_name__ = ("zoidberg")      FILE_NAME_PATTERN = r'<a href="#download" class="jsShowDownload">(?P<N>[^<]+)</a>'      FILE_SIZE_PATTERN = r'<span id="fileSize">(?P<S>[^<]+)</span>'      FILE_INFO_PATTERN = r'<p>File <strong>(?P<N>[^<]+)</strong> is password protected</p>' -    FILE_OFFLINE_PATTERN = r'<title>404 - Page not found</title>|<h1 class="h1">File was banned</h1>' +    FILE_OFFLINE_PATTERN = r'<title>404 - Page not found</title>|<h1 class="h1">File (has been deleted|was banned)</h1>'      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'<title>Download (?P<N>.*?) for free on uploading.com</title>'
      FILE_SIZE_PATTERN = r'<span>File size: (?P<S>.*?)</span>'
 -    FILE_OFFLINE_PATTERN = r'<h2 style=".*?">The requested file is not found</h2>'
 +    FILE_OFFLINE_PATTERN = r'<h2.*?>The requested file is not found</h2>'
      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<!DOCTYPE html PUBLIC")})
 +        if check == "html":
 +            self.logWarning("Redirected to a HTML page, wait 10 minutes and retry")
 +            self.setWait(600, True)
 +            self.wait()
  getInfo = create_getInfo(UploadingCom)
\ No newline at end of file | 
