Linux 下载百度网盘文件

本文介绍了如何在Linux环境下利用bypy工具下载百度网盘的文件。首先确保系统为CentOS 7.2且已安装Python 2.7和pip。接着通过pip安装bypy,并通过授权过程获取权限。授权成功后,用户可以在‘我的应用数据’>‘bypy’目录下存放待下载文件。使用bypyinfo查看网盘信息,bypylist列出文件,bypydowndir下载文件,bypyupload上传文件。
摘要由CSDN通过智能技术生成

Linux 下载百度网盘文件

1. 准备环境: centos7.2 python2.7+ pip

2. 安装工具

pip install requests -i https://pypi.doubanio.com/simple
pip install bypy -i https://pypi.doubanio.com/simple

3. 授权

  • 命令行输入 bypy info, 如下:
[root@iZ8vbdz4rng8x76417crnnZ setuptools-1.4.2]# bypy info
Please visit:
https://openapi.baidu.com/oauth/2.0/authorize?scope=basic+netdisk&redirect_uri=oob&response_type=code&client_id=q8WE4EpCsau1oS0MplgMKNBn
And authorize this app
Paste the Authorization Code here within 10 minutes.
Press [Enter] when you are done
  • 复制链接到浏览器上授权, 并复制授权码到命令行中, 回车, 如下:
[root@iZ8vbdz4rng8x76417crnnZ setuptools-1.4.2]# byby info
-bash: byby: command not found
[root@iZ8vbdz4rng8x76417crnnZ setuptools-1.4.2]# bypy info
Please visit:
https://openapi.baidu.com/oauth/2.0/authorize?scope=basic+netdisk&redirect_uri=oob&response_type=code&client_id=q8WE4EpCsau1oS0MplgMKNBn
And authorize this app
Paste the Authorization Code here within 10 minutes.
Press [Enter] when you are done
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Authorizing, please be patient, it may take upto 300 seconds...
Authorizing with the Heroku server ...
Successfully authorized

Quota: 2.008TB
Used: 885.847GB

下载文件

  • 授权完成后, 可在百度网盘中看到目录 “我的应用数据” > “bypy”, 将需要下载的文件放到该目录中
  • 命令行输入 bypy info 可查看网盘信息, 如:
[root@iZ8vbdz4rng8x76417crnnZ setuptools-1.4.2]# bypy info
Quota: 2.005TB
Used: 1.123TB
  • 命令行输入 bypy list即可在Linux中看到网盘中的文件, 如下:
[root@iZ8vbdz4rng8x76417crnnZ setuptools-1.4.2]# bypy list
/apps/bypy ($t $f $s $m $d):
D testfiles 0 2021-07-30, 15:40:12
  • 命令行输入 bypy downdir -v 下载当前路径所有文件, 或输入bypy downdir filename -v下载指定文件
  • 命令行输入 bypy upload -v filename 上传文件
  • 命令行输入 bypy -cbypy -q 清除授权或退出
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值