Skip to content

Instantly share code, notes, and snippets.

@zhehaowang
Created November 11, 2015 01:04
Show Gist options
  • Save zhehaowang/b4ac0890d6473f2e31e5 to your computer and use it in GitHub Desktop.
Save zhehaowang/b4ac0890d6473f2e31e5 to your computer and use it in GitHub Desktop.
BaiduPan Python API get download url, so that we don't need to use YunGuanJia
from baidupcsapi import PCS
pcs = PCS('XXX','XXX')
print pcs.quota().content
print pcs.list_files('/').content
headers = {'Range': 'bytes=0-99'}
ret = pcs.download('/README.md', headers=headers)
print(ret.text)
ret1 = pcs.download_url(['/README.md'], headers=headers)
print(ret1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment