Extract the download URL from OneDrive or SharePoint share link and push it to aria2

Overview

OneDriveShareLinkPushAria2

Extract the download URL from OneDrive or SharePoint share link and push it to aria2

从OneDrive或SharePoint共享链接提取下载URL并将其推送到aria2,即使在无图形界面的系统中依然可以使用。

依赖

requests==2.25.1 pyppeteer==0.2.5

使用方法

目前本程序支持的下载方式:

  • xxx-my.sharepoint.com 下载链接的下载
    • 无下载密码的多文件推送
    • 有下载密码的多文件推送
    • 嵌套文件夹的文件推送
    • 任意选择文件推送
  • xxx-my.sharepoint.cn 下载链接的下载(理论上支持)

无密码的链接

https://gitaccuacnz2-my.sharepoint.com/:f:/g/personal/mail_finderacg_com/EheQwACFhe9JuGUn4hlg9esBsKyk5jp9-Iz69kqzLLF5Xw?e=FG7SHh 这个下载链接为例

此时需要使用无密码的下载代码,也就是main.py,打开这个文件,可以看到有一些全局变量:

如果想要下载第二个文件,则需要downloadStart=2downloadNum=1

如果想要下载第二、第三个文件,则需要downloadStart=2downloadNum=2

修改好后,确保目标aria2处于开启状态,执行python3 main.py

有密码的链接

https://jia666-my.sharepoint.com/:f:/g/personal/1025_xkx_me/EsqNMFlDoyZKt-RGcsI1F2EB6AiQMBIpQM4Ka247KkyOQw?e=oC1y7r 这个下载链接为例

此时需要使用有密码的下载代码,也就是havepassword.py,打开这个文件,可以看到有一些全局变量(重复的不再赘述):

  • OneDriveSharePwd: OneDrive链接的密码

使用方法和上面类似。

注意

使用前,使用 git clone https://github.com/gaowanliang/OneDriveShareLinkPushAria2.git 将项目整个克隆,才能使用,havepassword.py依赖于main.py,如果要使用需要密码的版本,需要 pip install pyppeteer

Comments
  • 这个文件夹没有文件

    这个文件夹没有文件

    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&ga=1

    opened by speakstone 4
  • 貌似有密码的还有点问题?

    貌似有密码的还有点问题?

    我这运行发生了如下报错

    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'

    opened by wdtgbot 4
  • 有些OneDrive的链接无法下载

    有些OneDrive的链接无法下载

    #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)

    opened by yanshibin 4
  • 请问一下任务推送是不是出了点问题啊,显示非目标文件

    请问一下任务推送是不是出了点问题啊,显示非目标文件

    已确认rpc相关设置可以连通,isDownload设置为了true,downloadNum设置为了-1,测试链接是readme的链接,https://gitaccuacnz2-my.sharepoint.com/:f:/g/personal/mail_finderacg_com/EheQwACFhe9JuGUn4hlg9esBsKyk5jp9-Iz69kqzLLF5Xw?e=FG7SHh ,结果上来看显示非目标文件 IMG_20210907_151913.jpg IMG_20210907_151830.jpg

    opened by railway7 2
  • 分享链接的子目录下载问题

    分享链接的子目录下载问题

    例如分享链接是一个文件夹:share/

    当里面有多个子文件夹,比如share/music/ , share/video/ , share/photo/

    如果在脚本中填入share/music/,那么就会出现"这个文件夹没有文件"

    实际上在浏览器中打开也是这样,先打开share/,再打开share/music/是正常的,直接打开share/music/会提示需要登录。大概就是这样的问题。

    那么能不能在脚本中实现类似浏览器中先打开share/,再打开share/music/的那种效果?就能正常获取到文件列表了。

    wontfix 
    opened by haoduck 1
  • sharepoint链接报错

    sharepoint链接报错

    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

    opened by Fulanlan 1
  • 更新后内容不超过30个数的分享链接下载失败

    更新后内容不超过30个数的分享链接下载失败

    如图 报错

    添加判断再使用旧版本代码后可用

    if filesData==None: pat = re.search( 'g_listData = {"wpq":"","Templates":{},"ListData":{ "Row" : ([\s\S]*?),"FirstRow"', reqf.text) filesData = json.loads(pat.group(1))

    推测新判断规则不适用于内容不超过30个数的分享链接

    opened by 666wcy 1
  • fix: add retry on request, fix chromium error

    fix: add retry on request, fix chromium error

    修复以下问题:

    1. 使用havepassword.pychromium无法启动,出现pyppeteer.errors.BrowserError: Browser closed unexpectedly错误或者进程意外退出。
    2. request增加了重试,减少urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))一类错误的发生频率。
    opened by Mikubill 0
  • xxx.sharepoint.com不再受支持

    xxx.sharepoint.com不再受支持

    现在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链接。无报错,只有这个报错

    opened by mynameispy 0
  • 推送到aria2的文件下载后都说570b

    推送到aria2的文件下载后都说570b

    连接 https://onmyteams-my.sharepoint.com/personal/c3_meta_stulive_com/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Fc3%5Fmeta%5Fstulive%5Fcom%2FDocuments%2FCP%2DFinal&ga=1

    opened by yoyoakalin 11
