summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/YibaishiwuCom.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/YibaishiwuCom.py')
-rw-r--r--module/plugins/hoster/YibaishiwuCom.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py
index adc403de4..00185c05a 100644
--- a/module/plugins/hoster/YibaishiwuCom.py
+++ b/module/plugins/hoster/YibaishiwuCom.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import re
+import urlparse
from module.common.json_layer import json_loads
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
@@ -12,6 +13,7 @@ class YibaishiwuCom(SimpleHoster):
__version__ = "0.14"
__pattern__ = r'http://(?:www\.)?(?:u\.)?115\.com/file/(?P<ID>\w+)'
+ __config__ = [("use_premium", "bool", "Use premium account if available", True)]
__description__ = """115.com hoster plugin"""
__license__ = "GPLv3"
@@ -34,7 +36,7 @@ class YibaishiwuCom(SimpleHoster):
self.logDebug(('FREEUSER' if m.group(2) == 'download' else 'GUEST') + ' URL', url)
- res = json_loads(self.load("http://115.com" + url, decode=False))
+ res = json_loads(self.load(urlparse.urljoin("http://115.com", url), decode=False))
if "urls" in res:
mirrors = res['urls']
@@ -46,11 +48,10 @@ class YibaishiwuCom(SimpleHoster):
for mr in mirrors:
try:
- url = mr['url'].replace("\\", "")
- self.logDebug("Trying URL: " + url)
- self.download(url)
+ self.link = mr['url'].replace("\\", "")
+ self.logDebug("Trying URL: " + self.link)
break
- except:
+ except Exception:
continue
else:
self.fail(_("No working link found"))