summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/YibaishiwuCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/hoster/YibaishiwuCom.py')
-rw-r--r--pyload/plugins/hoster/YibaishiwuCom.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/pyload/plugins/hoster/YibaishiwuCom.py b/pyload/plugins/hoster/YibaishiwuCom.py
index 9b0244aa2..883dfa947 100644
--- a/pyload/plugins/hoster/YibaishiwuCom.py
+++ b/pyload/plugins/hoster/YibaishiwuCom.py
@@ -7,18 +7,19 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class YibaishiwuCom(SimpleHoster):
- __name__ = "YibaishiwuCom"
- __type__ = "hoster"
- __version__ = "0.12"
+ __name__ = "YibaishiwuCom"
+ __type__ = "hoster"
+ __version__ = "0.13"
- __pattern__ = r'http://(?:www\.)?(?:u\.)?115.com/file/(?P<ID>\w+)'
+ __pattern__ = r'http://(?:www\.)?(?:u\.)?115\.com/file/(?P<ID>\w+)'
__description__ = """115.com hoster plugin"""
- __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
+ __license__ = "GPLv3"
+ __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
- FILE_NAME_PATTERN = r"file_name: '(?P<N>[^']+)'"
- FILE_SIZE_PATTERN = r"file_size: '(?P<S>[^']+)'"
+ NAME_PATTERN = r'file_name: \'(?P<N>.+?)\''
+ SIZE_PATTERN = r'file_size: \'(?P<S>.+?)\''
OFFLINE_PATTERN = ur'<h3><i style="color:red;">哎呀!提取码不存在!不妨搜搜看吧!</i></h3>'
LINK_PATTERN = r'(/\?ct=(pickcode|download)[^"\']+)'
@@ -27,15 +28,15 @@ class YibaishiwuCom(SimpleHoster):
def handleFree(self):
m = re.search(self.LINK_PATTERN, self.html)
if m is None:
- self.parseError("AJAX URL")
+ self.error(_("LINK_PATTERN not found"))
url = m.group(1)
self.logDebug(('FREEUSER' if m.group(2) == 'download' else 'GUEST') + ' URL', url)
- response = json_loads(self.load("http://115.com" + url, decode=False))
- if "urls" in response:
- mirrors = response['urls']
- elif "data" in response:
- mirrors = response['data']
+ res = json_loads(self.load("http://115.com" + url, decode=False))
+ if "urls" in res:
+ mirrors = res['urls']
+ elif "data" in res:
+ mirrors = res['data']
else:
mirrors = None
@@ -48,7 +49,7 @@ class YibaishiwuCom(SimpleHoster):
except:
continue
else:
- self.fail('No working link found')
+ self.fail(_("No working link found"))
getInfo = create_getInfo(YibaishiwuCom)