Bilibili-Evolved/registry/dist/plugins/video/download/mpv-output.js
2021-12-13 14:37:46 +00:00

1 line
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(o,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["video/download/mpv-output"]=e():o["video/download/mpv-output"]=e()}(self,(function(){return function(){"use strict";var o={d:function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(o,e){return Object.prototype.hasOwnProperty.call(o,e)}},e={};o.d(e,{plugin:function(){return n}});var t=coreApis.toast;const n={name:"downloadVideo.outputs.mpv",displayName:"下载视频 - MPV 输出支持",description:"by [@diannaojiang](https://github.com/diannaojiang)\n\n为下载视频增加 MPV 输出支持, 配置方式请参考 [Bilibili-Playin-Mpv](https://github.com/diannaojiang/Bilibili-Playin-Mpv)",setup:({addData:o})=>{o("downloadVideo.outputs",(o=>{o.push({name:"mpv",displayName:"MPV",description:"弹一条消息显示出播放按钮点击即可使用MPV进行播放",runAction:async o=>{const e=o.infos.flatMap((o=>o.titledFragments)),n=e.map((o=>o.url)).join("\n"),i=`mpv://--http-header-fields="referer:https://www.bilibili.com/" "${e[0].url}" --audio-file="${e[1].url}"`;console.log(i),t.Toast.show(`<a class="link" href="${encodeURI(i)}" >播放</a>`,"MPV播放"),console.log(n),console.log(o)}})}))},commitHash:"2acf9c591c1b55e3ef8e8e20becca001a39dc13f"};return e=e.plugin}()}));