Rclone连接Onedrive速度慢?转存上传限速?配置API加速

在使用 Rclone 传输文件到 OneDrive 时,可能会遇到速度很慢、断线等问题……

为何Rclone连接Onedrive速度慢?

根本原因是触发了OneDrive API的限制,而默认的Rclone内置API被多人同时使用,所以这些问题也越来越明显……

使用自建私有API连接OneDrive可以大大改善这些情况,而且对于三个月的Office 365 E5开发者试用版,偶尔使用Rclone会有自动续费的可能,而不是刻意刷API,更加安全和稳定。

此外,自建API也可以被其他账户和其他应用程序使用。

如果是Google Drive自建API,请参考这篇教程 ▼

如何申请谷歌云端硬盘客户端ID和Secret Key密钥API?

当你在默认配置下将 rclone 与 Google Drive 一起使用时,你使用的是 rclone 的 client_id。这在所有 rclone 用户之间共享。Google 对每个 client_id 可以执行的每秒查询数有全局速率限制。rc……

Rclone连接Onedrive速度测试

前者是网友测试使用Rclone默认的API 连接Onedrive的速度▼

后者是网友测试使用自己申请的微软API 连接Onedrive的速度▼

如何创建微软 Onedrive 网盘API?

微软Azure管理中心获取Client ID和Client secret的方法,请点击下方链接查看如何创建微软 Onedrive 网盘API ▼

Onedrive有没有开放API?Onedrive云存储更改自建API建站

Rclone配置Onedrive云存储更改自建API,和申请谷歌云端硬盘客户端ID和Secret Key密钥API一样,也是需要亲自去微软Azure Active Directory 管理中心申请开放API。 微软Azure如何申请开放API?……

点此进入 Rclone连接Onedrive的官方文档

Rclone获取token

在本地电脑上下载 Rclone ▼

点此进入 Rclone 下载页面

以Windows为例,解压后进入rclone.exe所在文件夹,在资源管理器地址栏中输入 cmd 回车,即可在当前路径打开命令提示符。

替换以下命令中的Client_IDClient_secret 并执行 ▼

rclone authorize "onedrive" "Client_ID" "Client_secret"

授权后,命令提示符窗口中会出现以下消息:

If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
Paste the following into your remote machine --->
{"access_token":"xxxxxxxxxxxxxxxxxx","expiry":"2024-05-15T21:18:39.5036298+08:00"}
<---End paste

Rclone 连接 OneDrive

SSH输入以下命令 ▼

rclone config

会出现如下信息,请参考以下说明进行操作 ▼

$ rclone config

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n # 输入 n,新建
name> onedrive # 输入网盘名称,类似标签,这是用来区别不同的网盘。
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / 1Fichier
\ (fichier)
2 / Akamai NetStorage
\ (netstorage)
3 / Alias for an existing remote
\ (alias)
4 / Amazon Drive
\ (amazon cloud drive)
5 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Lyve Cloud, Minio, RackCorp, SeaweedFS, and Tencent COS
\ (s3)
6 / Backblaze B2
\ (b2)
7 / Better checksums for other remotes
\ (hasher)
8 / Box
\ (box)
9 / Cache a remote
\ (cache)
10 / Citrix Sharefile
\ (sharefile)
11 / Compress a remote
\ (compress)
12 / Dropbox
\ (dropbox)
13 / Encrypt/Decrypt a remote
\ (crypt)
14 / Enterprise File Fabric
\ (filefabric)
15 / FTP Connection
\ (ftp)
16 / Google Cloud Storage (this is not Google Drive)
\ (google cloud storage)
17 / Google Drive
\ (drive)
18 / Google Photos
\ (google photos)
19 / Hadoop distributed file system
\ (hdfs)
20 / Hubic
\ (hubic)
21 / In memory object storage system.
\ (memory)
22 / Jottacloud
\ (jottacloud)
23 / Koofr, Digi Storage and other Koofr-compatible storage providers
\ (koofr)
24 / Local Disk
\ (local)
25 / Mail.ru Cloud
\ (mailru)
26 / Mega
\ (mega)
27 / Microsoft Azure Blob Storage
\ (azureblob)
28 / Microsoft OneDrive
\ (onedrive)
29 / OpenDrive
\ (opendrive)
30 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ (swift)
31 / Pcloud
\ (pcloud)
32 / Put.io
\ (putio)
33 / QingCloud Object Storage
\ (qingstor)
34 / SSH/SFTP Connection
\ (sftp)
35 / Sia Decentralized Cloud
\ (sia)
36 / Storj Decentralized Cloud Storage
\ (storj)
37 / Sugarsync
\ (sugarsync)
38 / Transparently chunk/split large files
\ (chunker)
39 / Union merges the contents of several upstream fs
\ (union)
40 / Uptobox
\ (uptobox)
41 / Webdav
\ (webdav)
42 / Yandex Disk
\ (yandex)
43 / Zoho
\ (zoho)
44 / http Connection
\ (http)
45 / premiumize.me
\ (premiumizeme)
46 / seafile
\ (seafile)
Storage> 28 # 输入28表示选择Microsoft OneDrive
Option client_id.
OAuth Client Id.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_id> # 输入 Client Id (客户端 ID)
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> # 输入 Client Secret (客户端密码)
Edit advanced config? (y/n)
y) Yes
n) No
y/n> n # 输入 n
Remote config
Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> n # 输入 n
For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on your machine (same rclone version recommended) :
rclone authorize "onedrive" "client_id" "client_secret"
Then paste the result below:
result> {"access_token":"XXXXXXXXX","expiry":"2024-05-15T21:18:39.5036298+08:00"} # 输入 token
Choose a number from below, or type in an existing value
1 / OneDrive Personal or Business
\ "onedrive"
2 / Root Sharepoint site
\ "sharepoint"
3 / Type in driveID
\ "driveid"
4 / Type in SiteID
\ "siteid"
5 / Search a Sharepoint site
\ "search"
Your choice> 1 # # 这里询问你要选择的类型,因为你使用的是OneDrive,所以输入1
Found 1 drives, please select the one you want to use:
0: OneDrive (business) id=xxxxxxxxxxxxxx
Chose drive to use:> 0 # 检测到网盘,此处号码是0,所以输入0
Found drive 'root' of type 'business', URL: https:// xxx.sharepoint. com/personal/xxxxxx/Documents
Is that okay?
y) Yes
n) No
y/n> y # 请你确认,如果没有问题,请输入 y

