forked from the1812/Bilibili-Evolved
-
Notifications
You must be signed in to change notification settings - Fork 0
/
number-search.js
1 lines (1 loc) · 2.77 KB
/
number-search.js
1
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["launch-bar/number-search"]=t():e["launch-bar/number-search"]=t()}(globalThis,(()=>(()=>{var e,t,r={123:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=123,e.exports=t},731:e=>{"use strict";e.exports="在输入纯数字时, 提供以下选项:\n- 跳转至相应的视频 (视为 av 号)\n- 跳转至相应的专栏 (视为 cv 号)\n"}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var i=Object.create(null);o.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var c=2&n&&r;"object"==typeof c&&!~e.indexOf(c);c=t(c))Object.getOwnPropertyNames(c).forEach((e=>a[e]=()=>r[e]));return a.default=()=>r,o.d(i,a),i},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";o.d(i,{plugin:()=>r});const e=coreApis.ajax,t=e=>{const{name:t,description:r,indexer:n,link:o}=e;return{name:t||n,icon:"mdi-open-in-new",indexer:n,description:r,action:()=>{window.open(o,"_blank")},order:0}},r={name:"launchBar.actions.numberSearch",displayName:"搜索栏 - 数字联想",async setup(r){let{addData:n}=r;n("launchBar.actions",(r=>{r.push({name:"numberSearchProvider",getActions:async r=>{const{match:n,id:o,indexer:i}=((e,t)=>{const r=e.match(t);if(!r)return{};const n=r[1],o=r[2];return{match:r,type:n,id:o,indexer:`${n}${o}`}})(r,/^()(\d+)$/);if(!n)return[];const[a,c]=await Promise.all([await(0,e.getJsonWithCredentials)(`https://api.bilibili.com/x/web-interface/view?aid=${o}`),await(0,e.getJson)(`https://api.bilibili.com/x/article/viewinfo?id=${o}`)]),{title:s}=lodash.get(a,"data",{}),{title:d}=lodash.get(c,"data",{});return[t({name:s,description:"视频跳转",link:`https://www.bilibili.com/av${o}`,indexer:i}),t({name:d,description:"专栏跳转",link:`https://www.bilibili.com/read/cv${o}`,indexer:i})]}})}))},commitHash:"cd5e421d84b8e446ac214166757f99b5ae8cdbfc",coreVersion:"2.7.3",description:(()=>{const e=o(123);return{...Object.fromEntries(e.keys().map((t=>[t.match(/index\.(.+)\.md$/)[1],e(t)]))),"zh-CN":()=>Promise.resolve().then(o.t.bind(o,731,17)).then((e=>e.default))}})()}})(),i=i.plugin})()));