gaowanliang / onedrivesharelinkpusharia2 Goto Github PK
View Code? Open in Web Editor NEWExtract download URLs from OneDrive or SharePoint share links and push them to aria2, even on systems without a GUI.
License: Apache License 2.0
Extract download URLs from OneDrive or SharePoint share links and push them to aria2, even on systems without a GUI.
License: Apache License 2.0
Traceback (most recent call last):
File "/root/github/OneDriveShareLinkPushAria2/main.py", line 418, in
downloadFiles(OneDriveShareURL, None, 0, aria2Link,
File "/root/github/OneDriveShareLinkPushAria2/main.py", line 177, in downloadFiles
originalDir = getAria2ConfigDir(aria2URL, token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/github/OneDriveShareLinkPushAria2/main.py", line 413, in getAria2ConfigDir
return json.loads(c.text)["result"]["dir"]
~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'result'
可能是oneDriver换了接口?
例如分享链接是一个文件夹:share/
当里面有多个子文件夹,比如share/music/ , share/video/ , share/photo/
如果在脚本中填入share/music/,那么就会出现"这个文件夹没有文件"
实际上在浏览器中打开也是这样,先打开share/,再打开share/music/是正常的,直接打开share/music/会提示需要登录。大概就是这样的问题。
那么能不能在脚本中实现类似浏览器中先打开share/,再打开share/music/的那种效果?就能正常获取到文件列表了。
#NSFW https://stankyo.sharepoint.com/:f:/s/SK002/Egpj3auYf1VOj_TFCG6OWmgB8_okYQQWUWpd-9R3_jIIzw?e=ug3p3V
另外212 行是否需要修改为
if isDownload:
downloadFiles(OneDriveShareURL, None, 0,aria2Link, aria2Secret,
start=downloadStart, num=downloadNum)
文件夹可以下载,单文件无法正常下载
下载无密码的链接
1、原地址不能识别
如帮助文件给出的链接https://gitaccuacnz2-my.sharepoint.com/:f:/g/personal/mail_finderacg_com/EheQwACFhe9JuGUn4hlg9esBsKyk5jp9-Iz69kqzLLF5Xw?e=FG7SHh
转换为原地址后如下,执行后报文 “ 这个文件夹没有文件”
https://gitaccuacnz2-my.sharepoint.com/personal/mail_finderacg_com/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Fmail%5Ffinderacg%5Fcom%2FDocuments%2F%E6%89%91%E6%A3%B1%E8%9B%BE%E5%AD%90&originalPath=aHR0cHM6Ly9naXRhY2N1YWNuejItbXkuc2hhcmVwb2ludC5jb20vOmY6L2cvcGVyc29uYWwvbWFpbF9maW5kZXJhY2dfY29tL0VoZVF3QUNGaGU5SnVHVW40aGxnOWVzQnNLeWs1anA5LUl6NjlrcXpMTEY1WHc%5FcnRpbWU9MndseTVpSl8yVWc
有密码的存问题如 #9
https://yantaimedshow-my.sharepoint.com/:f:/g/personal/lidongsheng2007_yantaimedshow_onmicrosoft_com/Eg3L-Vk3_E9EpFgBP0NBsVwB85nS-alkb0v4Ju5EinJ5ww?e=HKKLlL
密码是@teamfreeshare
输出:
[root@onstance-c Script]# python3 /home/Script/OneDriveShareLinkPushAria2/havepasword.py
正在启动无头浏览器模拟输入密码
Traceback (most recent call last):
File "/home/Script/OneDriveShareLinkPushAria2/havepassword.py", line 76, in
havePwdGetFiles(OneDriveShareURL, OneDriveSharePwd)
File "/home/Script/OneDriveShareLinkPushAria2/havepassword.py", line 55, in havPwdGetFiles
asyncio.get_event_loop().run_until_complete(main(iurl, password))
File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_compete
return future.result()
File "/home/Script/OneDriveShareLinkPushAria2/havepassword.py", line 28, in mai
browser = await launch()
File "/usr/local/lib/python3.6/site-packages/pyppeteer/launcher.py", line 307, n launch
return await Launcher(options, **kwargs).launch()
File "/usr/local/lib/python3.6/site-packages/pyppeteer/launcher.py", line 168, n launch
self.browserWSEndpoint = get_ws_endpoint(self.url)
File "/usr/local/lib/python3.6/site-packages/pyppeteer/launcher.py", line 227, n get_ws_endpoint
raise BrowserError('Browser closed unexpectedly:\n')
pyppeteer.errors.BrowserError: Browser closed unexpectedly:
我这运行发生了如下报错
Traceback (most recent call last):
File "/root/od/havepassword.py", line 73, in
havePwdDownloadFiles(OneDriveShareURL, OneDriveSharePwd, aria2Link,
File "/root/od/havepassword.py", line 65, in havePwdDownloadFiles
asyncio.get_event_loop().run_until_complete(main(iurl, password))
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/root/od/havepassword.py", line 28, in main
browser = await launch()
File "/usr/local/lib/python3.9/dist-packages/pyppeteer/launcher.py", line 307, in launch
return await Launcher(options, **kwargs).launch()
File "/usr/local/lib/python3.9/dist-packages/pyppeteer/launcher.py", line 148, in launch
self.proc = subprocess.Popen( # type: ignore
File "/usr/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/root/od/local-chromium/588429/chrome-linux/chrome'
Traceback (most recent call last):
File "main.py", line 388, in
getFiles(OneDriveShareURL, None, 0)
File "main.py", line 92, in getFiles
if "NextHref" in graphqlReq["data"]["legacy"]["renderListDataAsStream"]["ListData"]:
TypeError: 'NoneType' object is not subscriptable
使用测试的onedrive链接可以正常列出,用问题1的sharepoint链接和我自己的sharepoint链接都会报上述错误
https://fulanlan.sharepoint.com/:f:/s/fulan/EsJeZSf6QpBIritMqRLVR8YBomuxEiVoRsnRMOUIjGjFBQ?e=SwoIxT
有些分享链接是只支持同域账号查看的。我有账号,但是账号没有onedrive,只能查看,无法转存。
可不可以加上登录账号的功能,然后用账号信息进行下载。
现在只能输出文件列表,能不能把下载地址和文件目录输出到一个txt里面去,这里能改cooike,现在文件下载多后cooike就失效了
同一个onedrive 链接的内容统一放在一个文件夹里面
下载很多文件,发现很多文件为540B的文件
cat 该文件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=10"/>
<script src="throttleerror.js" type="text/javascript" ></script>
<title id="errorpagetitle"></title>
</head>
<body class="ms-core-needIEFilter" id="ms-error-body">
<div class="ms-pr" id="ms-error-header">
<h1 class="ms-core-pageTitle" id="errortitle">
</h1>
<p id="errortext"></p>
</div>
</body>
</html>
设置了单服务器连接数为32,单任务连接数64,最大同时下载数5.
测试过一个文件一个文件下载,仍然会出现该文件。需要增加判定,出现该文件需要进行重新下载。
请问有其他好的解决方案吗?
下载不管推送那个文件夹都是说文件夹中没有文件...
现在Sharepoint的默认分享链接是xxx.sharepoint.com
在下载时 会报错 提示
Traceback (most recent call last): File "/storage/emulated/0/Download/OneDriveShareLinkPushAria2/main.py", line 415, in <module> getFiles(OneDriveShareURL, None, 0) File "/storage/emulated/0/Download/OneDriveShareLinkPushAria2/main.py", line 107, in getFiles if "NextHref" in graphqlReq["data"]["legacy"]["renderListDataAsStream"]["ListData"]: TypeError: 'NoneType' object is not subscriptable
已测试自带的demo链接。无报错,只有这个报错
看了一下OneDrive第一次只加载前30个文件,后面的文件必须下拉才会加载,不知道有没有解决方法
已确认rpc相关设置可以连通,isDownload设置为了true,downloadNum设置为了-1,测试链接是readme的链接,https://gitaccuacnz2-my.sharepoint.com/:f:/g/personal/mail_finderacg_com/EheQwACFhe9JuGUn4hlg9esBsKyk5jp9-Iz69kqzLLF5Xw?e=FG7SHh ,结果上来看显示非目标文件
First, I made a docker image with the following dockerfile:
Next, I deployed it with docker compose:
And then changed the download link and aria2 server address as the docker compose file:
Last, I deployed the stack, and the log in docker portainer showed this error (maybe function?)
With the script run once, a new error log generates, repeatedly.
And I found two parts with the same text in the main.py script, but as an Operator, I do not know any of python programming.
May you tell me something about this? Thank you very much~
And I can understand both English and Chinese Simplified, so I prefer you using any of these languages.
Wish you a good day!
正在启动无头浏览器模拟输入密码
密码输入完成,正在跳转
正在获取Cookie
无头浏览器关闭,正在获取文件列表
这个文件夹没有文件
Process finished with exit code 0
我可以肯定我输入的是分享链接,但是无法下载
之前用都好好的,突然出现了这个问题,不知道原因在哪里。
正在启动无头浏览器模拟输入密码
密码输入完成,正在跳转
正在获取Cookie
无头浏览器关闭,正在获取文件列表
这个文件夹没有文件
事实是文件夹里有文件的
chromium下载后完后 卡在 "正在启动无头浏览器模拟输入密码" 网盘密码填写正确的,不知道什么原因
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.