白嫖微軟(三)rclone

上官飞鸿發表於2024-05-02

簡介

雖然已經嫖了微軟幾年。但是筆記一直沒有完整記錄,最近又開始硬碟焦慮,300G可用,小姐姐怎麼辦啊,去住onedrive的大別墅吧。

雖然又alist+webdav,但是中轉了一下,有什麼不中轉的辦法麼?同時要兼顧windows,linux。

首先想到的是:RaiDrive,掛載個人版onedrive,還是不錯的,掛載E5的居然要收費才能寫入。

那麼退而求其次,rclone吧。https://rclone.org/

windows安裝

https://rclone.org/downloads/

下載windows x64,解壓就可以用了。

Download · WinFsp

下載winfsp,並安裝。

我解壓到C盤根目錄了

在位址列輸入cmd回車,就進入了該目錄的命令列

linux安裝

配置

這在windows,linux基本一致。

下面就在windows下配置,因為配置時會呼叫瀏覽器來獲取token,cookie這些東西,windows下更方便,我linux是遠端的,只有命令列,沒桌面,也沒瀏覽器。如果你linux是桌面版,也可以配置。

建議先訪問OneDrive (live.com),要麼全登入,要麼全登出。別隻有一個賬戶登入,會自動登入,導致你無法選擇連線的onedrive賬號。

看我登入多個賬號,就會出現選擇

完整的配置命令

C:\rclone-v1.66.0-windows-amd64>rclone.exe config
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n

Enter name for new remote.
name> OneDrive-Share

Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
 1 / 1Fichier
   \ (fichier)
……
32 / Microsoft Azure Files
   \ (azurefiles)
33 / Microsoft OneDrive
   \ (onedrive)
34 / OpenDrive
   \ (opendrive)
……
55 / seafile
   \ (seafile)
Storage> 33

Option client_id.
OAuth Client Id.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_id> 直接回車

Option client_secret.
OAuth Client Secret.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_secret> 直接回車

Option region.
Choose national cloud region for OneDrive.
Choose a number from below, or type in your own string value.
Press Enter for the default (global).
 1 / Microsoft Cloud Global
   \ (global)
 2 / Microsoft Cloud for US Government
   \ (us)
 3 / Microsoft Cloud Germany
   \ (de)
 4 / Azure and Office 365 operated by Vnet Group in China
   \ (cn)
region> 1 

Edit advanced config?
y) Yes
n) No (default)
y/n> 直接回車

Use web browser to automatically authenticate rclone with remote?
 * Say Y if the machine running rclone has a web browser you can use
 * Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.

y) Yes (default)
n) No
y/n> 直接回車

2024/05/02 10:29:29 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=ExgogZnwHHWh1d1A0vuZNg
2024/05/02 10:29:29 NOTICE: Log in and authorize rclone for access
2024/05/02 10:29:29 NOTICE: Waiting for code...
2024/05/02 10:30:21 NOTICE: Got code
Option config_type.
Type of connection
Choose a number from below, or type in an existing string value.
Press Enter for the default (onedrive).
 1 / OneDrive Personal or Business
   \ (onedrive)
 2 / Root Sharepoint site
   \ (sharepoint)
   / Sharepoint site name or URL
 3 | E.g. mysite or https://contoso.sharepoint.com/sites/mysite
   \ (url)
 4 / Search for a Sharepoint site
   \ (search)
 5 / Type in driveID (advanced)
   \ (driveid)
 6 / Type in SiteID (advanced)
   \ (siteid)
   / Sharepoint server-relative path (advanced)
 7 | E.g. /teams/hr
   \ (path)
config_type> 1

Option config_driveid.
Select drive you want to use
Choose a number from below, or type in your own string value.
Press Enter for the default (b!NxmBTsDr8UGtAw5QTRrmZ7rOtAznG6NAhCs_BrjzalvUOt6svbYsTY5lbcPLUHAW).
 1 / OneDrive (business)
   \ (b!NxmBTsDr8UGtAw5QTRrmZ7rOtAznG6NA******************************)
config_driveid>

也就根據提示,n(新建),給個名(OneDrive-Share),選擇33(Onedrive網盤),選擇1(Global全球伺服器),選擇1(Onedrive 專業或企業版)。彈出瀏覽器的時候,選擇賬號,或者輸入賬號密碼。

生成的配置檔案在這裡

驗證

rclone仍然在努力製作gui介面。但是不太完整,我們可以用它驗證一下配置檔案是否正確。

GUI (rclone.org)

相關文章