Giter Site home page Giter Site logo

onelist's Introduction

开始使用 (测试版,更新中...)

Python3版本Bug较多,功能不全. 推荐使用 Written in GoLang 版本

所需依赖

# 自行安装 python3
pip3 install tornado

通过下面URL登录 (右键新标签打开)

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=78d4dc35-7e46-42c6-9023-2d39314433a5&response_type=code&redirect_uri=http://localhost/onedrive-login&response_mode=query&scope=offline_access%20User.Read%20Files.ReadWrite.All

初始化配置文件

# 运行
python3 OneList.py

# 在浏览器地址栏中获取 code 字段内容
# 粘贴并按回车, 每个 code 只能用一次
# 此操作将会自动初始化的配置文件

自定义配置文件

# config.json

{
    // OneDrive 中的某个需要列出的目录
    "RootPath": "/Document",
    // 网址中的子路径
    "SubPath": "/onedrive",
    // 目录刷新时间
    "FolderRefresh": 900,
    // 下载链接刷新时间
    "FileRefresh": 1200,
    // 认证令牌, 将会自动更新, 保持默认
    "RefreshToken": "",
    // 这个不用管, 保持默认
    "RedirectUri": "http://localhost/onedrive-login"
}

运行

python3 app.py

# 默认监听 127.0.0.1:5288 , 可在 app.py 中自行更改.

展示

https://moeclub.org/onedrive/

onelist's People

Contributors

moeclub avatar sxyazi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onelist's Issues

希望加入根据用户名决定根目录位置

onelist的安全机制是不是不太够?
如果我只设置根目录加密,路径加入onedrive里面的某个文件夹的名称是可以直接访问的
如果隐藏路径,我自己作为管理员又不能访问了全部路径了

能不能改成“单网盘的时候,根据用户名决定根目录位置”,这样在分享文件的时候就不用全部上锁了

目前有用到filebrowser这款也是golang开发的目录管理应用
感觉里面能够分用户定义不同的根目录,在分享文件夹的时候很有用,不知道能否作为借鉴..

Snipaste_2020-02-14_23-34-27

刚跑错地方了233,最后感谢MoeClub大佬开发✿✿ヽ(°▽°)ノ✿

Error Session: 429 错误

root@ip-172-31-6-136:~# OneDriveUploader -c /root/auth.json -s "/usr/local/Download/1.txt"
Error Session: 429
Upload fail: /usr/local/Download/1.txt

Error Session: 429
Upload fail: /usr/local/Download/1.txt

Fail Task: [1]

1: /usr/local/Download/1.txt
Time: 1s

出现Error Session: 429 错误请问怎么解决?文件大小不到1KB,并没有频繁上传。

arm版本报错无法执行

我在Armbian_5.67_Aml-s9xxx_Debian_stretch_default_4.19.2这个版本使用萌咖大佬的arm版本程序没问题
但是在Armbian_20.02.0-rc1.037_Aml-s9xxx_buster_current_5.5.0-rc6这个版本就不行了
提示无法执行二进制文件报错

个人可复现bug:onelist不能显示.exe.md5之类多个文件格式为后缀的文件(包括在后面的文件也消失)

在以.exe.md5/.dmg.md5/.tar.gz.md5为后缀的文件后面的文件不会显示。(包括以.exe.md5/.dmg.md5/.tar.gz.md5为后缀的文件也不显示)
删除了md5为后缀的文件后,后面其他格式的文件就能显示了。

这个是在python版天翼云盘上发现的Bug,但我不确定是onelist的问题还是写天翼云盘的大佬的程序问题。
不显示
原本是有的

OneDriveUploader上传大文件卡在100%

OneDriveUploader在上传比较大的文件(大于2G)时,在上传完成后无法退出,卡在100%
企业微信截图_20191223112710
system: Ubuntu 16.04.2 LTS (GNU/Linux 4.10.17-041017-generic i686)

安装后访问No Found

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install python36 redis
systemctl start redis
systemctl enable redis
pip3 install tornado
python3 OneList.py

-获取了code,并且提示了Success, Init config.

python3 app.py

-运行后显示了文件夹和各种文件的缓存.
-设置了反向代理.代理本地5288端口,访问提示No Found

Error: ; //;
[W 191204 19:24:35 web:2246] 404 GET / (IP) 0.93ms

请大佬指导

上传问题

每次上传,内存占用都是越来高,最后爆掉了,希望大佬优化一下。

Win10版本的,上传卡在100%

我看了下之前的lssues 也有人反应了会卡在100%,那个是Linux版本的。我用Win10版本的同样也会卡在100%,无法退出,去Onedrive看 文件并没有上传成功的,而且每次都是这样,但是小文件又没事。好像是大于2G的上传就会卡在100%,小于2G好像没事,目前我是这样的情况。
2211

支持一下X32吧

支持一下X32吧,小鸡配置不佳,还是需要X32的,拜托了。

access roken 1小时有效期

The access token has expired. It's valid from '1/9/2020 5:03:31 AM' and to '1/9/2020 6:03:31 AM'.

由于盘内文件比较多,每次cache都要花费接近一小时,所有经常出现上述错误。请问有办法增加access token的有效期吗,比如24或72小时之类的。

