Bilibili-Evolved/registry/dist/plugins/video/download/motrix-output.js
2023-07-13 09:03:47 +08:00

1 line
1.1 KiB
JavaScript

!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports["video/download/motrix-output"]=o():e["video/download/motrix-output"]=o()}(globalThis,(()=>(()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)},o={};e.d(o,{plugin:()=>r});const t=coreApis.toast,r={name:"downloadVideo.outputs.motrix",displayName:"下载视频 - Motrix 输出支持",description:"为下载视频增加 Motrix 输出支持.",setup:e=>{let{addData:o}=e;o("downloadVideo.outputs",(e=>{e.push({name:"motrix",displayName:"Motrix",description:"调用 Motrix 下载.",runAction:async e=>{const o=e.infos.flatMap((e=>e.titledFragments));try{const e=new URLSearchParams({uris:o.map((e=>e.url)).join("\n"),referer:document.URL.replace(window.location.search,"")});window.open(`motrix://new-task?${e.toString()}`,"_self")}catch(e){t.Toast.error(String(e),"发生错误")}}})}))},commitHash:"276518e31e164e958ee32f4194e44172e4aeaae7",coreVersion:"2.8.1"};return o=o.plugin})()));