GithubHelp home page GithubHelp logo

sunlewuyou / getonedrivedirectlink Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mapaler/getonedrivedirectlink

0.0 0.0 0.0 353 KB

批量获取OneDrive直链

License: GNU Lesser General Public License v3.0

JavaScript 76.91% HTML 17.68% CSS 5.41%

getonedrivedirectlink's Introduction

获取OneDrive直链

本应用的目的是为了批量获取OneDrive直链,方便在其他站点外链。前身为提取OneDrive直链地址工具的网页版,因为原来的工具失效了,软件版也不是那么好用了,因此决定使用OneDrive官方SDK来进行获取,确保不失效。

马上使用

该翻的自己翻
https://mapaler.github.io/GetOneDriveDirectLink/

隐私声明

使用微软官方OneDrive file picker SDK,本应用不会得到你的账号密码和其他用户资料。 目前仅申请了Files.ReadFiles.Read.Selected两个权限,SDK只会返回用户选择的文件的信息,不会获得未授权的其他内容。

如何自行搭建

按照OneDrive file picker SDK内的说明进行,由于旧有的Microsoft 应用注册门户已经迁移到Azure门户,特此做出更新,此版本更新于2020年2月6日。

  1. 应用注册
    Azure门户创建应用,自己申请一个应用 ID,然后替换本程序script.js内底部的clientId
    客户端ID
    其中odOptions.advanced.queryParameters内容参见 DriveItem 资源类型,若不设定,将只返回基本信息。
  2. 设置身份验证
    将网页的各种东西上传到你申请 ID时设置的 重定向 URL 即可,页面 URL 不在重定向内会发生错误。注:这个页面必须为https(以前仅localhost可为http)
    并且需要勾选隐式授权访问令牌ID 令牌讨论见#9 身份验证
  3. 设置API 权限
    添加 Microsoft Graph委托的权限Files.ReadFiles.Read.Selected
    需求的权限

原理

http://storage.live.com/items/ID是很早之前就流传的SkyDrive官方的真实直链重定向地址,出处不可考。
开始一般是用http://storage.live.com/items/ID?filename=xxx.jpg来外链图片,后面的文件名用来欺骗DiscuzX论坛系统,但是浏览器下载该文件还是没有正确文件名。
后来有高手发现的http://storage.live.com/items/ID:/xxx.jpg这个地址格式不会影响SkyDrive识别ID,还同时可以欺骗浏览器为普通文件地址,识别出文件的文件名与扩展名。
访问onedrive.live.com域名需要科学上网,但是storage.live.com不需要。

getonedrivedirectlink's People

Contributors

mapaler avatar sunlewuyou avatar

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.