Code Monkey home page Code Monkey logo

baidu-wangpan-parse's Introduction

百度网盘分享文件下载链接解析

功能

  • 获取百度网盘分享文件的真实下载地址
  • 将获取到的下载链接复制到IDMFDM等下载器即可实现高速下载,避免使用百度网盘客户端

运行环境

  • Python 2.7

第三方库

使用帮助

$ python baidu_wangpan_parse.py -h
usage: baidu_wangpan_parse.py [-h] [-f] link [password]

Get Baidu wangpan sharing file download link.

positional arguments:
  link          Baidu wangpan sharing file link
  password      Baidu wangpan sharing file password

optional arguments:
  -h, --help    show this help message and exit
  -f, --folder  if sharing file is a folder

使用实例

1.获取没有加密单个文件的下载地址:

$ python baidu_wangpan_parse.py https://pan.baidu.com/s/1dG1NCeH
http://d.pcs.baidu.com/file/8192bee674d4fa51327b4fcd48419527?fid=271812880-250528-1043814616287203&dstime=1529692196&rt=sh&sign=FDtAERV-DCb740ccc5511e5e8fedcff06b081203-X4Fh%2FqJm8VsmmFSfxrvr0Xi%2BWuo%3D&expires=8h&chkv=1&chkbd=0&chkpc=&dp-logid=556008995005344418&dp-callid=0&r=913049239

2.获取加密单个文件的下载地址:

$ python baidu_wangpan_parse.py https://pan.baidu.com/s/1qZbIVP6 xa27
http://d.pcs.baidu.com/file/db0be336c157d7cd2e1368c7a80833d6?fid=1708072416-250528-674694471059199&dstime=1529692222&rt=sh&sign=FDtAERV-DCb740ccc5511e5e8fedcff06b081203-elkzjwahMSEUGaVYSsBWYDt9y9I%3D&expires=8h&chkv=1&chkbd=0&chkpc=&dp-logid=556015960669176024&dp-callid=0&r=457285671

3.获取没有加密文件夹的打包下载地址

$ python baidu_wangpan_parse.py -f https://pan.baidu.com/s/1jH2KqZs
http://www.baidupcs.com/rest/2.0/pcs/file?method=batchdownload&app_id=250528&zipcontent=%7B%22fs_id%22%3A%5B%221042134294938382%22%5D%7D&sign=DCb740ccc5511e5e8fedcff06b081203:%2FJ5CLBRE0lBhZcmtBzONMei1sK0%3D&uid=540536034&time=1529778687&dp-logid=556033318032806103&dp-callid=0&from_uk=540536034

4.获取加密文件夹的打包下载地址

$ python baidu_wangpan_parse.py -f https://pan.baidu.com/s/1htWjWk0 5ykw
http://www.baidupcs.com/rest/2.0/pcs/file?method=batchdownload&app_id=250528&zipcontent=%7B%22fs_id%22%3A%5B%22680498123896117%22%5D%7D&sign=DCb740ccc5511e5e8fedcff06b081203:78%2FEazq38BLF8yHif6MAwhSocTs%3D&uid=1708072416&time=1529778722&dp-logid=556042741799663073&dp-callid=0&from_uk=1708072416

常见问题

文件打包下载后解压时提示头部错误, 解压失败。这个问题多发于7-Zip解压,换用WinRAR即可解压成功。

错误代码

Errno 含义
0 成功
-1 您下载的内容中包含违规信息
-20 显示验证码
2 下载失败,请稍候重试
113 页面已过期
116 该分享不存在
118 没有下载权限
121 你选择操作的文件过多,减点试试吧

Todo

  • 解析文件夹的下载地址同时获取zip压缩包名字以及大小
  • 精简命令行参数,实现自动识别下载内容是单文件/文件夹,加密/未加密
  • 修改为Python3版本

Remark

  • 当前测试时间2018.6.23。如果失效,请在issue中提出,我会来更新。

baidu-wangpan-parse's People

Contributors

tychxn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.