无法获得授权网址,请问什么原因?

HTTP 错误 404.4 - Not Found
您要查找的资源没有与之关联的处理程序。

最可能的原因:
所请求 URL 的文件扩展名没有配置处理程序来处理 Web 服务器上的请求。

可尝试的操作:
如果文件扩展名没有与之关联的处理程序,请为该扩展名添加一个处理程序映射。
确认已正确安装和配置了与文件扩展名相关联的处理程序。
创建跟踪规则以跟踪此 HTTP 状态代码的失败请求。有关为失败的请求创建跟踪规则的详细信息,请单击此处。

No Found

Snipaste_2019-12-18_15-04-58
Snipaste_2019-12-18_15-06-01
萌咖大佬看下是什么情况呢?

上传出错

Linux 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
64位 世纪互联
上传了一个6G的文件30%出错
上传一个2G 的文件84%出错两次第三次成功
批注 2020-01-08 003045

执行正常,访问时报No Found

感谢分享这个程序!

执行python3 app.py后访问网站首页报No Found
subpath留空或定义/,或配合nginx反代加子目录都一样

python3 app.py执行一会后会报
UnicodeEncodeError: 'ascii' codec can't encode characters in position 30-33: ordinal not in range(128)

无法获取到到refresh_token字段

执行
python3 app.py
提示:

Traceback (most recent call last):
  File "/home/ice/miniconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "app.py", line 94, in run
    self.function(*self.args, **self.kwargs)
  File "app.py", line 106, in InitMS
    cls.Config()
  File "app.py", line 101, in Config
    MS.getAccessToken()
  File "/mnt/c/Users/ice/OneDrive/repository/OneList/OneList.py", line 236, in getAccessToken
    raise Exception("Error, Get Access.")
Exception: Error, Get Access.

定位到如下函数:

def getAccessToken(self, refreshToken=None):
        data = self.accessData('refresh_token')
        if refreshToken is None:
            data["refresh_token"] = self.refresh_token
        else:
            data["refresh_token"] = refreshToken
        Data = "&".join([str("{}={}").format(item, data[item]) for item in data])
        page = Utils.http("https://login.microsoftonline.com/common/oauth2/v2.0/token", "POST", data=Data, headers=self.getHeader())
        resp = json.loads(page.read().decode())
        if "refresh_token" in resp and "access_token" in resp:
            self.access_token = resp["access_token"]
            self.refresh_token = resp["refresh_token"]
        else:
            raise Exception("Error, Get Access.")

我输出resp ,看了一下,好像是无法获取refresh_token字段,只有access_token。
是我设置的问题还是OneDrive那边的接口更改了?

Bug report

RootPath不支持 /

只支持二级目录

不能定时启动

您好,我使用crontab -e添加定时启动
0 0 * * * OneDriveUploader -c /root/auth.json -s "aa.tar.gz"
但是它好像没能正常启动

遇到文件/文件夹名带百分号(%)时报错

20200122024738

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7671a6]

goroutine 14 [running]:
main.QueryItem(0xc000824000, 0x13b, 0xc000267100, 0x680, 0x0, 0x0, 0x0, 0x0, 0x0)
	C:/main.go:373 +0xe6
main.GetList(0xc00008e100, 0xc0005cafd0, 0xaf)
	C:/main.go:355 +0x493
main.GetList(0xc00008e100, 0xc00052fa80, 0x7c)
	C:/main.go:362 +0x72c
main.GetList(0xc00008e100, 0xc00026e3c0, 0x45)
	C:/main.go:362 +0x72c
main.GetList(0xc00008e100, 0xc0000e2040, 0x32)
	C:/main.go:362 +0x72c
main.CacheRefreshMain(0xc00008e100)
	C:/main.go:238 +0x8d
created by main.CacheRefresh
	C:/main.go:333 +0x344

目前只能暂时改为全角百分号来解决

nginx调用防盗链出现404

location ~* \.(mp4|mp3|flac|mkv|zip|rar|pdf|msi|avi)$ { valid_referers none blocked *.123.com 123.com; if ($invalid_referer){ rewrite ^/ 123.com; } }
作者你好,实现的过程中出现了一个问题。插入此防盗链后,在原网站上点击相应后缀文件出现404,想请教下作者这是什么原因。

上传大文件遇到未知问题

image

如图所示的上传命令, 文件大小为24G, Remain 会一直高速增长, Onedrive 里也能看到生成的 temp 文件. 在一段时间后, 会出现上传失败, 返回 code 是 1.

用的 Oracle 东京 VPS, 上传带宽 50MB.

希望可以根据用户名决定根目录位置

onelist的安全机制是不是不太够?
如果我只设置根目录加密,路径加入onedrive里面的某个文件夹的名称是可以直接访问的
如果隐藏路径,我自己作为管理员又不能访问了全部路径了

能不能改成“单网盘的时候,根据用户名决定根目录位置”,这样在分享文件的时候就不用全部上锁了

目前有用到filebrowser这款也是golang开发的目录管理应用
感觉里面能够分用户定义不同的根目录,在分享文件夹的时候很有用,不知道能否作为借鉴..

Snipaste_2020-02-14_23-34-27

最后感谢大佬开发✿✿ヽ(°▽°)ノ✿

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.