Owner
高玩梁
私、気になります
高玩梁
A simple tool to move and rename Nvidia Share recordings to a more sensible format.

A simple tool to move and rename Nvidia Share recordings to a more sensible format.

Jasper Rebane 8 Dec 23, 2022
🍰 ConnectMP - An easy and efficient way to share data between Processes in Python.

ConnectMP - Taking Multi-Process Data Sharing to the moon ?? Contribute · Community · Documentation ?? Introduction : ?? ConnectMP is the easiest and

Aiden Ellis 1 Dec 24, 2021
tade is a discussion/forum/link aggregator application. It provides three interfaces: a regular web page, a mailing list bridge and an NNTP server

tade is a discussion/forum/link aggregator application. It provides three interfaces: a regular web page, a mailing list bridge and an NNTP server

Manos Pitsidianakis 23 Nov 4, 2022
Generates a random prnt.sc link and display image.

Generates a random prnt.sc link and display image.

Emirhan 3 Oct 8, 2021
A script copies movie and TV files to your GD drive, or create Hard Link in a seperate dir, in Emby-happy struct.

torcp A script copies movie and TV files to your GD drive, or create Hard Link in a seperate dir, in Emby-happy struct. Usage: python3 torcp.py -h Exa

ccf2012 105 Dec 22, 2022
Link-tree - Script that iterate over the links found in each page

link-tree Script that iterate over the links found in each page, recursively fin

Rodrigo Stramantinoli 2 Jan 5, 2022
An URL checking python module

An URL checking python module

Fayas Noushad 6 Aug 10, 2022
Python program for Linux users to change any url to any domain name they want.

URLMask Python program for Linux users to change a URL to ANY domain. A program than can take any url and mask it to any domain name you like. E.g. ne

null 2 Jun 20, 2022
Utility to extract Fantasy Grounds Unity Line-of-sight and lighting files from a Univeral VTT file exported from Dungeondraft

uvtt2fgu Utility to extract Fantasy Grounds Unity Line-of-sight and lighting files from a Univeral VTT file exported from Dungeondraft This program wo

Andre Kostur 29 Dec 5, 2022
Handy Tool to check the availability of onion site and to extract the title of submitted onion links.

This tool helps is to quickly investigate a huge set of onion sites based by checking its availability which helps to filter out the inactive sites and collect the site title that might helps us to categories what site we are handling.

Balaji 13 Nov 25, 2022
A simple tool to extract python code from a Jupyter notebook, and then run pylint on it for static analysis.

Jupyter Pylinter A simple tool to extract python code from a Jupyter notebook, and then run pylint on it for static analysis. If you find this tool us

Edmund Goodman 10 Oct 13, 2022
extract gene TSS/TES site form gencode/ensembl/gencode database GTF file and export bed format file.

GetTsite python Package extract gene TSS/TES site form gencode/ensembl/gencode database GTF file and export bed format file. Install $ pip install Get

laojunjun 7 Nov 21, 2022
About Library for extract infomation from thai personal identity card.

ThaiPersonalCardExtract Library for extract infomation from thai personal identity card. imprement from easyocr and tesseract New Feature v1.3.2 ?? In

ggafiled 26 Nov 15, 2022
Python based tool to extract forensic info from EventTranscript.db (Windows Diagnostic Data)

EventTranscriptParser EventTranscriptParser is python based tool to extract forensically useful details from EventTranscript.db (Windows Diagnostic Da

P. Abhiram Kumar 24 Nov 18, 2022
Extract XML from the OS X dictionaries.

Extract XML from the OS X dictionaries.

Joshua Olson 13 Dec 11, 2022
A python module for extract domains

A python module for extract domains

Fayas Noushad 4 Aug 10, 2022
A hashtag from string extract python module

A hashtag from string extract python module

Fayas Noushad 3 Aug 10, 2022
Program to extract signatures from documents.

Extracting Signatures from Bank Checks Introduction Ahmed et al. [1] suggest a connected components-based method for segmenting signatures in document

Muhammad Saif Ullah Khan 9 Jan 26, 2022
This is discord nitro code generator and checker made with python. This will generate nitro codes and checks if the code is valid or not. If code is valid then it will print the code leaving 2 lines and if not then it will print '*'.

Discord Nitro Generator And Checker ⚙️ Rᴜɴ Oɴ Rᴇᴘʟɪᴛ ??️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs If you are taking code from this repository without a fork, then atleast

Vɪɴᴀʏᴀᴋ Pᴀɴᴅᴇʏ 37 Jan 7, 2023