<h1 align="center">CDNDrive = BiliDrive + SuperBed</h1>
<h4 align="center">☁️ 废墟之上,重建辉煌! ☁️</h4>
<h4 align="center">☁️ 支持任意文件的全速上传与下载 ☁️</h4>
## 特色
- 轻量:无复杂依赖,资源占用少
- 自由:无文件格式与大小限制,无容量限制
- 安全:上传的文件需要通过生成的 META URL 才能访问,他人无法随意查看
- 稳定:带有分块校验与超时重试机制,在较差的网络环境中依然能确保文件的完整性
- 快速:支持多线程传输与断点续传,同时借助各个站点的 CDN 资源,能最大化地利用网络环境进行上传与下载
## 使用指南
### 安装
通过`pip`(推荐):
```
pip install CDNDrive
```
从源码安装:
```
pip install git+https://github.com/apachecn/CDNDrive
```
### 登录
```
cdrive login [-h] site username password
site: 站点名称(见 -h)
username: 用户名
password: 密码
```
> 运行 cdrive 报错
```
$ cdrive
-bash: cdrive: command not found
```
解决方案: https://github.com/apachecn/CDNDrive/issues/7
### 设置 Cookie
```
cdrive cookies [-h] site cookies
site: 站点名称(见 -h)
cookies: Cookie
```
### 查看登录状态
```
cdrive userinfo [-h] site
site: 站点名称(见 -h)
```
### 上传
```
cdrive upload [-h] [-b BLOCK_SIZE] [-t THREAD] site file
site: 站点名称(见 -h)
file: 待上传的文件路径
-b BLOCK_SIZE: 分块大小(MB), 默认值为4
-t THREAD: 上传线程数, 默认值为4
```
上传完毕后,终端会打印一串 META URL 用于下载或分享,请妥善保管
### 下载
```
cdrive download [-h] [-f] [-t THREAD] meta [file]
meta: META URL (通常以 cdrive:// 开头)
file: 另存为新的文件名, 不指定则保存为上传时的文件名
-f: 覆盖已有文件
-t THREAD: 下载线程数, 默认值为8
```
下载完毕后会自动进行文件完整性校验,对于大文件该过程可能需要较长时间,若不愿等待可直接退出
### 查看文件元数据
```
cdrive info [-h] meta
meta: META URL
```
### 查看历史记录
```
cdrive history [-h]
```
### 交互模式
不传入任何命令行参数,直接运行程序即可进入交互模式
该模式下,程序会打印命令提示符`CDNDrive > `,并等待用户输入命令
## 技术实现
将任意文件分块编码为图片后上传至各个站点,对该操作逆序即可下载并还原文件
## 性能指标
### 测试文件
文件名:[Vmoe]Hatsune Miku「Magical Mirai 2017」[BDrip][1920x1080p][HEVC_YUV420p10_60fps_2FLAC_5.1ch&2.0ch_Chapter][Effect Subtitles].mkv
大小:14.5 GB (14918.37 MB)
分块:10 MB * 1492
META URL:`bdrive://d28784bff1086450a6c331fb322accccd382228e`
### 上传
地理位置:四川成都
运营商:教育网
上行速率:20 Mbps
用时:02:16:39
平均速度:1.82 MB/s
### 下载
### 测试点1
地理位置:福建福州
运营商:中国电信
下行速率:100 Mbps
用时:00:18:15
平均速度:13.62 MB/s
### 测试点2
地理位置:上海
运营商:中国电信
下行速率:1 Gbps
用时:00:02:22
平均速度:104.97 MB/s
## 历史记录
[见这里](history.md)。
## 免责声明
+ 请自行对重要文件做好本地备份。
+ 请不要上传含有个人隐私的文件,因为无法删除。
+ 请勿使用本项目上传不符合社会主义核心价值观的文件。
+ 请合理使用本项目,避免对哔哩哔哩的存储与带宽资源造成无意义的浪费。
+ 该项目仅用于学习和技术交流,开发者不承担任何由使用者的行为带来的法律责任。
## 协议
本项目基于 SATA 协议发布。
您有义务为此开源项目点赞,并考虑额外给予作者适当的奖励。
## 致谢
本项目基于 [Hsury](https://github.com/Hsury) 的 [BiliDrive](https://github.com/Hsury/BiliDrive),在此表示感谢。
同时感谢 [goocarder](https://v2ex.com/t/618064) 提供的思路。
## 赞助我们
![](https://home.apachecn.org/img/qr/zfb_wx.png)
## 另见
+ [ApacheCN 学习资源](https://docs.apachecn.org/)
+ [计算机电子书](http://it-ebooks.flygon.net)
+ [布客新知](http://flygon.net/ixinzhi/)
Raw data
{
"_id": null,
"home_page": "https://github.com/apachecn/CDNDrive",
"name": "CDNDrive",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "cdn,cloud,picbed,disk,drive,storage,pan,yun,\u7f51\u76d8,\u56fe\u5e8a,\u4e91",
"author": "ApacheCN",
"author_email": "apachecn@163.com",
"download_url": "https://files.pythonhosted.org/packages/74/a4/377df97d230200858858228cd05edda5ee5fec7743478aea31d41b1a42e8/CDNDrive-2022.3.20.3.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">CDNDrive = BiliDrive + SuperBed</h1>\n\n<h4 align=\"center\">\u2601\ufe0f \u5e9f\u589f\u4e4b\u4e0a\uff0c\u91cd\u5efa\u8f89\u714c\uff01 \u2601\ufe0f</h4>\n<h4 align=\"center\">\u2601\ufe0f \u652f\u6301\u4efb\u610f\u6587\u4ef6\u7684\u5168\u901f\u4e0a\u4f20\u4e0e\u4e0b\u8f7d \u2601\ufe0f</h4>\n\n## \u7279\u8272\n\n- \u8f7b\u91cf\uff1a\u65e0\u590d\u6742\u4f9d\u8d56\uff0c\u8d44\u6e90\u5360\u7528\u5c11\n- \u81ea\u7531\uff1a\u65e0\u6587\u4ef6\u683c\u5f0f\u4e0e\u5927\u5c0f\u9650\u5236\uff0c\u65e0\u5bb9\u91cf\u9650\u5236\n- \u5b89\u5168\uff1a\u4e0a\u4f20\u7684\u6587\u4ef6\u9700\u8981\u901a\u8fc7\u751f\u6210\u7684 META URL \u624d\u80fd\u8bbf\u95ee\uff0c\u4ed6\u4eba\u65e0\u6cd5\u968f\u610f\u67e5\u770b\n- \u7a33\u5b9a\uff1a\u5e26\u6709\u5206\u5757\u6821\u9a8c\u4e0e\u8d85\u65f6\u91cd\u8bd5\u673a\u5236\uff0c\u5728\u8f83\u5dee\u7684\u7f51\u7edc\u73af\u5883\u4e2d\u4f9d\u7136\u80fd\u786e\u4fdd\u6587\u4ef6\u7684\u5b8c\u6574\u6027\n- \u5feb\u901f\uff1a\u652f\u6301\u591a\u7ebf\u7a0b\u4f20\u8f93\u4e0e\u65ad\u70b9\u7eed\u4f20\uff0c\u540c\u65f6\u501f\u52a9\u5404\u4e2a\u7ad9\u70b9\u7684 CDN \u8d44\u6e90\uff0c\u80fd\u6700\u5927\u5316\u5730\u5229\u7528\u7f51\u7edc\u73af\u5883\u8fdb\u884c\u4e0a\u4f20\u4e0e\u4e0b\u8f7d\n\n## \u4f7f\u7528\u6307\u5357\n\n### \u5b89\u88c5\n\n\u901a\u8fc7`pip`\uff08\u63a8\u8350\uff09\uff1a\n\n```\npip install CDNDrive\n```\n\n\u4ece\u6e90\u7801\u5b89\u88c5\uff1a\n\n```\npip install git+https://github.com/apachecn/CDNDrive\n```\n\n### \u767b\u5f55\n\n```\ncdrive login [-h] site username password\n\nsite: \u7ad9\u70b9\u540d\u79f0\uff08\u89c1 -h\uff09\nusername: \u7528\u6237\u540d\npassword: \u5bc6\u7801\n```\n\n> \u8fd0\u884c cdrive \u62a5\u9519\n\n```\n$ cdrive\n-bash: cdrive: command not found\n```\n\n\u89e3\u51b3\u65b9\u6848: https://github.com/apachecn/CDNDrive/issues/7\n\n### \u8bbe\u7f6e Cookie\n\n```\ncdrive cookies [-h] site cookies\n\nsite: \u7ad9\u70b9\u540d\u79f0\uff08\u89c1 -h\uff09\ncookies: Cookie\n```\n\n### \u67e5\u770b\u767b\u5f55\u72b6\u6001\n\n```\ncdrive userinfo [-h] site\n\nsite: \u7ad9\u70b9\u540d\u79f0\uff08\u89c1 -h\uff09\n```\n\n### \u4e0a\u4f20\n\n```\ncdrive upload [-h] [-b BLOCK_SIZE] [-t THREAD] site file\n\nsite: \u7ad9\u70b9\u540d\u79f0\uff08\u89c1 -h\uff09\nfile: \u5f85\u4e0a\u4f20\u7684\u6587\u4ef6\u8def\u5f84\n\n-b BLOCK_SIZE: \u5206\u5757\u5927\u5c0f(MB), \u9ed8\u8ba4\u503c\u4e3a4\n-t THREAD: \u4e0a\u4f20\u7ebf\u7a0b\u6570, \u9ed8\u8ba4\u503c\u4e3a4\n```\n\n\u4e0a\u4f20\u5b8c\u6bd5\u540e\uff0c\u7ec8\u7aef\u4f1a\u6253\u5370\u4e00\u4e32 META URL \u7528\u4e8e\u4e0b\u8f7d\u6216\u5206\u4eab\uff0c\u8bf7\u59a5\u5584\u4fdd\u7ba1\n\n### \u4e0b\u8f7d\n\n```\ncdrive download [-h] [-f] [-t THREAD] meta [file]\n\nmeta: META URL (\u901a\u5e38\u4ee5 cdrive:// \u5f00\u5934)\nfile: \u53e6\u5b58\u4e3a\u65b0\u7684\u6587\u4ef6\u540d, \u4e0d\u6307\u5b9a\u5219\u4fdd\u5b58\u4e3a\u4e0a\u4f20\u65f6\u7684\u6587\u4ef6\u540d\n\n-f: \u8986\u76d6\u5df2\u6709\u6587\u4ef6\n-t THREAD: \u4e0b\u8f7d\u7ebf\u7a0b\u6570, \u9ed8\u8ba4\u503c\u4e3a8\n```\n\n\u4e0b\u8f7d\u5b8c\u6bd5\u540e\u4f1a\u81ea\u52a8\u8fdb\u884c\u6587\u4ef6\u5b8c\u6574\u6027\u6821\u9a8c\uff0c\u5bf9\u4e8e\u5927\u6587\u4ef6\u8be5\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u8f83\u957f\u65f6\u95f4\uff0c\u82e5\u4e0d\u613f\u7b49\u5f85\u53ef\u76f4\u63a5\u9000\u51fa\n\n### \u67e5\u770b\u6587\u4ef6\u5143\u6570\u636e\n\n```\ncdrive info [-h] meta\n\nmeta: META URL\n```\n\n### \u67e5\u770b\u5386\u53f2\u8bb0\u5f55\n\n```\ncdrive history [-h]\n```\n\n### \u4ea4\u4e92\u6a21\u5f0f\n\n\u4e0d\u4f20\u5165\u4efb\u4f55\u547d\u4ee4\u884c\u53c2\u6570\uff0c\u76f4\u63a5\u8fd0\u884c\u7a0b\u5e8f\u5373\u53ef\u8fdb\u5165\u4ea4\u4e92\u6a21\u5f0f\n\n\u8be5\u6a21\u5f0f\u4e0b\uff0c\u7a0b\u5e8f\u4f1a\u6253\u5370\u547d\u4ee4\u63d0\u793a\u7b26`CDNDrive > `\uff0c\u5e76\u7b49\u5f85\u7528\u6237\u8f93\u5165\u547d\u4ee4\n\n## \u6280\u672f\u5b9e\u73b0\n\n\u5c06\u4efb\u610f\u6587\u4ef6\u5206\u5757\u7f16\u7801\u4e3a\u56fe\u7247\u540e\u4e0a\u4f20\u81f3\u5404\u4e2a\u7ad9\u70b9\uff0c\u5bf9\u8be5\u64cd\u4f5c\u9006\u5e8f\u5373\u53ef\u4e0b\u8f7d\u5e76\u8fd8\u539f\u6587\u4ef6\n\n## \u6027\u80fd\u6307\u6807\n\n### \u6d4b\u8bd5\u6587\u4ef6\n\n\u6587\u4ef6\u540d\uff1a[Vmoe]Hatsune Miku\u300cMagical Mirai 2017\u300d[BDrip][1920x1080p][HEVC_YUV420p10_60fps_2FLAC_5.1ch&2.0ch_Chapter][Effect Subtitles].mkv\n\n\u5927\u5c0f\uff1a14.5 GB (14918.37 MB)\n\n\u5206\u5757\uff1a10 MB * 1492\n\nMETA URL\uff1a`bdrive://d28784bff1086450a6c331fb322accccd382228e`\n\n### \u4e0a\u4f20\n\n\u5730\u7406\u4f4d\u7f6e\uff1a\u56db\u5ddd\u6210\u90fd\n\n\u8fd0\u8425\u5546\uff1a\u6559\u80b2\u7f51\n\n\u4e0a\u884c\u901f\u7387\uff1a20 Mbps\n\n\u7528\u65f6\uff1a02:16:39\n\n\u5e73\u5747\u901f\u5ea6\uff1a1.82 MB/s\n\n### \u4e0b\u8f7d\n\n### \u6d4b\u8bd5\u70b91\n\n\u5730\u7406\u4f4d\u7f6e\uff1a\u798f\u5efa\u798f\u5dde\n\n\u8fd0\u8425\u5546\uff1a\u4e2d\u56fd\u7535\u4fe1\n\n\u4e0b\u884c\u901f\u7387\uff1a100 Mbps\n\n\u7528\u65f6\uff1a00:18:15\n\n\u5e73\u5747\u901f\u5ea6\uff1a13.62 MB/s\n\n### \u6d4b\u8bd5\u70b92\n\n\u5730\u7406\u4f4d\u7f6e\uff1a\u4e0a\u6d77\n\n\u8fd0\u8425\u5546\uff1a\u4e2d\u56fd\u7535\u4fe1\n\n\u4e0b\u884c\u901f\u7387\uff1a1 Gbps\n\n\u7528\u65f6\uff1a00:02:22\n\n\u5e73\u5747\u901f\u5ea6\uff1a104.97 MB/s\n\n## \u5386\u53f2\u8bb0\u5f55\n\n[\u89c1\u8fd9\u91cc](history.md)\u3002\n\n## \u514d\u8d23\u58f0\u660e\n\n+ \u8bf7\u81ea\u884c\u5bf9\u91cd\u8981\u6587\u4ef6\u505a\u597d\u672c\u5730\u5907\u4efd\u3002\n+ \u8bf7\u4e0d\u8981\u4e0a\u4f20\u542b\u6709\u4e2a\u4eba\u9690\u79c1\u7684\u6587\u4ef6\uff0c\u56e0\u4e3a\u65e0\u6cd5\u5220\u9664\u3002\n+ \u8bf7\u52ff\u4f7f\u7528\u672c\u9879\u76ee\u4e0a\u4f20\u4e0d\u7b26\u5408\u793e\u4f1a\u4e3b\u4e49\u6838\u5fc3\u4ef7\u503c\u89c2\u7684\u6587\u4ef6\u3002\n+ \u8bf7\u5408\u7406\u4f7f\u7528\u672c\u9879\u76ee\uff0c\u907f\u514d\u5bf9\u54d4\u54e9\u54d4\u54e9\u7684\u5b58\u50a8\u4e0e\u5e26\u5bbd\u8d44\u6e90\u9020\u6210\u65e0\u610f\u4e49\u7684\u6d6a\u8d39\u3002\n+ \u8be5\u9879\u76ee\u4ec5\u7528\u4e8e\u5b66\u4e60\u548c\u6280\u672f\u4ea4\u6d41\uff0c\u5f00\u53d1\u8005\u4e0d\u627f\u62c5\u4efb\u4f55\u7531\u4f7f\u7528\u8005\u7684\u884c\u4e3a\u5e26\u6765\u7684\u6cd5\u5f8b\u8d23\u4efb\u3002\n\n## \u534f\u8bae\n\n\u672c\u9879\u76ee\u57fa\u4e8e SATA \u534f\u8bae\u53d1\u5e03\u3002\n\n\u60a8\u6709\u4e49\u52a1\u4e3a\u6b64\u5f00\u6e90\u9879\u76ee\u70b9\u8d5e\uff0c\u5e76\u8003\u8651\u989d\u5916\u7ed9\u4e88\u4f5c\u8005\u9002\u5f53\u7684\u5956\u52b1\u3002\n\n## \u81f4\u8c22\n\n\u672c\u9879\u76ee\u57fa\u4e8e [Hsury](https://github.com/Hsury) \u7684 [BiliDrive](https://github.com/Hsury/BiliDrive)\uff0c\u5728\u6b64\u8868\u793a\u611f\u8c22\u3002\n\n\u540c\u65f6\u611f\u8c22 [goocarder](https://v2ex.com/t/618064) \u63d0\u4f9b\u7684\u601d\u8def\u3002\n\n## \u8d5e\u52a9\u6211\u4eec\n\n![](https://home.apachecn.org/img/qr/zfb_wx.png)\n\n## \u53e6\u89c1\n\n+ [ApacheCN \u5b66\u4e60\u8d44\u6e90](https://docs.apachecn.org/)\n+ [\u8ba1\u7b97\u673a\u7535\u5b50\u4e66](http://it-ebooks.flygon.net)\n+ [\u5e03\u5ba2\u65b0\u77e5](http://flygon.net/ixinzhi/)\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "\u2601\ufe0f CDNDrive\uff0c\u652f\u6301\u4efb\u610f\u6587\u4ef6\u7684\u5168\u901f\u4e0a\u4f20\u4e0e\u4e0b\u8f7d",
"version": "2022.3.20.3",
"split_keywords": [
"cdn",
"cloud",
"picbed",
"disk",
"drive",
"storage",
"pan",
"yun",
"\u7f51\u76d8",
"\u56fe\u5e8a",
"\u4e91"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "13233b4b3f43934648f5959cf9d3481cb9724c43e794af9746a53ad1d3947731",
"md5": "a231fe75e65f5b489000358127d748a5",
"sha256": "87f7c8ea0a08c75d2c3787307a2547f11974d5a0f92e7d6f1c2fec0d8d8732ee"
},
"downloads": -1,
"filename": "CDNDrive-2022.3.20.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a231fe75e65f5b489000358127d748a5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 29069,
"upload_time": "2023-03-10T08:19:08",
"upload_time_iso_8601": "2023-03-10T08:19:08.321286Z",
"url": "https://files.pythonhosted.org/packages/13/23/3b4b3f43934648f5959cf9d3481cb9724c43e794af9746a53ad1d3947731/CDNDrive-2022.3.20.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "74a4377df97d230200858858228cd05edda5ee5fec7743478aea31d41b1a42e8",
"md5": "3cc90a1bd5a37647c1348403853e0962",
"sha256": "9d15e3fb5502e9c7adf7a25ed3653ef149b625510734a82a23ead12f32e551e2"
},
"downloads": -1,
"filename": "CDNDrive-2022.3.20.3.tar.gz",
"has_sig": false,
"md5_digest": "3cc90a1bd5a37647c1348403853e0962",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 16517,
"upload_time": "2023-03-10T08:19:10",
"upload_time_iso_8601": "2023-03-10T08:19:10.393812Z",
"url": "https://files.pythonhosted.org/packages/74/a4/377df97d230200858858228cd05edda5ee5fec7743478aea31d41b1a42e8/CDNDrive-2022.3.20.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-10 08:19:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "apachecn",
"github_project": "CDNDrive",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "cdndrive"
}