0 前言
??因?yàn)樽罱谘芯扛鞣N云盤存儲(chǔ)影視資源的方法,無(wú)意間看到一個(gè)教程是利用軟件將云盤掛載到本地的資源管理器,這樣就能實(shí)現(xiàn)類似本地文件操作的方式來(lái)操作云盤文件,還是有點(diǎn)意思的。
1 Alist掛載云盤
??通過(guò)查找資料我才知道,類似于這種將云盤掛載到本地的軟件還是非常多的,因?yàn)樵贜AS系統(tǒng)中可能會(huì)有類似的需求。但是最為常用,云盤支持度最廣的還是Alist。
Alist下載鏈接
如果沒(méi)有特殊需求,就搞最新版的下載。
??下載完成之后,放到電腦的某個(gè)路徑,然后打開(kāi)終端,進(jìn)入到該路徑,依次敲指令:
# 手動(dòng)設(shè)置一個(gè)密碼 `NEW_PASSWORD`是指你需要設(shè)置的密碼
.\alist.exe admin set NEW_PASSWORD
# 運(yùn)行程序
.\alist.exe server
然后再打開(kāi)http://127.0.0.1:5244/,輸入用戶名admin
和上面設(shè)置的密碼。
??進(jìn)入到Alist的后臺(tái)之后,就是添加對(duì)應(yīng)的網(wǎng)盤即可,內(nèi)容比較瑣碎,這里只強(qiáng)調(diào)幾個(gè)關(guān)鍵點(diǎn)
- 沒(méi)有打星號(hào)的要么保持默認(rèn)值,要么不填
- 阿里云盤要選阿里云盤open
- 百度網(wǎng)盤建議開(kāi)啟web代理,否則可能出現(xiàn)alist后臺(tái)無(wú)法下載大文件的情況
- 掛載路徑可以自定義
- 刷新令牌獲取鏈接:https://alist.nn.ci/zh/guide/drivers/baidu.html
- 注意,百度網(wǎng)盤刷新令牌是會(huì)根據(jù)瀏覽器當(dāng)前登錄的賬號(hào)獲取,所以如果要切換多個(gè)賬號(hào),需要先登錄百度網(wǎng)盤官網(wǎng)切換賬號(hào)。
參考鏈接
??配置完畢后,還需要設(shè)置自啟,上述參考鏈接中使用的是nssm這個(gè)軟件直接添加到服務(wù),但是實(shí)測(cè)發(fā)現(xiàn)一個(gè)問(wèn)題,那就是每次電腦重啟之后,Alist后臺(tái)總是會(huì)報(bào)錯(cuò),顯示host no found
,但是重新加載一下又好了,一開(kāi)始根據(jù)報(bào)錯(cuò)去查找資料,大部分教程都是認(rèn)為是DNS出錯(cuò),要手動(dòng)在hosts文件中添加對(duì)應(yīng)的域名和IP,但是后來(lái)在GitHub的issue上發(fā)現(xiàn)一個(gè)類似的問(wèn)題,才知道問(wèn)題的原因是nssm添加的服務(wù)可能會(huì)在電腦聯(lián)網(wǎng)之前就加載,這樣導(dǎo)致軟件執(zhí)行出錯(cuò)。應(yīng)該采用的方式是將指令寫(xiě)入到腳本文件中,再將快捷方式添加到startup
文件夾下。
Reference
??腳本如下:
Set ws = CreateObject("Wscript.Shell")
ws.run "D:\Alist\alist.exe server",vbhide
其中,上面的alist路徑要替換成自己電腦上的路徑。保存后綴為vbs
。
2 RaiDrive配置
??配置好Alist之后,其實(shí)云盤已經(jīng)掛載好了,但是目前只能通過(guò)網(wǎng)頁(yè)來(lái)實(shí)現(xiàn)上傳和下載,不是很方便,好在alist也支持webdav協(xié)議,類似于一個(gè)輸出的接口(云盤掛載類似于內(nèi)部輸入的接口)。這樣就可以找支持將webdav掛載到本地資源管理器的軟件就能實(shí)現(xiàn)這一功能。
??而RaiDrive就是這樣一個(gè)軟件,配置方法比較簡(jiǎn)單,具體可以參考上面的參考鏈接,不再贅述。
??自啟方面,RaiDrive可以自行設(shè)置,比較簡(jiǎn)單。
3 rclone配置
??RaiDrive雖然好,但是有一個(gè)缺點(diǎn)也很明顯,那就是會(huì)彈廣告,因?yàn)樗巧虡I(yè)付費(fèi)軟件。無(wú)可厚非,但還是想找個(gè)替代品,rclone就是這樣的一個(gè)替代品,雖然配置稍復(fù)雜,但是勝在是開(kāi)源軟件。
rclone下載鏈接
解壓完成之后,打開(kāi)終端,進(jìn)入到軟件目錄,不妨先建立一個(gè)空的文本文件,名為rclone.conf
,然后運(yùn)行.\rclone.exe config
,根據(jù)提示依次填寫(xiě)信息,這里展示出我的運(yùn)行記錄,中文部分為填寫(xiě)注釋
D:\rclone>.\rclone.exe config
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n # 因?yàn)樵瓉?lái)沒(méi)有,要新建一個(gè)
Enter name for new remote.
name> WebDav # 名字可以自己取
Option Storage.
Type of storage to configure.
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, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
\ (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 / Combine several remotes into one
\ (combine)
12 / Compress a remote
\ (compress)
13 / Dropbox
\ (dropbox)
14 / Encrypt/Decrypt a remote
\ (crypt)
15 / Enterprise File Fabric
\ (filefabric)
16 / FTP
\ (ftp)
17 / Google Cloud Storage (this is not Google Drive)
\ (google cloud storage)
18 / Google Drive
\ (drive)
19 / Google Photos
\ (google photos)
20 / HTTP
\ (http)
21 / Hadoop distributed file system
\ (hdfs)
22 / HiDrive
\ (hidrive)
23 / ImageKit.io
\ (imagekit)
24 / In memory object storage system.
\ (memory)
25 / Internet Archive
\ (internetarchive)
26 / Jottacloud
\ (jottacloud)
27 / Koofr, Digi Storage and other Koofr-compatible storage providers
\ (koofr)
28 / Linkbox
\ (linkbox)
29 / Local Disk
\ (local)
30 / Mail.ru Cloud
\ (mailru)
31 / Mega
\ (mega)
32 / Microsoft Azure Blob Storage
\ (azureblob)
33 / Microsoft Azure Files
\ (azurefiles)
34 / Microsoft OneDrive
\ (onedrive)
35 / OpenDrive
\ (opendrive)
36 / OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)
\ (swift)
37 / Oracle Cloud Infrastructure Object Storage
\ (oracleobjectstorage)
38 / Pcloud
\ (pcloud)
39 / PikPak
\ (pikpak)
40 / Proton Drive
\ (protondrive)
41 / Put.io
\ (putio)
42 / QingCloud Object Storage
\ (qingstor)
43 / Quatrix by Maytech
\ (quatrix)
44 / SMB / CIFS
\ (smb)
45 / SSH/SFTP
\ (sftp)
46 / Sia Decentralized Cloud
\ (sia)
47 / Storj Decentralized Cloud Storage
\ (storj)
48 / Sugarsync
\ (sugarsync)
49 / Transparently chunk/split large files
\ (chunker)
50 / Union merges the contents of several upstream fs
\ (union)
51 / Uptobox
\ (uptobox)
52 / WebDAV
\ (webdav)
53 / Yandex Disk
\ (yandex)
54 / Zoho
\ (zoho)
55 / premiumize.me
\ (premiumizeme)
56 / seafile
\ (seafile)
Storage> 52 # 這里選webdav類型,如果要掛載其他云盤,可以自行判斷
Option url.
URL of http host to connect to.
E.g. https://example.com.
Enter a value.
url> http://localhost:5244/dav # 這個(gè)鏈接別寫(xiě)錯(cuò)了,應(yīng)該得一樣
Option vendor.
Name of the WebDAV site/service/software you are using.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Fastmail Files
\ (fastmail)
2 / Nextcloud
\ (nextcloud)
3 / Owncloud
\ (owncloud)
4 / Sharepoint Online, authenticated by Microsoft account
\ (sharepoint)
5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
\ (sharepoint-ntlm)
6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol
\ (rclone)
7 / Other site/service or software
\ (other)
vendor> 7 # 選other
Option user.
User name.
In case NTLM authentication is used, the username should be in the format 'Domain\User'.
Enter a value. Press Enter to leave empty.
user> admin # 用戶名是admin
Option pass.
Password.
Choose an alternative below. Press Enter for the default (n).
y) Yes, type in my own password
g) Generate random password
n) No, leave this optional password blank (default)
y/g/n> y
Enter the password:
password: # 這里要輸入兩次密碼,且都沒(méi)有顯示,就是之前配置的密碼
Confirm the password:
password:
Option bearer_token.
Bearer token instead of user/pass (e.g. a Macaroon).
Enter a value. Press Enter to leave empty.
bearer_token> # 直接回車
Edit advanced config?
y) Yes
n) No (default)
y/n> n #不需要編輯高級(jí)設(shè)置
Configuration complete.
Options:
- type: webdav
- url: http://localhost:5244/dav
- vendor: other
- user: admin
- pass: *** ENCRYPTED ***
Keep this "WebDav" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
Name Type
==== ====
WebDav webdav
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 # 最后再退出設(shè)置
配置完成之后,接下來(lái)就是運(yùn)行了,復(fù)制以下代碼
D:\rclone\rclone.exe mount WebDav:/ Z: --vfs-cache-mode writes --cache-dir cache --header "Referer:"
注意兩點(diǎn):
- “WebDav”就是之前設(shè)置的名稱,根據(jù)自己的情況修改
- 最后的
--header "Referer:"
一定要加!Reference
此外,如果打開(kāi)目錄操作文件出現(xiàn)IO Error
的報(bào)錯(cuò),可以考慮在alist配置中將302 重定向改為本地代理。Reference
??最后,就是設(shè)置自啟了,方法和前面的一樣,為了方便起見(jiàn),也可以和之前那個(gè)寫(xiě)到一起。因此,最后vbs文件里的內(nèi)容為:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-825998.html
Set ws = CreateObject("Wscript.Shell")
ws.run "D:\Alist\alist.exe server",vbhide
Set sw = CreateObject("Wscript.Shell")
sw.run "D:\rclone\rclone.exe mount WebDav:/ Z: --vfs-cache-mode writes --cache-dir cache --header 'Referer:'",vbhide
到此,所有的內(nèi)容都配置完畢了。接下來(lái)就可以自由在文件資源管理器中操作網(wǎng)盤文件了。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-825998.html
到了這里,關(guān)于【軟件相關(guān)】基于Alist掛載云盤到本地文件資源管理器的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!