diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-02-03 00:47:08 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-02-03 00:47:08 +0100 |
commit | d4751c2d0797796af14c4a8ab0746eba91cebc99 (patch) | |
tree | 2d2f4a7f027d6fc5697fd08e70965bb02c58d775 /module/plugins/hoster/YibaishiwuCom.py | |
parent | fix linkdecrypter hook, add 115.com (diff) | |
download | pyload-d4751c2d0797796af14c4a8ab0746eba91cebc99.tar.xz |
fix ul.to
Diffstat (limited to 'module/plugins/hoster/YibaishiwuCom.py')
-rw-r--r-- | module/plugins/hoster/YibaishiwuCom.py | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index be4742715..5926cc227 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ class YibaishiwuCom(SimpleHoster): __name__ = "YibaishiwuCom" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?(?:u\.)?115.com/file/(?P<ID>\w+)" - __version__ = "0.1" + __version__ = "0.11" __description__ = """115.com""" __author_name__ = ("zoidberg") @@ -32,24 +32,16 @@ class YibaishiwuCom(SimpleHoster): FILE_SIZE_PATTERN = r"file_size: '(?P<S>[^']+)'" FILE_OFFLINE_PATTERN = ur'<h3><i style="color:red;">哎呀!提取码不存在!不妨搜搜看吧!</i></h3>' - AJAX_GUEST_URL_PATTERN = r'url: "(/\?ct=pickcode[^"]+)"' - AJAX_FREEUSER_URL_PATTERN = r'url: "(/\?ct=download&ac=get^"]+)"' + AJAX_URL_PATTERN = r'(/\?ct=(pickcode|download)[^"\']+)' def handleFree(self): - url = False - if self.account: - found = re.search(self.AJAX_FREEUSER_URL_PATTERN, self.html) - if found: - url = found.group(1) - self.logDebug('FREEUSER URL: ' + url) - if not url: - found = re.search(self.AJAX_GUEST_URL_PATTERN, self.html) - if not found: self.parseError("AJAX URL") - url = found.group(1) - self.logDebug('GUEST URL: ' + url) + found = re.search(self.AJAX_URL_PATTERN, self.html) + if not found: self.parseError("AJAX URL") + url = found.group(1) + self.logDebug(('FREEUSER' if found.group(2) == 'download' else 'GUEST') + ' URL', url) response = json_loads(self.load("http://115.com" + url, decode = False)) - for mirror in response['data']: + for mirror in (response['urls'] if 'urls' in response else response['data'] if 'data' in response else []): try: url = mirror['url'].replace('\\','') self.logDebug("Trying URL: " + url) |