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.
2 lines
21 KiB
2 lines
21 KiB
/*! For license information please see disney-plus-page.js.LICENSE.txt */
|
|
(()=>{var t={3452:(t,e,i)=>{var s;s="undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},t.exports=s}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var a=e[s]={exports:{}};return t[s](a,a.exports,i),a.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},e.off=function(t,e){if(!this.listeners[t])return!1;var i=this.listeners[t].indexOf(e);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(i,1),i>-1},e.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var i=e.length,s=0;s<i;++s)e[s].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=e.length,n=0;n<a;++n)e[n].apply(this,r)},e.dispose=function(){this.listeners={}},e.pipe=function(t){this.on("data",(function(e){t.push(e)}))},t}();function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},e.apply(this,arguments)}var s=i(3452),r=i.n(s);function a(t){for(var e,i=(e=t,r().atob?r().atob(e):Buffer.from(e,"base64").toString("binary")),s=new Uint8Array(i.length),a=0;a<i.length;a++)s[a]=i.charCodeAt(a);return s}class n extends t{constructor(){super(),this.buffer=""}push(t){let e;for(this.buffer+=t,e=this.buffer.indexOf("\n");e>-1;e=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)}}const o=String.fromCharCode(9),u=function(t){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),i={};return e[1]&&(i.length=parseInt(e[1],10)),e[2]&&(i.offset=parseInt(e[2],10)),i},g=function(t){const e={};if(!t)return e;const i=t.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let s,r=i.length;for(;r--;)""!==i[r]&&(s=/([^=]*)=(.*)/.exec(i[r]).slice(1),s[0]=s[0].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^['"](.*)['"]$/g,"$1"),e[s[0]]=s[1]);return e};class c extends t{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(t){let i,s;0!==(t=t.trim()).length&&("#"===t[0]?this.tagMappers.reduce(((e,i)=>{const s=i(t);return s===t?e:e.concat([s])}),[t]).forEach((t=>{for(let e=0;e<this.customParsers.length;e++)if(this.customParsers[e].call(this,t))return;if(0===t.indexOf("#EXT"))if(t=t.replace("\r",""),i=/^#EXTM3U/.exec(t),i)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(i=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(t),i)return s={type:"tag",tagType:"inf"},i[1]&&(s.duration=parseFloat(i[1])),i[2]&&(s.title=i[2]),void this.trigger("data",s);if(i=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(t),i)return s={type:"tag",tagType:"targetduration"},i[1]&&(s.duration=parseInt(i[1],10)),void this.trigger("data",s);if(i=/^#EXT-X-VERSION:([0-9.]*)?/.exec(t),i)return s={type:"tag",tagType:"version"},i[1]&&(s.version=parseInt(i[1],10)),void this.trigger("data",s);if(i=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(t),i)return s={type:"tag",tagType:"media-sequence"},i[1]&&(s.number=parseInt(i[1],10)),void this.trigger("data",s);if(i=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(t),i)return s={type:"tag",tagType:"discontinuity-sequence"},i[1]&&(s.number=parseInt(i[1],10)),void this.trigger("data",s);if(i=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(t),i)return s={type:"tag",tagType:"playlist-type"},i[1]&&(s.playlistType=i[1]),void this.trigger("data",s);if(i=/^#EXT-X-BYTERANGE:(.*)?$/.exec(t),i)return s=e(u(i[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",s);if(i=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(t),i)return s={type:"tag",tagType:"allow-cache"},i[1]&&(s.allowed=!/NO/.test(i[1])),void this.trigger("data",s);if(i=/^#EXT-X-MAP:(.*)$/.exec(t),i){if(s={type:"tag",tagType:"map"},i[1]){const t=g(i[1]);t.URI&&(s.uri=t.URI),t.BYTERANGE&&(s.byterange=u(t.BYTERANGE))}this.trigger("data",s)}else if(i=/^#EXT-X-STREAM-INF:(.*)$/.exec(t),i){if(s={type:"tag",tagType:"stream-inf"},i[1]){if(s.attributes=g(i[1]),s.attributes.RESOLUTION){const t=s.attributes.RESOLUTION.split("x"),e={};t[0]&&(e.width=parseInt(t[0],10)),t[1]&&(e.height=parseInt(t[1],10)),s.attributes.RESOLUTION=e}s.attributes.BANDWIDTH&&(s.attributes.BANDWIDTH=parseInt(s.attributes.BANDWIDTH,10)),s.attributes["FRAME-RATE"]&&(s.attributes["FRAME-RATE"]=parseFloat(s.attributes["FRAME-RATE"])),s.attributes["PROGRAM-ID"]&&(s.attributes["PROGRAM-ID"]=parseInt(s.attributes["PROGRAM-ID"],10))}this.trigger("data",s)}else{if(i=/^#EXT-X-MEDIA:(.*)$/.exec(t),i)return s={type:"tag",tagType:"media"},i[1]&&(s.attributes=g(i[1])),void this.trigger("data",s);if(i=/^#EXT-X-ENDLIST/.exec(t),i)this.trigger("data",{type:"tag",tagType:"endlist"});else if(i=/^#EXT-X-DISCONTINUITY/.exec(t),i)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(i=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(t),i)return s={type:"tag",tagType:"program-date-time"},i[1]&&(s.dateTimeString=i[1],s.dateTimeObject=new Date(i[1])),void this.trigger("data",s);if(i=/^#EXT-X-KEY:(.*)$/.exec(t),i)return s={type:"tag",tagType:"key"},i[1]&&(s.attributes=g(i[1]),s.attributes.IV&&("0x"===s.attributes.IV.substring(0,2).toLowerCase()&&(s.attributes.IV=s.attributes.IV.substring(2)),s.attributes.IV=s.attributes.IV.match(/.{8}/g),s.attributes.IV[0]=parseInt(s.attributes.IV[0],16),s.attributes.IV[1]=parseInt(s.attributes.IV[1],16),s.attributes.IV[2]=parseInt(s.attributes.IV[2],16),s.attributes.IV[3]=parseInt(s.attributes.IV[3],16),s.attributes.IV=new Uint32Array(s.attributes.IV))),void this.trigger("data",s);if(i=/^#EXT-X-START:(.*)$/.exec(t),i)return s={type:"tag",tagType:"start"},i[1]&&(s.attributes=g(i[1]),s.attributes["TIME-OFFSET"]=parseFloat(s.attributes["TIME-OFFSET"]),s.attributes.PRECISE=/YES/.test(s.attributes.PRECISE)),void this.trigger("data",s);if(i=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(t),i)return s={type:"tag",tagType:"cue-out-cont"},i[1]?s.data=i[1]:s.data="",void this.trigger("data",s);if(i=/^#EXT-X-CUE-OUT:(.*)?$/.exec(t),i)return s={type:"tag",tagType:"cue-out"},i[1]?s.data=i[1]:s.data="",void this.trigger("data",s);if(i=/^#EXT-X-CUE-IN:(.*)?$/.exec(t),i)return s={type:"tag",tagType:"cue-in"},i[1]?s.data=i[1]:s.data="",void this.trigger("data",s);if(i=/^#EXT-X-SKIP:(.*)$/.exec(t),i&&i[1])return s={type:"tag",tagType:"skip"},s.attributes=g(i[1]),s.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(s.attributes["SKIPPED-SEGMENTS"]=parseInt(s.attributes["SKIPPED-SEGMENTS"],10)),s.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(s.attributes["RECENTLY-REMOVED-DATERANGES"]=s.attributes["RECENTLY-REMOVED-DATERANGES"].split(o)),void this.trigger("data",s);if(i=/^#EXT-X-PART:(.*)$/.exec(t),i&&i[1])return s={type:"tag",tagType:"part"},s.attributes=g(i[1]),["DURATION"].forEach((function(t){s.attributes.hasOwnProperty(t)&&(s.attributes[t]=parseFloat(s.attributes[t]))})),["INDEPENDENT","GAP"].forEach((function(t){s.attributes.hasOwnProperty(t)&&(s.attributes[t]=/YES/.test(s.attributes[t]))})),s.attributes.hasOwnProperty("BYTERANGE")&&(s.attributes.byterange=u(s.attributes.BYTERANGE)),void this.trigger("data",s);if(i=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(t),i&&i[1])return s={type:"tag",tagType:"server-control"},s.attributes=g(i[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(t){s.attributes.hasOwnProperty(t)&&(s.attributes[t]=parseFloat(s.attributes[t]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(t){s.attributes.hasOwnProperty(t)&&(s.attributes[t]=/YES/.test(s.attributes[t]))})),void this.trigger("data",s);if(i=/^#EXT-X-PART-INF:(.*)$/.exec(t),i&&i[1])return s={type:"tag",tagType:"part-inf"},s.attributes=g(i[1]),["PART-TARGET"].forEach((function(t){s.attributes.hasOwnProperty(t)&&(s.attributes[t]=parseFloat(s.attributes[t]))})),void this.trigger("data",s);if(i=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(t),i&&i[1])return s={type:"tag",tagType:"preload-hint"},s.attributes=g(i[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(t){if(s.attributes.hasOwnProperty(t)){s.attributes[t]=parseInt(s.attributes[t],10);const e="BYTERANGE-LENGTH"===t?"length":"offset";s.attributes.byterange=s.attributes.byterange||{},s.attributes.byterange[e]=s.attributes[t],delete s.attributes[t]}})),void this.trigger("data",s);if(i=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(t),i&&i[1])return s={type:"tag",tagType:"rendition-report"},s.attributes=g(i[1]),["LAST-MSN","LAST-PART"].forEach((function(t){s.attributes.hasOwnProperty(t)&&(s.attributes[t]=parseInt(s.attributes[t],10))})),void this.trigger("data",s);this.trigger("data",{type:"tag",data:t.slice(4)})}}}else this.trigger("data",{type:"comment",text:t.slice(1)})})):this.trigger("data",{type:"uri",uri:t}))}addParser({expression:t,customType:e,dataParser:i,segment:s}){"function"!=typeof i&&(i=t=>t),this.customParsers.push((r=>{if(t.exec(r))return this.trigger("data",{type:"custom",data:i(r),customType:e,segment:s}),!0}))}addTagMapper({expression:t,map:e}){this.tagMappers.push((i=>t.test(i)?e(i):i))}}const p=function(t){const e={};return Object.keys(t).forEach((function(i){var s;e[(s=i,s.toLowerCase().replace(/-(\w)/g,(t=>t[1].toUpperCase())))]=t[i]})),e},d=function(t){const{serverControl:e,targetDuration:i,partTargetDuration:s}=t;if(!e)return;const r="#EXT-X-SERVER-CONTROL",a="holdBack",n="partHoldBack",o=i&&3*i,u=s&&2*s;i&&!e.hasOwnProperty(a)&&(e[a]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[a]<o&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[a]}) to targetDuration * 3 (${o})`}),e[a]=o),s&&!e.hasOwnProperty(n)&&(e[n]=3*s,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[n]}).`})),s&&e[n]<u&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[n]}) to partTargetDuration * 2 (${u}).`}),e[n]=u)};class h extends t{constructor(){super(),this.lineStream=new n,this.parseStream=new c,this.lineStream.pipe(this.parseStream);const t=this,i=[];let s,r,o={},u=!1;const g=function(){},h={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let f=0;this.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};let l=0,b=0;this.on("end",(()=>{o.uri||!o.parts&&!o.preloadHints||(!o.map&&s&&(o.map=s),!o.key&&r&&(o.key=r),o.timeline||"number"!=typeof f||(o.timeline=f),this.manifest.preloadSegment=o)})),this.parseStream.on("data",(function(n){let c,m;({tag(){({version(){n.version&&(this.manifest.version=n.version)},"allow-cache"(){this.manifest.allowCache=n.allowed,"allowed"in n||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const t={};"length"in n&&(o.byterange=t,t.length=n.length,"offset"in n||(n.offset=l)),"offset"in n&&(o.byterange=t,t.offset=n.offset),l=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),n.duration>0&&(o.duration=n.duration),0===n.duration&&(o.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(n.attributes)if("NONE"!==n.attributes.METHOD)if(n.attributes.URI){if("com.apple.streamingkeydelivery"===n.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:n.attributes});if("com.microsoft.playready"===n.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:n.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===n.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(n.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===n.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==n.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):n.attributes.KEYID&&"0x"===n.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:n.attributes.KEYFORMAT,keyId:n.attributes.KEYID.substring(2)},pssh:a(n.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));n.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),r={method:n.attributes.METHOD||"AES-128",uri:n.attributes.URI},void 0!==n.attributes.IV&&(r.iv=n.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else r=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(n.number)?this.manifest.mediaSequence=n.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+n.number})},"discontinuity-sequence"(){isFinite(n.number)?(this.manifest.discontinuitySequence=n.number,f=n.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+n.number})},"playlist-type"(){/VOD|EVENT/.test(n.playlistType)?this.manifest.playlistType=n.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+n.playlist})},map(){s={},n.uri&&(s.uri=n.uri),n.byterange&&(s.byterange=n.byterange),r&&(s.key=r)},"stream-inf"(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||h,n.attributes?(o.attributes||(o.attributes={}),e(o.attributes,n.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||h,!(n.attributes&&n.attributes.TYPE&&n.attributes["GROUP-ID"]&&n.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const t=this.manifest.mediaGroups[n.attributes.TYPE];t[n.attributes["GROUP-ID"]]=t[n.attributes["GROUP-ID"]]||{},c=t[n.attributes["GROUP-ID"]],m={default:/yes/i.test(n.attributes.DEFAULT)},m.default?m.autoselect=!0:m.autoselect=/yes/i.test(n.attributes.AUTOSELECT),n.attributes.LANGUAGE&&(m.language=n.attributes.LANGUAGE),n.attributes.URI&&(m.uri=n.attributes.URI),n.attributes["INSTREAM-ID"]&&(m.instreamId=n.attributes["INSTREAM-ID"]),n.attributes.CHARACTERISTICS&&(m.characteristics=n.attributes.CHARACTERISTICS),n.attributes.FORCED&&(m.forced=/yes/i.test(n.attributes.FORCED)),c[n.attributes.NAME]=m},discontinuity(){f+=1,o.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=n.dateTimeString,this.manifest.dateTimeObject=n.dateTimeObject),o.dateTimeString=n.dateTimeString,o.dateTimeObject=n.dateTimeObject},targetduration(){!isFinite(n.duration)||n.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+n.duration}):(this.manifest.targetDuration=n.duration,d.call(this,this.manifest))},start(){n.attributes&&!isNaN(n.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:n.attributes["TIME-OFFSET"],precise:n.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){o.cueOut=n.data},"cue-out-cont"(){o.cueOutCont=n.data},"cue-in"(){o.cueIn=n.data},skip(){this.manifest.skip=p(n.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",n.attributes,["SKIPPED-SEGMENTS"])},part(){u=!0;const t=this.manifest.segments.length,e=p(n.attributes);o.parts=o.parts||[],o.parts.push(e),e.byterange&&(e.byterange.hasOwnProperty("offset")||(e.byterange.offset=b),b=e.byterange.offset+e.byterange.length);const i=o.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${t}`,n.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((t,e)=>{t.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${e} lacks required attribute(s): LAST-PART`})}))},"server-control"(){const t=this.manifest.serverControl=p(n.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),d.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const t=this.manifest.segments.length,e=p(n.attributes),i=e.type&&"PART"===e.type;o.preloadHints=o.preloadHints||[],o.preloadHints.push(e),e.byterange&&(e.byterange.hasOwnProperty("offset")||(e.byterange.offset=i?b:0,i&&(b=e.byterange.offset+e.byterange.length)));const s=o.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #${t}`,n.attributes,["TYPE","URI"]),e.type)for(let i=0;i<o.preloadHints.length-1;i++){const r=o.preloadHints[i];r.type&&r.type===e.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${s} for segment #${t} has the same TYPE ${e.type} as preload hint #${i}`})}},"rendition-report"(){const t=p(n.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);const e=this.manifest.renditionReports.length-1,i=["LAST-MSN","URI"];u&&i.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${e}`,n.attributes,i)},"part-inf"(){this.manifest.partInf=p(n.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",n.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),d.call(this,this.manifest)}}[n.tagType]||g).call(t)},uri(){o.uri=n.uri,i.push(o),this.manifest.targetDuration&&!("duration"in o)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),o.duration=this.manifest.targetDuration),r&&(o.key=r),o.timeline=f,s&&(o.map=s),b=0,o={}},comment(){},custom(){n.segment?(o.custom=o.custom||{},o.custom[n.customType]=n.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[n.customType]=n.data)}})[n.type].call(t)}))}warnOnMissingAttributes_(t,e,i){const s=[];i.forEach((function(t){e.hasOwnProperty(t)||s.push(t)})),s.length&&this.trigger("warn",{message:`${t} lacks required attribute(s): ${s.join(", ")}`})}push(t){this.lineStream.push(t)}end(){this.lineStream.push("\n"),this.trigger("end")}addParser(t){this.parseStream.addParser(t)}addTagMapper(t){this.parseStream.addTagMapper(t)}}setTimeout((()=>{async function t(e){const i=function(){const t=document.getElementsByClassName("title-field"),e=document.getElementsByClassName("subtitle-field");let i=null,s=null;return t.length>0&&(i=t[0].textContent),e.length>0&&(s=e[0].textContent),null===i?"":null===s?i:`${i} ${s}`}();return 0===e?i:""===i?new Promise(((i,s)=>{setTimeout((async()=>i(await t(e-1))),1e3)})):i}function e(t){return t.substring(0,t.lastIndexOf("/"))}let i;const s=JSON.parse;JSON.parse=function(){const t=s.apply(this,arguments);if(t?.stream?.sources instanceof Array&&t.stream.sources.length>0){const s=t.stream.sources[0].complete?.url;s&&(i=function(t){return new Promise(((i,s)=>{setTimeout((async()=>{try{const r=await function(t){return new Promise(((e,i)=>{setTimeout((()=>{fetch(t).then((t=>t.text())).then((t=>{const i=new h;i.push(t),i.end(),e(i.manifest)})).catch(i)}),0)}))}(t);if(r.playlists instanceof Array&&r.playlists.length>0){const s=r.mediaGroups?.SUBTITLES;if(s&&s["sub-main"]){const r=s["sub-main"],a=[];for(const i of Object.keys(r)){const s=r[i];if(s&&"string"==typeof s.language&&"string"==typeof s.uri){const r=`${e(t)}/${s.uri}`;a.push({label:i,language:s.language,url:r,m3U8BaseUrl:e(r),extension:"m3u8"})}}return void i(a)}}s(new Error("Subtitles not found."))}catch(t){s(t)}}),0)}))}(s))}return t},document.addEventListener("asbplayer-get-synced-data",(async()=>{if(i)try{const e=await i;i=void 0,e.sort(((t,e)=>t.label<e.label?-1:t.label>e.label?1:0)),document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"",basename:await t(10)??"",extension:"m3u8",subtitles:e}}))}catch(t){document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:t instanceof Error?t.message:String(t),basename:"",extension:"m3u8",subtitles:[]}}))}else document.dispatchEvent(new CustomEvent("asbplayer-synced-data",{detail:{error:"Could not extract subtitle track information.",basename:"",subtitles:[]}}))}),!1)}),0)})()})();
|