You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
2.7 KiB
1 lines
2.7 KiB
(()=>{"use strict";var e,t={9612:(e,t,n)=>{function o(e,t){const n=e.lastIndexOf(".");let o=t;return-1!==n&&(o=e.substring(n+1)),o}function a(e,t=1e4){return new Promise((async(n,o)=>{e()&&n(!0);const a=Date.now();let s=!1;for(;!s&&Date.now()<a+t;)await new Promise((t=>{setTimeout((()=>{s=e(),t()}),1e3)}));n(s)}))}function s({onJson:e,onRequest:t,waitForBasename:n}){setTimeout((()=>{const o={};let s="",i=!1;const r=JSON.parse;JSON.parse=function(){const t=r.apply(this,arguments);let n=!1,a=!1;return e(t,(e=>{const t=window.location.pathname;void 0===o[t]&&(o[t]=[]),void 0===o[t].find((t=>t.label===e.label&&t.language===e.language))&&(o[t].push(e),n=!0)}),(e=>{s=e,a=!0})),i&&(n||a)&&document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"",basename:s,subtitles:o[window.location.pathname]}})),t},document.addEventListener("asbplayer-get-synced-data",(async()=>{t?.((e=>{const t=window.location.pathname;void 0===o[t]&&(o[t]=[]),void 0===o[t].find((t=>t.label===e.label&&t.language===e.language))&&o[t].push(e)}),(e=>{s=e,i||document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"",basename:s,subtitles:void 0}}))}));const e=()=>(!n||""!==s)&&window.location.pathname in o;e()||await a(e),document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"",basename:s,subtitles:o[window.location.pathname]??[]}})),function(){for(const e of Object.keys(o))e!==window.location.pathname&&delete o[e]}(),i=!0}),!1)}),0)}n.d(t,{$l:()=>a,NC:()=>s,YU:()=>o})}},n={};function o(e){var a=n[e];if(void 0!==a)return a.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,o),s.exports}o.d=(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.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(0,(e=o(9612)).NC)({onJson:(t,n,o)=>{let a;if(t?.bc?.text_tracks instanceof Array){for(const o of t.bc.text_tracks)if("subtitles"===o.kind&&"text/webvtt"===o.mime_type&&o.sources instanceof Array&&o.sources.length>0&&"string"==typeof o.sources[0].src&&"string"==typeof o.srclang){const t="string"==typeof o.label?`${o.srclang} - ${o?.label}`:o.srclang,a=o.sources[0].src.replace(/^http:\/\//,"https://");n({label:t,language:o.srclang.toLowerCase(),url:a,extension:(0,e.YU)(a,"vtt")})}"string"==typeof t.bc.name&&(a=t.bc.name,o(t.bc.name))}void 0===a&&"string"==typeof t?.bch?.episode_title&&(a=t.bch.episode_title,o(t.bch.episode_title))},onRequest:(t,n)=>{(0,e.$l)((()=>{const e=function(){const e=document.getElementById("bch-series-title"),t=document.getElementById("bch-story-title");if(e&&t&&e.textContent&&t.childNodes&&0!==t.childNodes.length)return`${e.textContent} ${t.childNodes[0].nodeValue}`}();return!!e&&(n(e),!0)}))||n(document.title)},waitForBasename:!0})})();
|