Daniel's thoughts

百度网盘 18 腾讯微云 10 京东plus+腾讯视频 17 淘宝88会员+优酷+夸克+网易云音乐 9 咪咕视频 5 QQ音乐 9

 


 
> link1 link2

 


 
> link1 link2

两点: 1. gitalk配置中的proxy选项默认使用了cloudflare workers域名,建议自己使用 https://github.com/Zibri/cloudflare-cors-anywhere 搭建一个,并绑定自己的域名。
2. gitalk的css与JS建议都用JS引入,并合理书写JS的onload事件。

https://gist.github.com/lgh06/0449674b484cbabaac7d17735c8d9d42 https://jihulab.com/-/snippets/1263

 


 
> link1 link2

  • 方法一: 使用OneDrive网页版自带的嵌入,实测对图片文件管用,但是会压缩图片质量。
  • 方法二: 使用 https://github.com/Mapaler/GetOneDriveDirectLink , 获得storage.live.com开头的固定直链网址, 图片、视频、音频都好使。
  • 方法三: 给方法二获得的storage.live.com网址套一层cloudflare的CNAME,实测管用,可以规避未来storage.live.com被封的可能
  • 方法四: 用1drv.ms的分享链接,手动修改重定向后的地址中的redirdownload,便可获取临时地址,但是会跳转到onedrive.live.com,因此需要国外服务器/cloudflare workers等作中转。

附cf workers关键代码:

addEventListener("fetch", (event) => {
  event.respondWith(
    handleRequest(event.request).catch(
      (err) => new Response(err.stack, { status: 500 })
    )
  );
});


async function handleRequest(request) {
  const { origin } = new URL(request.url);

  var url1 = String(request.url).replace(origin + '/', 'https://1drv.ms/')

  let url2 = await fetch(url1, {redirect: "manual"}).then(function(response){

    let innerUrl2 = response.headers.get('location');
    return innerUrl2.replace('/redir?', '/download?');

  });
  let url3 = await fetch(url2, {redirect: "manual"}).then(function(response){

    let innerUrl3 = response.headers.get('location').replace('?download','?');

    return innerUrl3;

  });
return new Response(``, {
    status: 301,
    headers: {
      Location: url3,
      "Cache-Control":"max-age=60"
    },
  });

}

one image

https://1drv.ms/v/s!AqpFcPtySpJNqAbVx3KvIpyx0bfk?e=geLwcy

https://github.com/Mapaler/GetOneDriveDirectLink

https://github.com/aploium/OneDrive-Direct-Link
https://github.com/spencerwooo/onedrive-cf-index

https://github.com/reruin/sharelist https://github.com/txperl/JustList

 


 
> link1 link2

writefreely可以自定义CSS, 可是遗憾的是不能自定义JS。
通过查看writefreely的官方论坛,发现有一个hack方法。

在自定义的CSS内部,增加如下代码:


</style>

<script>
console.log('test')
</script>

<style type="text/css">

也可以用script src 引用远程的js文件。

这可玩性就非常高了。

简单分析原理:

自定义的CSS都会被放到head标签内的内部。

通过开头的 </style> 以及结尾的<style type="text/css"> 对浏览器进行欺骗,便可以插入JS了。

nice。

 


 
> link1 link2