使用Picgo并魔改Picgo-plugin-rclone插件实现OneDrive(Sharepoint)+OneManager图床功能

使用Picgo并魔改Picgo-plugin-rclone插件实现OneDrive(Sharepoint)+OneManager图床功能

碎碎念

任何魔改都有风险,请在魔改前做好备份准备

之前用的图床都是Gitee之类的 之后Gitee官方直接就各种限制

之后我使用了网上各大图床 但是还有跑路的

之后使用了B站图床 到最后还是想到了老办法 Microsoft E5套餐里面免费大碗的Onedrive(当然也可以用Sharepoint)

在这之前 也有大佬做过picgo-plugin-onemanager 但是功能有些受限 比如只能使用公开目录(Guest)且报错频率UPUPUP而且无法备份什么的 但是也是大佬嘛(((

在这里我使用的版本是 1.1.15 版本的Picgo-plugin-rclone 如果失败可以尝试降级到我这个版本

为什么要魔改?

这个插件在我几个月前就开始研究了 但是一直没有用好

他在本来的插件里面 有个配置是桶名配置 但是OneDrive并没有”桶名”

魔改思路:

将桶名选项彻底删除

教程

演示:Windows(mac落在学校社团了 还在网课阶段)

安装rclone

下载rclone

https://github.com/rclone/rclone

请前去release下载

配置Path

请解压你的rclone压缩包

解压目录请复制 按下快捷键Win + i

进入选项:系统 => 关于 并且 找到高级系统选项

点击环境变量 选择Path之后点击下面的编辑

添加你刚才复制的地址

验证rclone是否安装好

Win + i 输入`cmd` 输入`rclone`查看是否有响应 如果有 那就可以继续了! #### 配置rclone rclone配置 在终端输入 `rclone config` 我们需要创建一个远程链接 输入`n`新建一个 之后会要求 输入一个名字 随便填 之后我们需要选择一个存储位置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
 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, China Mobile, Cloudflare, ArvanCloud, Digital Ocean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, IONOS Cloud, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi
\ (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 / In memory object storage system.
\ (memory)
24 / Internet Archive
\ (internetarchive)
25 / Jottacloud
\ (jottacloud)
26 / Koofr, Digi Storage and other Koofr-compatible storage providers
\ (koofr)
27 / Local Disk
\ (local)
28 / Mail.ru Cloud
\ (mailru)
29 / Mega
\ (mega)
30 / Microsoft Azure Blob Storage
\ (azureblob)
31 / Microsoft OneDrive
\ (onedrive)
32 / OpenDrive
\ (opendrive)
33 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ (swift)
34 / Oracle Cloud Infrastructure Object Storage
\ (oracleobjectstorage)
35 / Pcloud
\ (pcloud)
36 / Put.io
\ (putio)
37 / QingCloud Object Storage
\ (qingstor)
38 / SMB / CIFS
\ (smb)
39 / SSH/SFTP
\ (sftp)
40 / Sia Decentralized Cloud
\ (sia)
41 / Storj Decentralized Cloud Storage
\ (storj)
42 / Sugarsync
\ (sugarsync)
43 / Transparently chunk/split large files
\ (chunker)
44 / Union merges the contents of several upstream fs
\ (union)
45 / Uptobox
\ (uptobox)
46 / WebDAV
\ (webdav)
47 / Yandex Disk
\ (yandex)
48 / Zoho
\ (zoho)
49 / premiumize.me
\ (premiumizeme)
50 / seafile
\ (seafile)

选择一个(确保你有创建它直链的权限)

这里我选择Onedrive (后期可以选择Sharepoint)

之后后期就可以按照提示做了

下载并且安装Picgo

https://github.com/Molunerfinn/PicGo

release下载

安装Picgo-plugin-rclone

点击Picgo内的插件设置

搜索Picgo-plugin-rclone 并且安装rclone插件

魔改Picgo-plugin-rclone

任何魔改都有风险,请在魔改前做好备份准备

进行此步操作前 请关闭Picgo

正常目录应该在C:\Users\用户名\AppData\Roaming\picgo\node_modules\picgo-plugin-rclone

但是也有可能在别的地方 比起这个 我更推荐你使用Everything这款软件搜索picgo-plugin-rclone来找到它的目录

打开这个目录 找到dist 打开index.js

如果打开全是乱码可以尝试把UTF-8 改成GB2313

Ctrl + f 搜索到它并且删除它
1
2
3
4
5
6
7
8
{
name: 'remoteBucketName',
type: 'input',
default: userConfig.remoteBucketName,
required: true,
message: 'BucketName',
alias: '桶名'
},

Ctrl + f 搜索到它并且删除它(全部删除共4个)

+ userConfig.remoteBucketName + '/'

Ctrl + f 搜索到它并且删除它(全部删除共6个)

+ userConfig.remoteBucketName + "/"

Ctrl + s 保存 大功告成 之后打开Picgo

配置Picgo-plugin-rclone

选项名作用/必填或选填填写内容
远端存储名必填配置rclone时的名字
域名前缀必填http(s)://域名/文件夹(如果此文件夹出现在上传路径内,请不要填写在内,最后一个字符不能是/)
桶下前缀Prefix选填/最好不填此选项并不适用在此教程
上传路径选填(默认根目录)输入就在所指定的目录下上传
备份存储名1选填配置rclone时的名字
备份存储名2选填配置rclone时的名字
备份存储名3选填配置rclone时的名字
本地备份绝路径选填Linux/Macos /home/rclone-picgo Windows C:\rclone-picgo

完成啦 可以正常使用了!

此文章的图片也是这样子上传的哦!