--------------------
[od-e5-api]
type = onedrive
client_id = xxxxxxxxxx
client_secret = xxxxxxxxxxxxxxxx
token = {"access_token":"xxxxxxxxxxxxxxxxxx","expiry":"2024-05-15T21:18:39.5036298+08:00"}
drive_id = xxxxxxxxxxxxxxxxxxxxxxxxx
drive_type = business
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y # 最后会显示网盘的配置信息,请确认是否准确无误? 如果没有问题,请输入 y
Current remotes:

Name Type
==== ====
onedrive onedrive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q # 输入 q 退出

配置完成后,你可以使用如下rclone命令查看:

列出 onedrive 顶层的目录 ▼

rclone lsd onedrive:

列出 onedrive 中的所有文件 ▼

rclone ls onedrive:

将本地目录复制到名称为backup的 onedrive 目录 ▼

rclone copy /home/source onedrive:backup

复制剪切删除命令

复制Rclone配置文件到onedrive的网盘的根目录 ▼

rclone copy /root/.config/rclone/rclone.conf onedrive:/

复制本地 /home/backup 到配置名为onedrive的网盘的backup目录,反之亦然 ▼

rclone copy --progress /home/backup onedrive:backup
rclone copy --ignore-existing /home/backup onedrive:backup

复制本地CWP手动备份文件到配置名为onedrive的网盘的backup目录,反之亦然 ▼

rclone copy --progress /newbackup/full/manual/accounts/eloha.tar.gz onedrive:cwp-newbackup/full/manual/accounts/

从onedrive的网盘,复制CWP自动定时备份文件到本地 /newbackup 目录 ▼

rclone copy --progress onedrive:cwp-newbackup/full/daily/Friday/accounts/eloha.tar.gz /newbackup/

rclone copy --progress onedrive:cwp-backup2/ /home/backup2/

从onedrive的网盘,复制CWP手动备份文件到本地 /newbackup/newbackup/full/manual/accounts/ 目录▼

rclone copy --progress onedrive:cwp-newbackup/full/manual/accounts/eloha.tar.gz /newbackup/newbackup/full/manual/accounts/

从onedrive的网盘,复制VestaCP备份文件到本地 /home/backup 目录 ▼

rclone copy --progress onedrive:backup/admin.2018-04-12_13-10-02.tar /home/backup

移动(剪切)命令 ▼

rclone move /home/backup onedrive:backup

删除配置名为onedrive的网盘的backup目录▼

rclone delete onedrive:backup

创建配置名为onedrive的网盘的backup目录 ▼

rclone mkdir onedrive:backup

复制 ▼

rclone copy

移动 ▼

rclone move

删除 ▼

rclone delete

同步 ▼

rclone sync

更多Rclone命令使用教程,请参考下方的Rclone命令大全 ▼

Rclone命令大全:启动同步copy下载复制文件参数使用方法

Rclone 是一个命令行工具,支持在不同的对象存储和网盘之间同步、上传和下载数据。 并且,通过一些设置,可以很容易实现离线下载、VPS服务器备份等非常实用的功能。 本文将分享Rclone常用的……

如何挂载OneDrive?

如果需要挂载到本地目录,可以参考我们之前的Rclone挂载教程 ▼

Rclone怎么挂载?Rclone挂载谷歌团队共享云盘远程同步

如何把申请到的Google Driver团队盘挂载到自己的VPS服务器上,达到扩容和文件管理的目的?全文唯一的难点就是Rclone创建远程,其中步骤多一点,但并不复杂和困难。 例如那些浮躁怕麻烦的……

OneDrive 私有API的限制

虽然自建私有API可以提升上传体验,但是如果使用太频繁,上传可能会受到限制。

微软 OneDrive API 最大限制阈值是多少?

微软没有明确说明 OneDrive API 的最大限制阀值是多少,以下是原文档:

根据使用情况,我们会对阈值进行微调,以便用户可以使用最大数量的资源,而不会降低可靠性和性能。

点此进入 Microsoft Graph 限制指南

如何避免受到 OneDrive API 限制?

短时间内不要上传太多文件,文件大小无所谓,关键是文件数量。

关于Office 365 E5自动续费问题:

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注