diff options
| author | 2012-08-10 23:33:29 +0200 | |
|---|---|---|
| committer | 2012-08-10 23:33:29 +0200 | |
| commit | a1b042fa6d3631ba71cbbeca18e956659dde96dc (patch) | |
| tree | 3263f034c62890f502a536b574cc90a291df9d3f /module/plugins | |
| parent | easybytez.com -- closed #625 (diff) | |
| download | pyload-a1b042fa6d3631ba71cbbeca18e956659dde96dc.tar.xz | |
update uploading.com
Diffstat (limited to 'module/plugins')
| -rw-r--r-- | module/plugins/accounts/RealdebridCom.py | 4 | ||||
| -rw-r--r-- | module/plugins/hooks/ImageTyperz.py | 14 | ||||
| -rw-r--r-- | module/plugins/hoster/UploadingCom.py | 55 | 
3 files changed, 33 insertions, 40 deletions
| diff --git a/module/plugins/accounts/RealdebridCom.py b/module/plugins/accounts/RealdebridCom.py index 3137987a9..adbd090db 100644 --- a/module/plugins/accounts/RealdebridCom.py +++ b/module/plugins/accounts/RealdebridCom.py @@ -3,7 +3,7 @@ import xml.dom.minidom as dom  class RealdebridCom(Account):
      __name__ = "RealdebridCom"
 -    __version__ = "0.4"
 +    __version__ = "0.41"
      __type__ = "account"
      __description__ = """Real-Debrid.com account plugin"""
      __author_name__ = ("Devirex, Hazzard")
 @@ -18,7 +18,7 @@ class RealdebridCom(Account):          return account_info
      def login(self, user, data, req):
 -        page = req.load("https://real-debrid.com/ajax/login.php?user=%s&pass=%s" % (user, data["password"]))
 +        page = req.load("https://real-debrid.com/ajax/login.php", get = {"user": user, "pass": data["password"]})
          #page = req.load("https://real-debrid.com/login.html", post={"user": user, "pass": data["password"]}, cookies=True)
          if "Your login informations are incorrect" in page:
 diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 5edde0a8a..f27eccf26 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -39,7 +39,7 @@ class ImageTyperzException(Exception):  class ImageTyperz(Hook):      __name__ = "ImageTyperz" -    __version__ = "0.01" +    __version__ = "0.02"      __description__ = """send captchas to ImageTyperz.com"""      __config__ = [("activated", "bool", "Activated", True),                    ("username", "str", "Username", ""), @@ -120,12 +120,12 @@ class ImageTyperz(Hook):      def captchaInvalid(self, task):          if task.data['service'] == self.__name__ and "ticket" in task.data: -            response = self.getURL(self.RESPOND_URL, -                                   post={"action": "SETBADIMAGE", -                                         "username": self.getConfig("username"), -                                         "password": self.getConfig("passkey"), -                                         "imageid": task.data["ticket"]} -                                  ) +            response = getURL(self.RESPOND_URL, +                              post={"action": "SETBADIMAGE", +                                    "username": self.getConfig("username"), +                                    "password": self.getConfig("passkey"), +                                    "imageid": task.data["ticket"]} +                              )              if not response == "SUCCESS":                  self.logError(("Refund request failed"), response)  diff --git a/module/plugins/hoster/UploadingCom.py b/module/plugins/hoster/UploadingCom.py index ccb628e77..4a157a787 100644 --- a/module/plugins/hoster/UploadingCom.py +++ b/module/plugins/hoster/UploadingCom.py @@ -18,14 +18,15 @@  """
  import re
 -from pycurl import FOLLOWLOCATION
 +from pycurl import HTTPHEADER
  from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, timestamp
 +from module.common.json_layer import json_loads
  class UploadingCom(SimpleHoster):
      __name__ = "UploadingCom"
      __type__ = "hoster"
 -    __pattern__ = r"http://(?:www\.)?uploading\.com/files/(?:get/)?[\w\d]+/?"
 -    __version__ = "0.31"
 +    __pattern__ = r"http://(?:www\.)?uploading\.com/files/(?:get/)?(?P<ID>[\w\d]+)"
 +    __version__ = "0.32"
      __description__ = """Uploading.Com File Download Hoster"""
      __author_name__ = ("jeix", "mkaay", "zoidberg")
      __author_mail__ = ("jeix@hasnomail.de", "mkaay@mkaay.de", "zoidberg@mujmail.cz")
 @@ -54,7 +55,7 @@ class UploadingCom(SimpleHoster):      def handlePremium(self):
          postData = {'action': 'get_link',
 -                    'code': re.search('code: "(.*?)",', self.html).group(1),
 +                    'code': self.file_info['ID'],
                      'pass': 'undefined'}
          self.html = self.load('http://uploading.com/files/get/?JsHttpRequest=%d-xml' % timestamp(), post=postData)
 @@ -72,40 +73,32 @@ class UploadingCom(SimpleHoster):              self.logWarning(self.pyfile.error)
              self.retry(max_tries=6, wait_time = 21600 if found.group(2) else 900, reason = self.pyfile.error)  
 -        self.code   = re.search(r'name="code" value="(.*?)"', self.html).group(1)
 -        self.fileid = re.search(r'name="file_id" value="(.*?)"', self.html).group(1)
 +        ajax_url = "http://uploading.com/files/get/?ajax"
 +        self.req.http.c.setopt(HTTPHEADER, ["X-Requested-With: XMLHttpRequest"])
 +        self.req.http.lastURL = self.pyfile.url
 -        postData = {'action': 'second_page',
 -                    'code': self.code,
 -                    'file_id': self.fileid}
 -
 -        self.html = self.load(self.pyfile.url, post=postData)
 -        
 -        wait_time = re.search(r'timead_counter">(\d+)<', self.html)
 -        if not wait_time:
 -            wait_time = re.search(r'start_timer\((\d+)\)', self.html)
 -            
 -        if wait_time:
 -            wait_time = int(wait_time.group(1))
 +        response = json_loads(self.load(ajax_url, post = {'action': 'second_page', 'code': self.file_info['ID']}))        
 +        if 'answer' in response and 'wait_time' in response['answer']:
 +            wait_time = int(response['answer']['wait_time'])
              self.log.info("%s: Waiting %d seconds." % (self.__name__, wait_time))
              self.setWait(wait_time)
              self.wait()
 +        else:
 +            self.pluginParseError("AJAX/WAIT")
 -        
 -        postData = {'action': 'get_link',
 -                    'code': self.code,
 -                    'pass': 'undefined'}
 -
 -        if r'var captcha_src' in self.html[1]:
 -            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/?ajax', post=postData)
 -        url = re.search(r'"link"\s*:\s*"(.*?)"', self.html)
 -        if not url:
 +        response = json_loads(self.load(ajax_url, post = {'action': 'get_link', 'code': self.file_info['ID'], 'pass': 'false'}))
 +        if 'answer' in response and 'link' in response['answer']:
 +            url = response['answer']['link']
 +        else:
 +            self.pluginParseError("AJAX/URL")
 +            
 +        self.html = self.load(url)
 +        found = re.search(r'<form id="file_form" action="(.*?)"', self.html)
 +        if found:
 +            url = found.group(1)
 +        else:
              self.pluginParseError("URL")
 -        url = url.group(1).replace("\\/", "/")
          self.download(url)
          check = self.checkDownload({"html" : re.compile("\A<!DOCTYPE html PUBLIC")})
 | 
