sdvcrx / pan-baidu-download

百度网盘下载脚本
MIT License
435 stars 103 forks source link

Windows 上 UTF-8 的支持有问题 #42

Open mengmo opened 7 years ago

mengmo commented 7 years ago

因为命令提示符默认代码页为GBK,中文会显示乱码 所以,chcp 65001将活动代码页转换为UTF-8。 下载会出错

python bddown_cli.py download http://pan.baidu.com/s/1c2iM8AO
Please input this sharing password
bpb4
Traceback (most recent call last):
  File "bddown_cli.py", line 53, in <module>
    execute_command()
  File "bddown_cli.py", line 49, in execute_command
    commands[command](args[1:])
  File "D:\PortableApps\pan-baidu-download\command\download.py", line 110, in download
    download_command(fi.filename, savedir, fi.dlink, cookies=cookies, limit=limit, output_dir=output_dir)
  File "D:\PortableApps\pan-baidu-download\command\download.py", line 18, in download_command
    print("\033[32m" + filename + "\033[0m")
LookupError: unknown encoding: cp65001