diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-07-15 16:25:41 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-07-15 16:25:41 +0200 |
commit | 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 (patch) | |
tree | b3f80dbd9e759747f9c2acb60f614c5daa7af69e /module/plugins/hoster/YibaishiwuCom.py | |
parent | Fix class definition (diff) | |
download | pyload-5060e4c6374a5116d0d8b02528f910f8c5f8bcf9.tar.xz |
Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics
Diffstat (limited to 'module/plugins/hoster/YibaishiwuCom.py')
-rw-r--r-- | module/plugins/hoster/YibaishiwuCom.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/module/plugins/hoster/YibaishiwuCom.py b/module/plugins/hoster/YibaishiwuCom.py index fc30c2f4b..0aca311ce 100644 --- a/module/plugins/hoster/YibaishiwuCom.py +++ b/module/plugins/hoster/YibaishiwuCom.py @@ -44,9 +44,16 @@ class YibaishiwuCom(SimpleHoster): 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['urls'] if 'urls' in response else response['data'] if 'data' in response else []): + if "urls" in response: + mirrors = response['urls'] + elif "data" in response: + mirrors = response['data'] + else: + mirrors = None + + for m in mirrors: try: - url = mirror['url'].replace('\\', '') + url = m['url'].replace('\\', '') self.logDebug("Trying URL: " + url) self.download(url) break |