記事ディレクトリ
現在使用中 Rclone OneDrive にファイルを転送するときに、速度が遅い、切断されるなどの問題が発生する場合があります。
RcloneがOnedriveへの接続に時間がかかるのはなぜですか?
根本的な原因は OneDrive API の制限をトリガーすることであり、デフォルトの Rclone 組み込み API は複数の人が同時に使用するため、これらの問題はますます顕在化しています...

自作のプライベート API を使用して OneDrive に接続すると、これらの状況を大幅に改善できます。365 か月の Office 5 EXNUMX 開発者試用版では、意図的に API をブラッシングするのではなく、Rclone を時々使用すると料金が自動的に更新されます。安全で安定しています。
さらに、自作の API は、他のアカウントや他のアプリケーションでも使用できます。
Googleドライブの自作APIならこちらのチュートリアルを参考に▼
Rclone接続Onedrive速度テスト
前者はRcloneのデフォルトAPIを使ってOnedriveに接続する速度をテストする▼

後者は、ネチズンが申請した Microsoft API を使用して Onedrive に接続するためのテスト ▼

- 速度差が10倍以上あることがよくわかります。
Microsoft OnedriveネットワークディスクAPIを作成するにはどうすればよいですか?
Microsoft Azure Management CenterでクライアントIDとクライアントシークレットを取得する方法については、以下のリンクをクリックして、MicrosoftOnedriveネットワークディスクAPIの作成方法を確認してください▼
Rclone がトークンを取得
ローカルコンピューターに Rclone をダウンロード ▼
Windows を例にとると、解凍後に rclone.exe のあるフォルダーに移動し、エクスプローラーのアドレス バーに cmd と入力して Enter キーを押すと、現在のパスでコマンド プロンプトが開きます。
次のコマンドで置き換えますClient_ID、Client_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{"access_token":"xxxxxxxxxxxxxxxxxx","expiry":"2024-05-15T21:18:39.5036298+08:00"}このコンテンツ全体(角かっこを含む)はトークンであり、コピーして保存します。
RcloneはOneDriveに接続します
SSHで以下のコマンドを入力▼
rclone config
以下の情報が表示されますので、以下の手順を参考に操作してください▼
- 注意事項RCLONE は随時更新されるため、このチュートリアルをご覧になると、メニュー オプションが多少変更される場合がありますが、基本的な考え方は変わりませんので、操作をコピーすることは考えないでください。
$ 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は自己構築APIを使用してOneDriveネットワークディスクに正常に接続しています。
構成が完了すると、次を使用できます。rclone表示するコマンド:
onedrive の最上位にあるディレクトリを一覧表示する▼
rclone lsd onedrive:
onedrive 内のすべてのファイルを一覧表示▼
rclone ls onedrive:
という名前のディレクトリにローカル ディレクトリをコピーします。backuponedriveディレクトリ▼
rclone copy /home/source onedrive:backup
コピー カット 削除 コマンド
Rclone 構成ファイルを onedrive ネットワーク ディスクのルート ディレクトリにコピーします ▼
rclone copy /root/.config/rclone/rclone.conf onedrive:/
ローカルにコピー /home/backup onedriveという名前のネットワークディスクが構成されているバックアップディレクトリに移動します。その逆も同様です▼
rclone copy --progress /home/backup onedrive:backup
- このパラメータを追加することで
--ignore-existingネットワークディスクにバックアップされたファイルは無視できます。これは増分バックアップと同じです ▼
rclone copy --ignore-existing /home/backup onedrive:backup
ローカルCWP手動バックアップファイルをonedriveという名前のネットワークディスクのバックアップディレクトリにコピーします。その逆も同様です▼
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 のネットワーク ディスクのバックアップ ディレクトリを削除します▼
rclone delete onedrive:backup
onedriveという名前のネットワークディスクを構成するバックアップディレクトリを作成します▼
rclone mkdir onedrive:backup
コピー▼
rclone copy
移動▼
rclone move
削除 ▼
rclone delete
同期 ▼
rclone sync
その他の Rclone コマンドの使用方法のチュートリアルについては、以下の Rclone コマンド コレクションを参照してください▼
OneDrive をマウントするには?
ローカルディレクトリにマウントする必要がある場合は、以前のRcloneマウントチュートリアルを参照してください▼
OneDriveプライベートAPIの制限
自作のプライベート API を使用するとアップロード エクスペリエンスが向上しますが、頻繁に使用するとアップロードが制限される場合があります。
Microsoft OneDrive API の上限のしきい値はどれくらいですか?
Microsoftは、OneDriveAPIの上限しきい値を明確に述べていません。元のドキュメントは次のとおりです。
使用状況に基づいて、ユーザーが信頼性とパフォーマンスを損なうことなく最大限のリソースを使用できるように、しきい値を微調整します。
- 他のタイプの API 制限の説明から推測できるように、合計と頻度の XNUMX つの制限があります。
- 合計は XNUMX 日に発信できる通話回数、頻度は XNUMX 分間に発信できる通話回数です。
- そして、調整のしきい値に達すると、ファイルのアップロードが調整されます。
- 公式ドキュメントから正確な値を取得できないため、実際のテストでこの正確な値を取得することは可能ですか?
- 答えは否定的です。実際のテストではルールが見つからなかったため、この制限は動的に調整され、公式ドキュメントに準拠しています。
OneDrive APIによる制限を回避するにはどうすればよいですか?
短時間にあまりにも多くのファイルをアップロードしないでください。ファイル サイズは関係ありません。重要なのはファイルの数です。
Office 365 E5の自動更新について:
- 開発者向け試用版を長年使用しているユーザーの経験によると、セルフビルドのプライベート API を使用する限り、サブスクリプションを更新できます。
- 頻度に関しては、基準はなく、多ければ多いほど良いです。
- サーバーが Microsoft Azure であるため、意図的に API をブラッシングすることは、特に GitHub アクションを使用して、損失の価値がない可能性があります。多くの人が同様の方法で API を無意味にブラッシングし、Microsoft Azure はそれを簡単に特定したいと考えています。
Hope Chen Weiliang ブログ ( https://www.chenweiliang.com/ ) 共有 "Rclone は Onedrive への接続が遅いですか?アップロードの速度制限をダンプしますか? API アクセラレーションを構成する」を参照してください。
この記事のリンクを共有することを歓迎します。https://www.chenweiliang.com/cwl-27906.html
さらに多くの隠されたトリックのロックを解除するには、Telegram チャンネルにぜひご参加ください。
気に入ったらシェアして「いいね!」してください!あなたのシェアと「いいね!」が私たちの継続的なモチベーションです。



