diff options
Diffstat (limited to 'module/plugins/hoster')
| -rw-r--r-- | module/plugins/hoster/DateiTo.py | 4 | ||||
| -rw-r--r-- | module/plugins/hoster/LinksnappyCom.py | 2 | ||||
| -rw-r--r-- | module/plugins/hoster/OpenloadIo.py | 8 | ||||
| -rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 26 | ||||
| -rw-r--r-- | module/plugins/hoster/SoundcloudCom.py | 2 | ||||
| -rw-r--r-- | module/plugins/hoster/UlozTo.py | 10 | ||||
| -rw-r--r-- | module/plugins/hoster/UnibytesCom.py | 7 | ||||
| -rw-r--r-- | module/plugins/hoster/Xdcc.py | 1 | ||||
| -rw-r--r-- | module/plugins/hoster/YadiSk.py | 2 | 
9 files changed, 34 insertions, 28 deletions
diff --git a/module/plugins/hoster/DateiTo.py b/module/plugins/hoster/DateiTo.py index 42aed2c77..7cc22158d 100644 --- a/module/plugins/hoster/DateiTo.py +++ b/module/plugins/hoster/DateiTo.py @@ -35,7 +35,7 @@ class DateiTo(SimpleHoster):          data = {'P': 'I', 'ID': self.info['pattern']['ID']}          recaptcha = ReCaptcha(self) -        for _i in xrange(10): +        for _i in xrange(3):              self.log_debug("URL", url, "POST", data)              self.html = self.load(url, post=data)              self.check_errors() @@ -57,7 +57,7 @@ class DateiTo(SimpleHoster):              if url.endswith('recaptcha.php'):                  data['recaptcha_response_field'], data['recaptcha_challenge_field'] = recaptcha.challenge()          else: -            self.fail(_("Too bad...")) +            return          self.link = self.html diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index f92681f60..3301eda7c 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -46,7 +46,7 @@ class LinksnappyCom(MultiHoster):      @staticmethod      def _get_host(url):          host = urlparse.urlsplit(url).netloc -        return re.search(r'[\w-]+\.\w+$', host).group(0) +        return re.search(r'[\w\-]+\.\w+$', host).group(0)  getInfo = create_getInfo(LinksnappyCom) diff --git a/module/plugins/hoster/OpenloadIo.py b/module/plugins/hoster/OpenloadIo.py index 6213a9c09..ee67be95b 100644 --- a/module/plugins/hoster/OpenloadIo.py +++ b/module/plugins/hoster/OpenloadIo.py @@ -10,10 +10,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo  class OpenloadIo(SimpleHoster):      __name__    = "OpenloadIo"      __type__    = "hoster" -    __version__ = "0.07" +    __version__ = "0.08"      __status__  = "testing" -    __pattern__ = r'https?://(?:www\.)?openload\.(?:co|io)/f/([\w-_]+)' +    __pattern__ = r'https?://(?:www\.)?openload\.(?:co|io)/(?:f|embed)/([\w\-]+)'      __description__ = """Openload.co hoster plugin"""      __license__     = "GPLv3" @@ -23,12 +23,14 @@ class OpenloadIo(SimpleHoster):      # The API reference, that this implementation uses is available at https://openload.co/api      API_URL = 'https://api.openload.co/1' -    _FILE_ID_PATTERN = '/f/([\w-_]+)' +    _FILE_ID_PATTERN = '/(?:f|embed)/([\w\-]+)'      _DOWNLOAD_TICKET_URI_PATTERN = '/file/dlticket?file={0}'      _DOWNLOAD_FILE_URI_PATTERN   = '/file/dl?file={0}&ticket={1}'      _FILE_INFO_URI_PATTERN       = '/file/info?file={0}' +    OFFLINE_PATTERN = r'>We are sorry' +      @classmethod      def _load_json(cls, uri): diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 2223068e5..96fec2b48 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo  class ShareonlineBiz(SimpleHoster):      __name__    = "ShareonlineBiz"      __type__    = "hoster" -    __version__ = "0.58" +    __version__ = "0.59"      __status__  = "testing"      __pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download\.php\?id=|dl/)(?P<ID>\w+)' @@ -45,11 +45,11 @@ class ShareonlineBiz(SimpleHoster):          try:              if field[1] == "OK": -                info['fileid']   = field[0] -                info['status']   = 2 -                info['name']     = field[2] -                info['size']     = field[3]  #: In bytes -                info['md5']      = field[4].strip().lower().replace("\n\n", "")  #: md5 +                info['fileid'] = field[0] +                info['status'] = 2 +                info['name']   = field[2] +                info['size']   = field[3]  #: In bytes +                info['md5']    = field[4].strip().lower().replace("\n\n", "")  #: md5              elif field[1] in ("DELETED", "NOTFOUND"):                  info['status'] = 1 @@ -102,7 +102,7 @@ class ShareonlineBiz(SimpleHoster):      def check_download(self):          check = self.check_file({'cookie': re.compile(r'<div id="dl_failure"'), -                                    'fail'  : re.compile(r"<title>Share-Online")}) +                                 'fail'  : re.compile(r"<title>Share-Online")})          if check == "cookie":              self.retry_captcha(5, 60, _("Cookie failure")) @@ -114,19 +114,23 @@ class ShareonlineBiz(SimpleHoster):      def handle_premium(self, pyfile):  #: Should be working better loading (account) api internally +        self.api_data = dlinfo = {} +          html = self.load("https://api.share-online.biz/account.php",                           get={'username': self.account.user,                                'password': self.account.get_login('password'),                                'act'     : "download",                                'lid'     : self.info['fileid']}) -        self.api_data = dlinfo = {} +        self.log_debug(html)          for line in html.splitlines(): -            key, value = line.split(": ") -            dlinfo[key.lower()] = value +            try: +                key, value = line.split(": ") +                dlinfo[key.lower()] = value -        self.log_debug(dlinfo) +            except ValueError: +                pass          if dlinfo['status'] != "online":              self.offline() diff --git a/module/plugins/hoster/SoundcloudCom.py b/module/plugins/hoster/SoundcloudCom.py index b189ee1ba..a7a45d028 100644 --- a/module/plugins/hoster/SoundcloudCom.py +++ b/module/plugins/hoster/SoundcloudCom.py @@ -12,7 +12,7 @@ class SoundcloudCom(SimpleHoster):      __version__ = "0.12"      __status__  = "testing" -    __pattern__ = r'https?://(?:www\.)?soundcloud\.com/[\w-]+/[\w-]+' +    __pattern__ = r'https?://(?:www\.)?soundcloud\.com/[\w\-]+/[\w\-]+'      __config__  = [("use_premium", "bool"        , "Use premium account if available", True    ),                     ("quality"    , "Lower;Higher", "Quality"                         , "Higher")] diff --git a/module/plugins/hoster/UlozTo.py b/module/plugins/hoster/UlozTo.py index cc07770d4..b0df1d97f 100644 --- a/module/plugins/hoster/UlozTo.py +++ b/module/plugins/hoster/UlozTo.py @@ -4,6 +4,7 @@ import re  import time  from module.common.json_layer import json_loads +from module.plugins.internal.Plugin import timestamp  from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo @@ -68,13 +69,14 @@ class UlozTo(SimpleHoster):              self.log_debug('Using "new" version')              xapca = self.load("http://www.ulozto.net/reloadXapca.php", -                              get={'rnd': str(int(time.time()))}) +                              get={'rnd': timestamp()}) +              xapca = xapca.replace('sound":"', 'sound":"http:').replace('image":"', 'image":"http:') -            self.log_debug("xapca = %s" % xapca) +            self.log_debug("xapca: %s" % xapca)              data = json_loads(xapca) -            captcha_value = self.captcha.decrypt(str(data['image'])) -            self.log_debug("CAPTCHA HASH: " + data['hash'], "CAPTCHA SALT: " + str(data['salt']), "CAPTCHA VALUE: " + captcha_value) +            captcha_value = self.captcha.decrypt(data['image']) +            self.log_debug("CAPTCHA HASH: " + data['hash'], "CAPTCHA SALT: %s" % data['salt'], "CAPTCHA VALUE: " + captcha_value)              inputs.update({'timestamp': data['timestamp'], 'salt': data['salt'], 'hash': data['hash'], 'captcha_value': captcha_value}) diff --git a/module/plugins/hoster/UnibytesCom.py b/module/plugins/hoster/UnibytesCom.py index 50006dd27..6af02438f 100644 --- a/module/plugins/hoster/UnibytesCom.py +++ b/module/plugins/hoster/UnibytesCom.py @@ -35,7 +35,7 @@ class UnibytesCom(SimpleHoster):          self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 0) -        for _i in xrange(8): +        for _i in xrange(3):              self.log_debug(action, post_data)              self.html = self.load(urlparse.urljoin(domain, action), post=post_data) @@ -46,7 +46,7 @@ class UnibytesCom(SimpleHoster):              if '>Somebody else is already downloading using your IP-address<' in self.html:                  self.wait(10 * 60, True) -                self.retry() +                self.restart(premium=True)              if post_data['step'] == "last":                  m = re.search(self.LINK_FREE_PATTERN, self.html) @@ -67,9 +67,6 @@ class UnibytesCom(SimpleHoster):              elif last_step in ("captcha", "last"):                  post_data['captcha'] = self.captcha.decrypt(urlparse.urljoin(domain, "captcha.jpg")) -        else: -            self.fail(_("No valid captcha code entered")) -          self.req.http.c.setopt(pycurl.FOLLOWLOCATION, 1) diff --git a/module/plugins/hoster/Xdcc.py b/module/plugins/hoster/Xdcc.py index 098143751..4ea286eb8 100644 --- a/module/plugins/hoster/Xdcc.py +++ b/module/plugins/hoster/Xdcc.py @@ -43,6 +43,7 @@ class Xdcc(Hoster):                  nmn = self.do_download(pyfile.url)                  self.log_debug("Download of %s finished." % nmn)                  return +              except socket.error, e:                  if hasattr(e, "errno"):                      errno = e.errno diff --git a/module/plugins/hoster/YadiSk.py b/module/plugins/hoster/YadiSk.py index 354ba1b4c..418f38926 100644 --- a/module/plugins/hoster/YadiSk.py +++ b/module/plugins/hoster/YadiSk.py @@ -13,7 +13,7 @@ class YadiSk(SimpleHoster):      __version__ = "0.06"      __status__  = "testing" -    __pattern__ = r'https?://yadi\.sk/d/[\w-]+' +    __pattern__ = r'https?://yadi\.sk/d/[\w\-]+'      __description__ = """Yadi.sk hoster plugin"""      __license__     = "GPLv3"  | 
