• 欢迎访问db1024网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏db1024吧

一个可以绑定多个OneDrive网盘的极简目录列表:OneList

建站知识 Liam 9个月前 (12-26) 359次浏览 11个评论 扫描二维码
文章目录[隐藏]

说明:OneList以前介绍过,主要的特色就是解决了因OneDrive API抽风导致的很多问题,稳定性和访问速度都是不错的。不过由于使用Python写的,而Py单线程容易阻塞,响应够迅速,刷新缓存时,Web端请求基本不可用,所以在整体性能上有点瑕疵。基于Golang的性能更好,效率更高,多盘并发缓存等众多好处,于是萌咔大佬就弃用Python版本,使用Golang重写了OneList,同时支持国际版、个人免费版(家庭版)、中国版(世纪互联)及多网盘绑定。

截图

一个可以绑定多个OneDrive网盘的极简目录列表:OneList

功能

  • 支持国际版、个人免费版(家庭版)、中国版(世纪互联)。
  • 支持同时列出多个盘的目录。(要求每个盘的SubPath唯一)
  • 支持文件夹内超过200个项目。
  • 支持后台自动刷新缓存。
  • 支持路径中含有特殊字符。
  • 数据储存在内存中,响应更加迅速。

安装

Github地址:https://github.com/MoeClub/OneList/tree/master/WriteByGolang

1、授权认证
点击右侧URL登录并授权,授权【国际版、个人版(家庭版)】、【中国版(世纪互联)】。

授权后会获取一个localhost开头打不开的链接,这里复制好整个链接地址,包括localhost

2、安装OneList

#新建并进入OneList目录 mkdir /opt/OneList && cd $_  #64位系统下载 wget https://raw.githubusercontent.com/MoeClub/OneList/master/WriteByGolang/amd64/linux/OneList #32位系统下载 wget https://raw.githubusercontent.com/MoeClub/OneList//master/WriteByGolang/i386/linux/OneList #arm架构下载 wget https://raw.githubusercontent.com/MoeClub/OneList/master/WriteByGolang/arm/linux/OneList      #给予权限 chmod +x OneList 

3、使用命令

Usage of OneList:   -a string         // 初始化配置文件,添加新配置         Setup and Init auth.json.   -bind string         // 绑定IP地址(公网: 0.0.0.0)         Bind Address (default "127.0.0.1")   -port string         // 绑定端口(HTTP:80)         Port (default "5288")   -s string         // 设置 SubPath 项, 需要与 -a 一起使用.         Set SubPath. [unique per account] (default "/")   -c string         // 配置文件         Config file. (default "config.json")   -t string         // Index.html 目录样式文件         Index file. (default "index.html")   -cn         // 开关         // 授权中国版(世纪互联), 需要此参数.         OneDrive by 21Vianet.   -ms         // 开关         // 授权个人版(家庭版), 需要此参数.         OneDrive by Microsoft. 

4、生成配置文件

#国际版,将url换成你上面复制的授权地址,包括http://loaclhost。 ./OneList -a "url" -s "/onedrive01"  #个人版(家庭版),将url换成你上面复制的授权地址,包括http://loaclhost。 ./OneList -ms -a "url" -s "/onedrive02"  #中国版(世纪互联),将url换成你上面复制的授权地址,包括http://loaclhost。 ./OneList -cn -a "url" -s "/onedrive03" 

提示Success! Add config. '/path/to/config.json'信息,则添加成功。

这里要注意的是:

1、授权url地址只能用一次,超过需要重新授权。 2、命令中的/onedrive01参数为指定网盘地址后缀,比如http://domain.com/onedrive01。 3、授权多个网盘的话,重复授权多次即可,参数均会添加到一个配置文件,且后缀不能重复。 4、地址后缀填错了的,可以稍后在配置文件中修改。 

本文默认的配置文件路径/opt/OneList/config.json,参数详解,可自行修改:

