* icecast-metadata-stats free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* icecast-metadata-stats distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>
*/
varIcecastMetadataStats;(()=>{vart={344:t=>{consts=()=>{};t.exports=class{constructor({icyBr:t,onMetadataUpdate:e=s,onMetadataEnqueue:i=s}){this.t=t,this.i=e,this.h=i,this.l=!0,this.u=[]}getmetadataQueue(){returnthis.u.map((({m:t,...s})=>s))}addMetadata({metadata:t,stats:s},e,i=0){this.g(t,e,i+this.getTimeByBytes(s.currentStreamPosition))}getTimeByBytes(t){returnthis.t?t/(125*this.t):0}purgeMetadataQueue(){this.u.forEach((t=>clearTimeout(t.m))),this.u=[]}g(t,s,e){consti={metadata:t,timestampOffset:s,timestamp:e};this.u.push(i),this.h(t,s,e),this.l?(this.p(),this.l=!1):i.m=setTimeout((()=>{this.p()}),1e3*(s-e))}p(){const{metadata:t,timestampOffset:s,timestamp:e}=this.u.shift();this.i(t,s,e)}}},780:(t,s,e)=>{consti=e(660),a=e(690),r=e(491),n=e(555);t.exports=class{constructor({metadataTypes:t=["icy"],...s}={}){conste=t.includes("icy"),h=t.includes("ogg");this.S=e&&h?newn(s):h?newr(s):e?newa(s):newi(s)}staticparseIcyMetadata(t){returna.parseIcyMetadata(t)}geticyMetaInt(){returnthis.S.icyMetaInt}*iterator(t){yield*this.S.iterator(t)}readAll(t){this.S.readAll(t)}async*asyncIterator(t){returnyield*this.S.asyncIterator(t)}asyncasyncReadAll(t){returnthis.S.asyncReadAll(t)}}},555:(t,s,e)=>{consti=e(690),a=e(491);t.exports=class{constructor(t){const{onStream:s,...e}=t;this.I=newa(t),this.M=newi(e)}geticyMetaInt(){returnthis.M.icyMetaInt}*iterator(t){for(constsofthis.M.iterator(t))s.stream?yield*this.I.iterator(s.stream):yields}readAll(t){for(constsofthis.M.iterator(t))s.stream&&this.I.readAll(s.stream)}async*asyncIterator(t){forawait(constsofthis.M.asyncIterator(t))if(s.stream)forawait(consttofthis.I.asyncIterator(s.stream))yieldt;elseyields}asyncasyncReadAll(t){forawait(constsofthis.M.iterator(t))s.stream&&awaitthis.I.asyncReadAll(s.stream)}}},690:(t,s,e)=>{consti=e(660);classaextendsi{constructor({icyMetaInt:t,icyDetectionTimeout:s=2e3,...e}){super(e),this._=t,this.A=s,this.v=this.T(),this.v.next()}*T(){if(yield*this.B())for(;;)this.R=this._,yield*this.C(),yield*this.$(),this.R&&(yield*this.D());this.R=1/0,yield*this.C()}staticparseIcyMetadata(t){consts=/(?<key>[^\0]+?)='(?<val>[^\0]*?)(;$|';|'$|$)/,e={};for(constioft.match(newRegExp(s,"g"))||[]){constt=i.match(s);t&&(e[t.groups.key]=t.groups.val)}returne}geticyMetaInt(){returnthis._}*B(){if(this._>0)return!0;if(!this.A)return!1;this.O("Passed in Icy-MetaInt is invalid. Attempting to detect ICY Metadata.","See https://github.com/eshaz/icecast-metadata-js for information on how to properly request ICY Metadata.");constt=[null,83,116,114,101,97,109,84,105,116,108,101,61],s=Date.now();lete=0;for(;s+this.A>Date.now();){this.L=i.P(this.L,yield*this.N());t:for(;e<this.L.length-t.length;){for(lets=1;s<t.length;s++)if(this.L[s+e]!==t[s]){e++;continuet}returnthis.O(`Found ICY Metadata! Setting Icy-MetaInt to ${e}.`),this._=e,!0}}returnthis.O("ICY Metadata not detected, but continuing anyway. Audio errors will occur if there is ICY metadata.",`Searched ${this.L.length} bytes for ${(Date.now()-s)/1e3} seconds.`,"Try increasing the `icyDetectionTimeout` value if ICY metadata is present in the stream."),this.G("icy"),!1}*C(){for(this.j.currentStreamBytesRemaining=this.R;this.R;)yield*this.U(yield*super.Y())}*$(){this.R=1;do{this.R=16*(yield*this.Y())[0]}while(1===this.R);this.j.addMetadataLengthBytes(1)}*D(){this.j.currentMetadataBytesRemaining=this.R;constt=yield*this.Y(this.R);this.j.addMetadataBytes(t.length),yield*this.k(a.parseIcyMetadata(this.V.decode(t)))}}t.exports=a},660:(t,s,e)=>{consti=e(103).TextDecoder||TextDecoder,a=e(8),r=()=>{};classn{constructor(t){this.R=0,this.q=0,this.L=newUint8Array(0),this.j=newa,this.V=newi("utf-8"),this.F=t.onStream||r,this.H=t.onMetadata||r,this.G=t.onMetadataFailed||r,this.J=t.onError||r,this.W=t.enableLogging||!1,this.K=Promise.resolve(),this.X=Promise.resolve(),this.v=this.Z(),this.v.next()}*Z(){for(this.R=1/0;;)yield*this.U(yield*this.Y())}staticP(t,s){conste=newUint8Array(t.length+s.length);returne.set(t),e.set(s,t.length),e}*iterator(t){for(lets=this.v.next(t);s.value;s=this.v.next())yields.value}readAll(t){for(lets=this.v.next(t);s.value;s=this.v.next());}async*asyncIterator(t){for(lets=this.v.next(t);s.value;s=this.v.next())awaitthis.K,awaitthis.X,yields.value}asyncasyncReadAll(t){for(lets=this.v.next(t);s.value;s=this.v.next())awaitthis.K,awaitthis.X}O(...t){this.W&&console.warn("icecast-metadata-js",t.reduce(((t,s)=>t+"\n"+s),"")),this.J(...t)}*U(t){this.j.addStreamBytes(t.length);consts={stream:t,stats:this.j.stats};this.K=this.F(s),yields}*k(t){consts={metadata:t,stats:this.j.stats};this.X=this.H(s),yields}*Y(t=0){for(this.q===this.L.length&&(this.L=yield*this.N(),this.q=0);this.L.length-this.q<t;)this.L=n.P(this.L,yield*this.N());consts=this.L.subarray(this.q,(t||this.R)+this.q);returnthis.j.addBytes(s.length),this.R=s.length<this.R?this.R-s.length:0,this.q+=s.length,s}*N(){lett;do{t=yield}while(!t||0===t.length);returnthis.j.addCurrentBytesRemaining(t.length),t}}t.exports=n},491:(t,s,e)=>{consti=e(660);t.exports=classextendsi{constructor(t){super(t),this.v=this.tt(),this.v.next()}*tt(){if(yield*this.st()){constt=yield*this.et();if(t)for(;yield*this.st();)yield*this.D(t),yield*this.C()}this.R=1/0,yield*this.C()}it(t,s=0){returnnewDataView(Uint8Array.from([...t.subarray(s,s+4)]).buffer).getUint32(0,!0)}at(t,s){returnString.fromCharCode(...s).match(t)}*st(){lett=[];for(;t.length<=65307;){consts=yield*super.Y(5);if(79===s[0]&&103===s[1]&&103===s[2]&&83===s[3]&&!(248&s[5])){this.q-=5,this.R+=5,this.j.rt-=5,this.j.nt+=5;break}t.push(s[0]),this.q-=4,this.j.rt-=4,this.j.nt+=4}if(t.length&&(yield*this.U(Uint8Array.from(t))),t.length>65307)returnthis.O("This stream is not an OGG stream. No OGG metadata will be returned.","See https://github.com/eshaz/icecast-metadata-js for information on OGG metadata."),this.G("ogg"),!1;consts=yield*this.Y(27),e=yield*this.Y(s[26]);returnthis.R=e.reduce(((t,s)=>t+s),0),!0}*et(){constt=yield*this.Y(8);returnyield*this.C(),this.at(/\x7fFLAC/,t.subarray(0,5))?{regex:/^[\x84|\x04]/,length:4}:this.at(/OpusHead/,t.subarray(0,8))?{regex:/OpusTags/,length:8}:this.at(/\x01vorbis/,t.subarray(0,7))?{regex:/\x03vorbis/,length:7}:void0}*D({regex:t,length:s}){this.at(t,yield*this.Y(s))&&(yield*this.k(yield*this.ht()))}*C(){for(;this.R;)yield*this.Y()}*Y(t){consts=yield*super.Y(t);returnyield*this.U(s),s}*N(){constt=yield*super.N();returnthis.j.currentStreamBytesRemaining=t.length,t}*ht(){constt=this.it(yield*this.Y(4));this.j.addMetadataBytes(4);consts=this.V.decode(yield*this.Y(t));this.j.addMetadataBytes(t);conste=this.it(yield*this.Y(4));this.j.addMetadataBytes(4);consti=[];for(lett=0;t<e;t++){constt=yield*this.Y(4);this.j.addMetadataBytes(4),i.push(yield*this.Y(this.it(t))),this.j.addMetadataBytes(i[i.length-1].length)}returnthis.j.currentMetadataBytesRemaining=0,i.reduce(((t,s)=>{conste=s.indexOf(61),i=String.fromCharCode(...s.subarray(0,e)).toUpperCase(),a=this.V.decode(s.subarray(e+1));returnt[i]=t[i]?`${t[i]}; ${a}`:a,t}),{VENDOR_STRING:s})}}},8:t=>{t.exports=class{constructor(){this.rt=0,this.ot=0,this.ct=0,this.lt=0,this.nt=0,this.dt=0,this.yt=0}getstats(){return{totalBytesRead:this.rt,streamBytesRead:this.ot,metadataLengthBytesRead:this.ct,metadataBytesRead:this.lt,currentBytesRemaining:this.nt,currentStreamBytesRemaining:this.dt,currentMetadataBytesRemaining:this.yt}}setcurrentStreamBytesRemaining(t){this.dt+=t}setcurrentMetadataBytesRemaining(t){this.yt=t}addBytes(t){this.rt+=t,this.nt-=t}addStreamBytes(t){this.ot+=t,this.dt-=t}addMetadataLengthBytes(t){this.ct+=t}addMetadataBytes(t){this.lt+=t,this.yt-=t}addCurrentBytesRemaining(t){this.nt+=t}}},103:()=>{}},s={};functione(i){vara=s[i];if(void0!==a)returna.exports;varr=s[i]={exports:{}};returnt[i](r,r.exports,e),r.exports}e.n=t=>{vars=t&&t.ut?()=>t.default:()=>t;returne.d(s,{a:s}),s},e.d=(t,s)=>{for(variins)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},e.o=(t,s)=>Object.prototype.hasOwnProperty.call(t,s);vari={};(()=>{"use strict";e.d(i,{default:()=>N});e(344);vart=e(780),s=e.n(t);consta=()=>{};classr{constructor(t,{icyMetaInt:e,onStream:i=a,...n}){leth;this.gt=newReadableStream({asyncstart(a){h=new(s())({...n,icyMetaInt:parseInt(t.headers.get("Icy-MetaInt"))||e,onStream:asynct=>(a.enqueue(t.stream),i(t))});forawait(constsofr.asyncIterator(t.body))awaith.asyncReadAll(s);a.close()}}),this.ft=h}geticyMetaInt(){returnthis.ft.icyMetaInt}getreadableStream(){returnthis.gt}asyncstartReading(){try{forawait(consttofr.asyncIterator(this.gt));}catch(t){if("AbortError"!==t.name)throwt}}staticasyncIterator(t){consts=t.getReader();return{[Symbol.asyncIterator]:()=>({next:()=>s.read()})}}}constn=()=>{},h="stopped",o="fetching",c=newWeakMap,l=Symbol(),d=Symbol(),y=Symbol(),u=Symbol(),m=Symbol(),g=Symbol(),p=Symbol(),f=Symbol(),b=Symbol(),S=Symbol(),w=Symbol(),I=Symbol(),M=Symbol(),x=Symbol(),_=Symbol(),A=Symbol(),v=Symbol(),T=Symbol(),B=Symbol(),R=Symbol(),C=Symbol(),$=Symbol(),D=Symbol(),E=Symbol(),O=Symbol(),L=Symbol(),P=Symbol();classN{constructor(t,s={}){conste=t.split("/").slice(0,-1).join("/");c.set(this,{[v]:t,[m]:s.icestatsEndpoint||`${e}/status-json.xsl`,[f]:s.statsEndpoint||`${e}/stats`,[w]:s.nextsongsEndpoint||`${e}/nextsongs`,[x]:s.sevenhtmlEndpoint||`${e}/7.html`,[R]:s.sources||[],[C]:1e3*(s.interval||30),[$]:s.onStats||n,[D]:s.onStatsFetch||n,[T]:s.icyMetaInt,[B]:s.icyDetectionTimeout,[l]:newAbortController,[y]:newAbortController,[g]:newAbortController,[b]:newAbortController,[I]:newAbortController,[_]:newAbortController,[E]:h})}staticxml2Json(t){consts=t=>{if(!t.children.length)returnNumber.isNaN(Number(t.innerHTML))?t.innerHTML:Number(t.innerHTML);conste={};for(constioft.children)i.nodeNameine?Array.isArray(e[i.nodeName])?e[i.nodeName].push(s(i)):e[i.nodeName]=[e[i.nodeName],s(i)]:e[i.nodeName]=s(i);returne};returns((t=>(newDOMParser).parseFromString(t,"application/xml"))(t))}getstate(){returnc.get(this)[E]}geticestatsEndpoint(){returnc.get(this)[m]}getstatsEndpoint(){returnc.get(this)[f]}getnextsongsEndpoint(){returnc.get(this)[w]}getsevenhtmlEndpoint(){returnc.get(this)[x]}start(){c.get(this)[E]===h&&(c.get(this)[E]="running",this.fetch().then(c.get(this)[$]),c.get(this)[O]=setInterval((()=>{this.fetch().then(c.get(this)[$])}),c.get(this)[C]))}stop(){c.get(this)[E]!==h&&(c.get(this)[E]=h,clearInterval(c.get(this)[O]),c.get(this)[l].abort(),c.get(this)[y].abort(),c.get(this)[g].abort(),c.get(this)[b].abort(),c.get(this)[_].abort())}asyncfetch(){if(c.get(this)[E]!==o){constt=c.get(this)[E];c.get(this)[E]=o,c.get(this)[D](c.get(this)[R]);consts=[];c.get(this)[R].includes("icestats")&&s.push(this.getIcestats()),c.get(this)[R].includes("sevenhtml")&&s.push(this.getSevenhtml()),c.get(this)[R].includes("stats")&&s.push(this.getStats()),c.get(this)[R].includes("nextsongs")&&s.push(this.getNextsongs()),c.get(this)[R].includes("icy")&&s.push(this.getIcyMetadata()),c.get(this)[R].includes("ogg")&&s.push(this.getOggMetadata());conste=awaitPromise.all(s).then((t=>t.reduce(((t,s)=>({...t,...s})),{})));returnc.get(this)[E]=c.get(this)[E]!==o?c.get(this)[E]:t,e}}asyncgetIcestats(){returnthis[L]({status:p,endpoint:m,controller:g,mapper:t=>t.json()}).then((t=>({icestats:t&&t.icestats})))}asyncgetSevenhtml(){returnthis[L]({status:A,endpoint:x,controller:_,mapper:asynct=>(awaitt.text()).match(/(.*?)<\/body>/gi).map((t=>{consts=t.match(/(<body>|,)(?<stats>.*)<\/body>/i).groups.stats.split(",");return7===s.length?{StreamTitle:s[6],currentListeners:parseInt(s[4]),peakListeners:parseInt(s[2]),maxListeners:parseInt(s[3]),bitrate:parseInt(s[5]),status:parseInt(s[1]),serverListeners:parseInt(s[0])}:{StreamTitle:s[4],currentListeners:parseInt(s[2]),peakListeners:parseInt(s[0]),maxListeners:parseInt(s[1]),bitrate:parseInt(s[3])}}))}).then((t=>({sevenhtml:t})))}asyncgetStats(){returnthis[L]({status:S,endpoint:f,controller:b,mapper:asynct=>N.xml2Json(awaitt.text()).SHOUTCASTSERVER.STREAMSTATS}).then((t=>({stats:t})))}asyncgetNextsongs(){returnthis[L]({status:M,endpoint:w,controller:I,mapper:asynct=>N.xml2Json(awaitt.text()).SHOUTCASTSERVER.NEXTSONGS}).then((t=>({nextsongs:t})))}asyncgetIcyMetadata(){returnthis[P]({status:d,endpoint:v,controller:l,metadataType:"icy",headers:{"Icy-MetaData":1}})}asyncgetOggMetadata(){returnthis[P]({status:u,endpoint:v,controller:y,metadataType:"ogg"})}async[P]({status:t,endpoint:s,controller:e,headers:i,metadataType:a}){returnthis[L]({status:t,endpoint:s,controller:e,headers:i,mapper:asynct=>newPromise((s=>{newr(t,{onMetadata:({metadata:t})=>{c.get(this)[e].abort(),s(t)},onMetadataFailed:()=>{c.get(this)[e].abort(),s()},metadataTypes:a,icyMetaInt:c.get(this)[T],icyDetectionTimeout:c.get(this)[B]}).startReading()}))}).then((t=>({[a]:t})))}async[L]({status:t,endpoint:s,controller:e,mapper:i,headers:a={}}){if(!c.get(this)[t])returnc.get(this)[t]=!0,fetch(c.get(this)[s],{method:"GET",headers:a,signal:c.get(this)[e].signal}).then((t=>{if(!t.ok)thrownewError(`HTTP Error ${t.status}`);returnt})).then(i).catch((t=>{"AbortError"!==t.name&&console.warn(`Failed to fetch ${c.get(this)[s]}`,t)})).finally((()=>{c.get(this)[t]=!1,c.get(this)[e]=newAbortController}))}}})(),IcecastMetadataStats=i.default})();
<marquee> Updated v1.1! "Now playing" is being fixed, now you can see the name of your favorite Tekno song playing on Phreakuency! phreakuency.net --- Share it with your friends! --- Tekno 24/7 non stop!!! Support the tekno --- Send us your songs to phreakuency@systemli.org --- free underground music. </marquee>
<hr>
<p> Welcome to Phreakuency Radio! Tekno frequency broadcasting by free phreaks.</p>