Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
Fixed unicode string url-unquoting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yamada95 committed Aug 2, 2016
1 parent 1be1bf4 commit b495835
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bddown_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
from util import logger
from command.config import global_config

import sys
reload(sys)
sys.setdefaultencoding('utf-8')

BAIDUPAN_SERVER = "http://pan.baidu.com/api/"
VCODE = 'vcode.jpg'

Expand Down Expand Up @@ -178,7 +182,7 @@ def get_file_info(self, shareinfo, fsid, secret=None):
fi.filename = _json['list'][0]['server_filename']
fi.path = os.path.dirname(_json['list'][0]['path'])
fi.dlink = _json['list'][0]['dlink']
fi.parent_path = url_unquote(shareinfo.fileinfo[0]['parent_path'])
fi.parent_path = url_unquote(shareinfo.fileinfo[0]['parent_path'].encode('utf8'))
break
elif errno == -20:
verify_params = self._handle_captcha(shareinfo.bdstoken)
Expand Down

0 comments on commit b495835

Please sign in to comment.