[   {     // 如果是家庭版或者个人免费版, 此项应为 true.     "MSAccount": false,     // 如果是中国版(世纪互联), 此项应为 true.     "MainLand": false,     // 授权令牌     "RefreshToken": "1234564567890ABCDEF",     // 单配置文件中,此项要唯一.将此OneDrive目录映射在 "/onedrive" 下. (支持根目录"/", 只推荐一个盘位的时候使用"/".)     "SubPath": "/onedrive",     // 读取OneDrive的某个目录作为根目录. (支持根目录"/")     "RootPath": "/Test",     // 缓存刷新间隔.(所有项目中的刷新时间取最小值为有效刷新间隔)     "RefreshInterval": 900   } ]

这里注意,挂载多个盘符的时候,SubPath参数请不要为/,单个网盘建议为/

5、运行OneList

#下载index.html,与config.json同目录,即本文默认的/opt/OneList wget https://raw.githubusercontent.com/MoeClub/OneList/master/WriteByGolang/index.html -P /opt/OneList #监听8000地址,自行修改 /opt/OneList/OneList -bind 0.0.0.0 -port 8000 

最后打开ip:端口访问即可,如果你挂载网盘的时候SubPath/,那么直接通过根目录查看,如果为/onedrive1,那么通过ip:端口/onedrive1查看,如果该路径不存在,则会提示No Found.

且首次运行会异步缓存,也就是至少有一个盘缓存成功了,才会显示。

6、开机自启
这里新建一个简单的systemd配置文件,适用CentOS 7Debian 8+Ubuntu 16+

使用命令:

#设置你的运行监听端口,即你可以通过ip:端口访问程序,这里默认8000。 port="8000" #将以下代码一起复制到SSH运行 cat > /etc/systemd/system/onelist.service <<EOF [Unit] Description=onelist After=network.target  [Service] Type=simple ExecStart=/opt/OneList/OneList -bind 0.0.0.0 -port ${port} Restart=on-failure  [Install] WantedBy=multi-user.target EOF #启动并设置开机自启 systemctl start onelist systemctl enable onelist 

卸载

#未设置开机自启 rm -rf /opt/OneList  #设置过开机自启 systemctl stop onelist systemctl disable onelist rm -rf /opt/OneList /etc/systemd/system/onelist.service 

最后如果我们只想显示网盘的某些文件夹,那么可以分别挂载该网盘的不同目录即可,具体操作看配置文件说明。

如果有发现该程序存在BUG,可以提下,方便修复,有会前端的热心大佬,也可以自荐下,帮忙美化下该前端。


db1024 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:一个可以绑定多个OneDrive网盘的极简目录列表:OneList
喜欢 (0)
关于作者:
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(11)个小伙伴在吐槽
  1. I am not sure where you're getting your info, but great topic. I needs to spend some time learning more or understanding more. Thanks for great information I was looking for this information for my mission.
    black mass2020-08-31 13:53 回复 Windows 7 | Internet Explorer 9.0
  2. Hello it's me, I am also visiting this web site on a regular basis, this web site is truly pleasant and the users are truly sharing nice thoughts.
    black mass2020-08-28 16:39 回复 Mac OS X | Chrome 67.0.3396.87
  3. I'm truly enjoying the design and layout of your website. It's a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a designer to create your theme? Great work!
    cheap flights2020-08-28 08:12 回复 Windows 7 | Internet Explorer 10.0
  4. I read this paragraph fully on the topic of the difference of hottest and earlier technologies, it's remarkable article.
    cheap flights2020-08-28 06:06 回复 Mac OS X | Chrome 67.0.3396.87
  5. Thank you for the auspicious writeup. It in fact was once a entertainment account it. Look complicated to more added agreeable from you! However, how can we be in contact?
    cheap flights2020-08-27 14:54 回复 Windows 7 | Opera 9.80
  6. Thank you for the auspicious writeup. It in fact was once a amusement account it. Glance advanced to far introduced agreeable from you! By the way, how can we keep in touch? y2yxvvfw cheap flights
    cheap flights2020-08-26 18:50 回复 Mac OS X | Chrome 66.0.3359.181
  7. Ahaa, its fastidious discussion regarding this paragraph here at this website, I have read all that, so now me also commenting here. 3aN8IMa cheap flights
    cheap flights2020-08-25 05:04 回复 Windows 7 | 360浏览器 SE
  8. Howdy! I'm at work surfing around your blog from my new iphone 4! Just wanted to say I love reading your blog and look forward to all your posts! Keep up the excellent work!
    cheap flights2020-08-24 16:54 回复 Linux | Firefox浏览器 52.9
  9. With havin so much content do you ever run into any problems of plagorism or copyright violation? My website has a lot of completely unique content I've either written myself or outsourced but it looks like a lot of it is popping it up all over the web without my agreement. Do you know any solutions to help prevent content from being stolen? I'd certainly appreciate it.
    web hosting providers2020-08-14 19:12 回复 Mac OS X | Chrome 53.0.2785.143
  10. Hello would you mind letting me know which hosting company you're working with? I've loaded your blog in 3 completely different internet browsers and I must say this blog loads a lot faster then most. Can you recommend a good web hosting provider at a fair price? Many thanks, I appreciate it!
    web hosting providers2020-08-11 23:50 回复 Linux | Chrome 67.0.3396.79
  11. I've been browsing online more than 3 hours today, yet I never found any interesting article like yours. It's pretty worth enough for me. Personally, if all website owners and bloggers made good content as you did, the internet will be much more useful than ever before.
    web hosting companies2020-08-11 16:37 回复 Windows 7 | 360浏览器 SE