w-dwload-dlp
Version:
A download tool for video.
8 lines (7 loc) • 35.7 kB
JavaScript
/*!
* w-dwload-dlp v1.0.21
* (c) 2018-2021 yuda-lyu(semisphere)
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("path"),require("process"),require("module"),require("child_process"),require("fs")):"function"==typeof define&&define.amd?define(["path","process","module","child_process","fs"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["w-dwload-dlp"]=e(t.path,t.process,t.module,t.child_process,t.fs)}(this,(function(t,e,r,n,o){"use strict";var i="undefined"!=typeof document?document.currentScript:null,u=Array.isArray,c="object"==typeof global&&global&&global.Object===Object&&global,a="object"==typeof self&&self&&self.Object===Object&&self,f=c||a||Function("return this")(),s=f.Symbol,l=Object.prototype,d=l.hasOwnProperty,h=l.toString,p=s?s.toStringTag:void 0;var v=Object.prototype.toString;var y="[object Null]",g="[object Undefined]",b=s?s.toStringTag:void 0;function _(t){return null==t?void 0===t?g:y:b&&b in Object(t)?function(t){var e=d.call(t,p),r=t[p];try{t[p]=void 0;var n=!0}catch(t){}var o=h.call(t);return n&&(e?t[p]=r:delete t[p]),o}(t):function(t){return v.call(t)}(t)}function m(t){return null!=t&&"object"==typeof t}var j="[object Symbol]";function w(t){return"symbol"==typeof t||m(t)&&_(t)==j}var $=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,S=/^\w*$/;function O(t,e){if(u(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!w(t))||(S.test(t)||!$.test(t)||null!=e&&t in Object(e))}function x(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var M="[object AsyncFunction]",D="[object Function]",A="[object GeneratorFunction]",k="[object Proxy]";function T(t){if(!x(t))return!1;var e=_(t);return e==D||e==A||e==M||e==k}var z,P=f["__core-js_shared__"],E=(z=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"";var F=Function.prototype.toString;function I(t){if(null!=t){try{return F.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var L=/^\[object .+?Constructor\]$/,N=Function.prototype,H=Object.prototype,Y=N.toString,C=H.hasOwnProperty,U=RegExp("^"+Y.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function R(t){return!(!x(t)||(e=t,E&&E in e))&&(T(t)?U:L).test(I(t));var e}function W(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return R(r)?r:void 0}var q=W(Object,"create");var B=Object.prototype.hasOwnProperty;var V=Object.prototype.hasOwnProperty;function J(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Z(t,e){return t===e||t!=t&&e!=e}function G(t,e){for(var r=t.length;r--;)if(Z(t[r][0],e))return r;return-1}J.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},J.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},J.prototype.get=function(t){var e=this.__data__;if(q){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return B.call(e,t)?e[t]:void 0},J.prototype.has=function(t){var e=this.__data__;return q?void 0!==e[t]:V.call(e,t)},J.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=q&&void 0===e?"__lodash_hash_undefined__":e,this};var K=Array.prototype.splice;function Q(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Q.prototype.clear=function(){this.__data__=[],this.size=0},Q.prototype.delete=function(t){var e=this.__data__,r=G(e,t);return!(r<0)&&(r==e.length-1?e.pop():K.call(e,r,1),--this.size,!0)},Q.prototype.get=function(t){var e=this.__data__,r=G(e,t);return r<0?void 0:e[r][1]},Q.prototype.has=function(t){return G(this.__data__,t)>-1},Q.prototype.set=function(t,e){var r=this.__data__,n=G(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var X=W(f,"Map");function tt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function et(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}et.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(X||Q),string:new J}},et.prototype.delete=function(t){var e=tt(this,t).delete(t);return this.size-=e?1:0,e},et.prototype.get=function(t){return tt(this,t).get(t)},et.prototype.has=function(t){return tt(this,t).has(t)},et.prototype.set=function(t,e){var r=tt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var rt="Expected a function";function nt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(rt);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var u=t.apply(this,n);return r.cache=i.set(o,u)||i,u};return r.cache=new(nt.Cache||et),r}nt.Cache=et;var ot,it,ut,ct=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,at=/\\(\\)?/g,ft=(ot=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ct,(function(t,r,n,o){e.push(n?o.replace(at,"$1"):r||t)})),e},it=nt(ot,(function(t){return 500===ut.size&&ut.clear(),t})),ut=it.cache,it),st=ft;function lt(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var dt=1/0,ht=s?s.prototype:void 0,pt=ht?ht.toString:void 0;function vt(t){if("string"==typeof t)return t;if(u(t))return lt(t,vt)+"";if(w(t))return pt?pt.call(t):"";var e=t+"";return"0"==e&&1/t==-dt?"-0":e}function yt(t){return null==t?"":vt(t)}function gt(t,e){return u(t)?t:O(t,e)?[t]:st(yt(t))}var bt=1/0;function _t(t){if("string"==typeof t||w(t))return t;var e=t+"";return"0"==e&&1/t==-bt?"-0":e}function mt(t,e){for(var r=0,n=(e=gt(e,t)).length;null!=t&&r<n;)t=t[_t(e[r++])];return r&&r==n?t:void 0}function jt(t,e,r){var n=null==t?void 0:mt(t,e);return void 0===n?r:n}var wt=Object.prototype;var $t=function(t,e){return function(r){return t(e(r))}}(Object.keys,Object),St=$t,Ot=Object.prototype.hasOwnProperty;function xt(t){if(r=(e=t)&&e.constructor,e!==("function"==typeof r&&r.prototype||wt))return St(t);var e,r,n=[];for(var o in Object(t))Ot.call(t,o)&&"constructor"!=o&&n.push(o);return n}var Mt=W(f,"DataView"),Dt=W(f,"Promise"),At=W(f,"Set"),kt=W(f,"WeakMap"),Tt="[object Map]",zt="[object Promise]",Pt="[object Set]",Et="[object WeakMap]",Ft="[object DataView]",It=I(Mt),Lt=I(X),Nt=I(Dt),Ht=I(At),Yt=I(kt),Ct=_;(Mt&&Ct(new Mt(new ArrayBuffer(1)))!=Ft||X&&Ct(new X)!=Tt||Dt&&Ct(Dt.resolve())!=zt||At&&Ct(new At)!=Pt||kt&&Ct(new kt)!=Et)&&(Ct=function(t){var e=_(t),r="[object Object]"==e?t.constructor:void 0,n=r?I(r):"";if(n)switch(n){case It:return Ft;case Lt:return Tt;case Nt:return zt;case Ht:return Pt;case Yt:return Et}return e});var Ut=Ct,Rt=9007199254740991;function Wt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Rt}function qt(t){return null!=t&&Wt(t.length)&&!T(t)}var Bt="[object String]";function Vt(t){return function(e){return null==e?void 0:e[t]}}var Jt=Vt("length"),Zt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Gt(t){return Zt.test(t)}var Kt="\\ud800-\\udfff",Qt="["+Kt+"]",Xt="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",te="\\ud83c[\\udffb-\\udfff]",ee="[^"+Kt+"]",re="(?:\\ud83c[\\udde6-\\uddff]){2}",ne="[\\ud800-\\udbff][\\udc00-\\udfff]",oe="(?:"+Xt+"|"+te+")"+"?",ie="[\\ufe0e\\ufe0f]?",ue=ie+oe+("(?:\\u200d(?:"+[ee,re,ne].join("|")+")"+ie+oe+")*"),ce="(?:"+[ee+Xt+"?",Xt,re,ne,Qt].join("|")+")",ae=RegExp(te+"(?="+te+")|"+ce+ue,"g");function fe(t){return Gt(t)?function(t){for(var e=ae.lastIndex=0;ae.test(t);)++e;return e}(t):Jt(t)}var se="[object Map]",le="[object Set]";function de(t){if(null==t)return 0;if(qt(t))return"string"==typeof(e=t)||!u(e)&&m(e)&&_(e)==Bt?fe(t):t.length;var e,r=Ut(t);return r==se||r==le?t.size:xt(t).length}function he(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}var pe,ve=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),u=i.length;u--;){var c=i[pe?u:++n];if(!1===e(o[c],c,o))break}return t};function ye(t){return m(t)&&"[object Arguments]"==_(t)}var ge=Object.prototype,be=ge.hasOwnProperty,_e=ge.propertyIsEnumerable,me=ye(function(){return arguments}())?ye:function(t){return m(t)&&be.call(t,"callee")&&!_e.call(t,"callee")},je=me;var we="object"==typeof exports&&exports&&!exports.nodeType&&exports,$e=we&&"object"==typeof module&&module&&!module.nodeType&&module,Se=$e&&$e.exports===we?f.Buffer:void 0,Oe=(Se?Se.isBuffer:void 0)||function(){return!1},xe=9007199254740991,Me=/^(?:0|[1-9]\d*)$/;function De(t,e){var r=typeof t;return!!(e=null==e?xe:e)&&("number"==r||"symbol"!=r&&Me.test(t))&&t>-1&&t%1==0&&t<e}var Ae={};Ae["[object Float32Array]"]=Ae["[object Float64Array]"]=Ae["[object Int8Array]"]=Ae["[object Int16Array]"]=Ae["[object Int32Array]"]=Ae["[object Uint8Array]"]=Ae["[object Uint8ClampedArray]"]=Ae["[object Uint16Array]"]=Ae["[object Uint32Array]"]=!0,Ae["[object Arguments]"]=Ae["[object Array]"]=Ae["[object ArrayBuffer]"]=Ae["[object Boolean]"]=Ae["[object DataView]"]=Ae["[object Date]"]=Ae["[object Error]"]=Ae["[object Function]"]=Ae["[object Map]"]=Ae["[object Number]"]=Ae["[object Object]"]=Ae["[object RegExp]"]=Ae["[object Set]"]=Ae["[object String]"]=Ae["[object WeakMap]"]=!1;var ke="object"==typeof exports&&exports&&!exports.nodeType&&exports,Te=ke&&"object"==typeof module&&module&&!module.nodeType&&module,ze=Te&&Te.exports===ke&&c.process,Pe=function(){try{var t=Te&&Te.require&&Te.require("util").types;return t||ze&&ze.binding&&ze.binding("util")}catch(t){}}(),Ee=Pe&&Pe.isTypedArray,Fe=Ee?function(t){return function(e){return t(e)}}(Ee):function(t){return m(t)&&Wt(t.length)&&!!Ae[_(t)]},Ie=Fe,Le=Object.prototype.hasOwnProperty;function Ne(t,e){var r=u(t),n=!r&&je(t),o=!r&&!n&&Oe(t),i=!r&&!n&&!o&&Ie(t),c=r||n||o||i,a=c?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],f=a.length;for(var s in t)!e&&!Le.call(t,s)||c&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||De(s,f))||a.push(s);return a}function He(t){return qt(t)?Ne(t):xt(t)}var Ye=function(t,e){return function(r,n){if(null==r)return r;if(!qt(r))return t(r,n);for(var o=r.length,i=e?o:-1,u=Object(r);(e?i--:++i<o)&&!1!==n(u[i],i,u););return r}}((function(t,e){return t&&ve(t,e,He)})),Ce=Ye;function Ue(t){return t}function Re(t,e){var r;return(u(t)?he:Ce)(t,"function"==typeof(r=e)?r:Ue)}var We=/\s/;var qe=/^\s+/;function Be(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&We.test(t.charAt(e)););return e}(t)+1).replace(qe,""):t}var Ve=NaN,Je=/^[-+]0x[0-9a-f]+$/i,Ze=/^0b[01]+$/i,Ge=/^0o[0-7]+$/i,Ke=parseInt;function Qe(t){if("number"==typeof t)return t;if(w(t))return Ve;if(x(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=x(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Be(t);var r=Ze.test(t);return r||Ge.test(t)?Ke(t.slice(2),r?2:8):Je.test(t)?Ve:+t}var Xe=1/0,tr=17976931348623157e292;function er(t){return t?(t=Qe(t))===Xe||t===-Xe?(t<0?-1:1)*tr:t==t?t:0:0===t?t:0}function rr(t){var e=er(t),r=e%1;return e==e?r?e-r:e:0}function nr(t){return"[object String]"===Object.prototype.toString.call(t)}function or(t){return!(!nr(t)||""===t)}function ir(t){return t!=t}function ur(t){let e=!1;if(or(t))e=!isNaN(Number(t));else if(function(t){return"[object Number]"===Object.prototype.toString.call(t)}(t)){if(ir(t))return!1;e=!0}return e}function cr(t){if(!ur(t))return 0;return er(t)}function ar(t){return!!ur(t)&&(t=cr(t),"number"==typeof(e=t)&&e==rr(e));var e}var fr=f.isFinite,sr=Math.min;var lr=function(t){var e=Math[t];return function(t,r){if(t=Qe(t),(r=null==r?0:sr(rr(r),292))&&fr(t)){var n=(yt(t)+"e").split("e");return+((n=(yt(e(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}("round"),dr=lr;function hr(t){if(!ur(t))return 0;t=cr(t);let e=dr(t);return"0"===String(e)?0:e}let pr="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),vr=pr.length;function yr(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32,e=[];var r;t=ar(r=t)&&hr(r)>0?hr(t):32;for(let r=0;r<t;r++)e[r]=pr[0|Math.random()*vr];return e.join("")}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function gr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var br={exports:{}};!function(t,e){t.exports=function(){var t=1e3,e=6e4,r=36e5,n="millisecond",o="second",i="minute",u="hour",c="day",a="week",f="month",s="quarter",l="year",d="date",h="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},g=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},b={s:g,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+g(n,2,"0")+":"+g(o,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(n,f),i=r-o<0,u=e.clone().add(n+(i?-1:1),f);return+(-(n+(r-o)/(i?o-u:u-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:l,w:a,d:c,D:d,h:u,m:i,s:o,ms:n,Q:s}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},_="en",m={};m[_]=y;var j="$isDayjsObject",w=function(t){return t instanceof x||!(!t||!t[j])},$=function t(e,r,n){var o;if(!e)return _;if("string"==typeof e){var i=e.toLowerCase();m[i]&&(o=i),r&&(m[i]=r,o=i);var u=e.split("-");if(!o&&u.length>1)return t(u[0])}else{var c=e.name;m[c]=e,o=c}return!n&&o&&(_=o),o||!n&&_},S=function(t,e){if(w(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new x(r)},O=b;O.l=$,O.i=w,O.w=function(t,e){return S(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var x=function(){function y(t){this.$L=$(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[j]=!0}var g=y.prototype;return g.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(p);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(e)}(t),this.init()},g.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},g.$utils=function(){return O},g.isValid=function(){return!(this.$d.toString()===h)},g.isSame=function(t,e){var r=S(t);return this.startOf(e)<=r&&r<=this.endOf(e)},g.isAfter=function(t,e){return S(t)<this.startOf(e)},g.isBefore=function(t,e){return this.endOf(e)<S(t)},g.$g=function(t,e,r){return O.u(t)?this[e]:this.set(r,t)},g.unix=function(){return Math.floor(this.valueOf()/1e3)},g.valueOf=function(){return this.$d.getTime()},g.startOf=function(t,e){var r=this,n=!!O.u(e)||e,s=O.p(t),h=function(t,e){var o=O.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return n?o:o.endOf(c)},p=function(t,e){return O.w(r.toDate()[t].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},v=this.$W,y=this.$M,g=this.$D,b="set"+(this.$u?"UTC":"");switch(s){case l:return n?h(1,0):h(31,11);case f:return n?h(1,y):h(0,y+1);case a:var _=this.$locale().weekStart||0,m=(v<_?v+7:v)-_;return h(n?g-m:g+(6-m),y);case c:case d:return p(b+"Hours",0);case u:return p(b+"Minutes",1);case i:return p(b+"Seconds",2);case o:return p(b+"Milliseconds",3);default:return this.clone()}},g.endOf=function(t){return this.startOf(t,!1)},g.$set=function(t,e){var r,a=O.p(t),s="set"+(this.$u?"UTC":""),h=(r={},r[c]=s+"Date",r[d]=s+"Date",r[f]=s+"Month",r[l]=s+"FullYear",r[u]=s+"Hours",r[i]=s+"Minutes",r[o]=s+"Seconds",r[n]=s+"Milliseconds",r)[a],p=a===c?this.$D+(e-this.$W):e;if(a===f||a===l){var v=this.clone().set(d,1);v.$d[h](p),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},g.set=function(t,e){return this.clone().$set(t,e)},g.get=function(t){return this[O.p(t)]()},g.add=function(n,s){var d,h=this;n=Number(n);var p=O.p(s),v=function(t){var e=S(h);return O.w(e.date(e.date()+Math.round(t*n)),h)};if(p===f)return this.set(f,this.$M+n);if(p===l)return this.set(l,this.$y+n);if(p===c)return v(1);if(p===a)return v(7);var y=(d={},d[i]=e,d[u]=r,d[o]=t,d)[p]||1,g=this.$d.getTime()+n*y;return O.w(g,this)},g.subtract=function(t,e){return this.add(-1*t,e)},g.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var n=t||"YYYY-MM-DDTHH:mm:ssZ",o=O.z(this),i=this.$H,u=this.$m,c=this.$M,a=r.weekdays,f=r.months,s=r.meridiem,l=function(t,r,o,i){return t&&(t[r]||t(e,n))||o[r].slice(0,i)},d=function(t){return O.s(i%12||12,t,"0")},p=s||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(v,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return O.s(e.$y,4,"0");case"M":return c+1;case"MM":return O.s(c+1,2,"0");case"MMM":return l(r.monthsShort,c,f,3);case"MMMM":return l(f,c);case"D":return e.$D;case"DD":return O.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return l(r.weekdaysMin,e.$W,a,2);case"ddd":return l(r.weekdaysShort,e.$W,a,3);case"dddd":return a[e.$W];case"H":return String(i);case"HH":return O.s(i,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return p(i,u,!0);case"A":return p(i,u,!1);case"m":return String(u);case"mm":return O.s(u,2,"0");case"s":return String(e.$s);case"ss":return O.s(e.$s,2,"0");case"SSS":return O.s(e.$ms,3,"0");case"Z":return o}return null}(t)||o.replace(":","")}))},g.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},g.diff=function(n,d,h){var p,v=this,y=O.p(d),g=S(n),b=(g.utcOffset()-this.utcOffset())*e,_=this-g,m=function(){return O.m(v,g)};switch(y){case l:p=m()/12;break;case f:p=m();break;case s:p=m()/3;break;case a:p=(_-b)/6048e5;break;case c:p=(_-b)/864e5;break;case u:p=_/r;break;case i:p=_/e;break;case o:p=_/t;break;default:p=_}return h?p:O.a(p)},g.daysInMonth=function(){return this.endOf(f).$D},g.$locale=function(){return m[this.$L]},g.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=$(t,e,!0);return n&&(r.$L=n),r},g.clone=function(){return O.w(this.$d,this)},g.toDate=function(){return new Date(this.valueOf())},g.toJSON=function(){return this.isValid()?this.toISOString():null},g.toISOString=function(){return this.$d.toISOString()},g.toString=function(){return this.$d.toUTCString()},y}(),M=x.prototype;return S.prototype=M,[["$ms",n],["$s",o],["$m",i],["$H",u],["$W",c],["$M",f],["$y",l],["$D",d]].forEach((function(t){M[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),S.extend=function(t,e){return t.$i||(t(e,x,S),t.$i=!0),S},S.locale=$,S.isDayjs=w,S.unix=function(t){return S(1e3*t)},S.en=m[_],S.Ls=m,S.p={},S}()}(br);var _r=gr(br.exports);function mr(t){let e=Object.prototype.toString.call(t);return"[object Function]"===e||"[object AsyncFunction]"===e}function jr(t){var e=this.__data__=new Q(t);this.size=e.size}jr.prototype.clear=function(){this.__data__=new Q,this.size=0},jr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},jr.prototype.get=function(t){return this.__data__.get(t)},jr.prototype.has=function(t){return this.__data__.has(t)},jr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Q){var n=r.__data__;if(!X||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new et(n)}return r.set(t,e),this.size=r.size,this};function wr(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new et;++e<r;)this.add(t[e])}function $r(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Sr(t,e){return t.has(e)}wr.prototype.add=wr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},wr.prototype.has=function(t){return this.__data__.has(t)};var Or=1,xr=2;function Mr(t,e,r,n,o,i){var u=r&Or,c=t.length,a=e.length;if(c!=a&&!(u&&a>c))return!1;var f=i.get(t),s=i.get(e);if(f&&s)return f==e&&s==t;var l=-1,d=!0,h=r&xr?new wr:void 0;for(i.set(t,e),i.set(e,t);++l<c;){var p=t[l],v=e[l];if(n)var y=u?n(v,p,l,e,t,i):n(p,v,l,t,e,i);if(void 0!==y){if(y)continue;d=!1;break}if(h){if(!$r(e,(function(t,e){if(!Sr(h,e)&&(p===t||o(p,t,r,n,i)))return h.push(e)}))){d=!1;break}}else if(p!==v&&!o(p,v,r,n,i)){d=!1;break}}return i.delete(t),i.delete(e),d}var Dr=f.Uint8Array;function Ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function kr(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Tr=1,zr=2,Pr="[object Boolean]",Er="[object Date]",Fr="[object Error]",Ir="[object Map]",Lr="[object Number]",Nr="[object RegExp]",Hr="[object Set]",Yr="[object String]",Cr="[object Symbol]",Ur="[object ArrayBuffer]",Rr="[object DataView]",Wr=s?s.prototype:void 0,qr=Wr?Wr.valueOf:void 0;var Br=Object.prototype.propertyIsEnumerable,Vr=Object.getOwnPropertySymbols,Jr=Vr?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var u=t[r];e(u,r,t)&&(i[o++]=u)}return i}(Vr(t),(function(e){return Br.call(t,e)})))}:function(){return[]},Zr=Jr;function Gr(t){return function(t,e,r){var n=e(t);return u(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,He,Zr)}var Kr=1,Qr=Object.prototype.hasOwnProperty;var Xr=1,tn="[object Arguments]",en="[object Array]",rn="[object Object]",nn=Object.prototype.hasOwnProperty;function on(t,e,r,n,o,i){var c=u(t),a=u(e),f=c?en:Ut(t),s=a?en:Ut(e),l=(f=f==tn?rn:f)==rn,d=(s=s==tn?rn:s)==rn,h=f==s;if(h&&Oe(t)){if(!Oe(e))return!1;c=!0,l=!1}if(h&&!l)return i||(i=new jr),c||Ie(t)?Mr(t,e,r,n,o,i):function(t,e,r,n,o,i,u){switch(r){case Rr:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ur:return!(t.byteLength!=e.byteLength||!i(new Dr(t),new Dr(e)));case Pr:case Er:case Lr:return Z(+t,+e);case Fr:return t.name==e.name&&t.message==e.message;case Nr:case Yr:return t==e+"";case Ir:var c=Ar;case Hr:var a=n&Tr;if(c||(c=kr),t.size!=e.size&&!a)return!1;var f=u.get(t);if(f)return f==e;n|=zr,u.set(t,e);var s=Mr(c(t),c(e),n,o,i,u);return u.delete(t),s;case Cr:if(qr)return qr.call(t)==qr.call(e)}return!1}(t,e,f,r,n,o,i);if(!(r&Xr)){var p=l&&nn.call(t,"__wrapped__"),v=d&&nn.call(e,"__wrapped__");if(p||v){var y=p?t.value():t,g=v?e.value():e;return i||(i=new jr),o(y,g,r,n,i)}}return!!h&&(i||(i=new jr),function(t,e,r,n,o,i){var u=r&Kr,c=Gr(t),a=c.length;if(a!=Gr(e).length&&!u)return!1;for(var f=a;f--;){var s=c[f];if(!(u?s in e:Qr.call(e,s)))return!1}var l=i.get(t),d=i.get(e);if(l&&d)return l==e&&d==t;var h=!0;i.set(t,e),i.set(e,t);for(var p=u;++f<a;){var v=t[s=c[f]],y=e[s];if(n)var g=u?n(y,v,s,e,t,i):n(v,y,s,t,e,i);if(!(void 0===g?v===y||o(v,y,r,n,i):g)){h=!1;break}p||(p="constructor"==s)}if(h&&!p){var b=t.constructor,_=e.constructor;b==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(h=!1)}return i.delete(t),i.delete(e),h}(t,e,r,n,o,i))}function un(t,e,r,n,o){return t===e||(null==t||null==e||!m(t)&&!m(e)?t!=t&&e!=e:on(t,e,r,n,un,o))}var cn=1,an=2;function fn(t){return t==t&&!x(t)}function sn(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}function ln(t){var e=function(t){for(var e=He(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,fn(o)]}return e}(t);return 1==e.length&&e[0][2]?sn(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var o=r.length,i=o,u=!n;if(null==t)return!i;for(t=Object(t);o--;){var c=r[o];if(u&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<i;){var a=(c=r[o])[0],f=t[a],s=c[1];if(u&&c[2]){if(void 0===f&&!(a in t))return!1}else{var l=new jr;if(n)var d=n(f,s,a,t,e,l);if(!(void 0===d?un(s,f,cn|an,n,l):d))return!1}}return!0}(r,t,e)}}function dn(t,e){return null!=t&&e in Object(t)}function hn(t,e){return null!=t&&function(t,e,r){for(var n=-1,o=(e=gt(e,t)).length,i=!1;++n<o;){var c=_t(e[n]);if(!(i=null!=t&&r(t,c)))break;t=t[c]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&Wt(o)&&De(c,o)&&(u(t)||je(t))}(t,e,dn)}var pn=1,vn=2;function yn(t){return O(t)?Vt(_t(t)):function(t){return function(e){return mt(e,t)}}(t)}function gn(t){return"function"==typeof t?t:null==t?Ue:"object"==typeof t?u(t)?function(t,e){return O(t)&&fn(e)?sn(_t(t),e):function(r){var n=jt(r,t);return void 0===n&&n===e?hn(r,t):un(e,n,pn|vn)}}(t[0],t[1]):ln(t):yn(t)}function bn(t,e){var r=-1,n=qt(t)?Array(t.length):[];return Ce(t,(function(t,o,i){n[++r]=e(t,o,i)})),n}function _n(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:function(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}(t,e,r)}function mn(t){return t!=t}function jn(t,e,r){return e==e?function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}(t,e,r):function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,mn,r)}var wn="\\ud800-\\udfff",$n="["+wn+"]",Sn="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",On="\\ud83c[\\udffb-\\udfff]",xn="[^"+wn+"]",Mn="(?:\\ud83c[\\udde6-\\uddff]){2}",Dn="[\\ud800-\\udbff][\\udc00-\\udfff]",An="(?:"+Sn+"|"+On+")"+"?",kn="[\\ufe0e\\ufe0f]?",Tn=kn+An+("(?:\\u200d(?:"+[xn,Mn,Dn].join("|")+")"+kn+An+")*"),zn="(?:"+[xn+Sn+"?",Sn,Mn,Dn,$n].join("|")+")",Pn=RegExp(On+"(?="+On+")|"+zn+Tn,"g");function En(t){return Gt(t)?function(t){return t.match(Pn)||[]}(t):function(t){return t.split("")}(t)}function Fn(t,e,r){if((t=yt(t))&&(r||void 0===e))return Be(t);if(!t||!(e=vt(e)))return t;var n=En(t),o=En(e),i=function(t,e){for(var r=-1,n=t.length;++r<n&&jn(e,t[r],0)>-1;);return r}(n,o),u=function(t,e){for(var r=t.length;r--&&jn(e,t[r],0)>-1;);return r}(n,o)+1;return _n(n,i,u).join("")}function In(t,e){if(!or(t))return[];if(!or(e))return[];let r=function(t,e){return or(t)&&or(e)?t.split(e):[]}(t,e);var n,o;o=Fn,r=(u(n=r)?lt:bn)(n,gn(o));let i=[];return Re(r,(function(t){or(t)&&i.push(t)})),i}function Ln(t){if(!ar(t))return!1;return hr(t)>=0}function Nn(t,e){if(!or(t))return"";if(!Ln(e))return"";if(0===(e=hr(e)))return"";let r=t.length-e;return r<0&&(r=0),t.substring(r,r+e)}function Hn(t,e){return or(t)&&Ln(e)?0===(e=hr(e))?"":t.substring(0,e):""}var Yn="[object Boolean]";function Cn(t){return!0===(e=t)||!1===e||m(e)&&_(e)==Yn;var e}function Un(){let t,e,r=new Promise((function(){t=arguments[0],e=arguments[1]}));return r.resolve=t,r.reject=e,r}function Rn(t){return"[object Array]"===Object.prototype.toString.call(t)}function Wn(t){if(function(t){return"[object Object]"===Object.prototype.toString.call(t)}(t)){for(let e in t)return!1;return!0}return!1}function qn(t){return!!function(t){return"[object Undefined]"===Object.prototype.toString.call(t)}(t)||(!!function(t){return"[object Null]"===Object.prototype.toString.call(t)}(t)||(!!Wn(t)||(!!function(t){return!(!nr(t)||""!==t)}(t)||(!!function(t){return!!Rn(t)&&0===t.length}(t)||!!ir(t)))))}var Bn=n,Vn=Bn.spawn,Jn=Bn.exec;function Zn(t,e,r){var n={};try{Object.keys(t).forEach((function(r){t[r].forEach((function(t){n[t]||(Gn(t,e),n[t]=1)})),n[r]||(Gn(r,e),n[r]=1)}))}catch(t){if(r)return r(t);throw t}if(r)return r()}function Gn(t,e){try{process.kill(parseInt(t,10),e)}catch(t){if("ESRCH"!==t.code)throw t}}function Kn(t,e,r,n,o){var i=n(t),u="";i.stdout.on("data",(function(t){t=t.toString("ascii");u+=t}));i.on("close",(function(i){delete r[t],0==i?u.match(/\d+/g).forEach((function(i){i=parseInt(i,10),e[t].push(i),e[i]=[],r[i]=1,Kn(i,e,r,n,o)})):0==Object.keys(r).length&&o()}))}var Qn=gr((function(t,e,r){if("function"==typeof e&&void 0===r&&(r=e,e=void 0),t=parseInt(t),Number.isNaN(t)){if(r)return r(new Error("pid must be a number"));throw new Error("pid must be a number")}var n={},o={};switch(n[t]=[],o[t]=1,process.platform){case"win32":Jn("taskkill /pid "+t+" /T /F",r);break;case"darwin":Kn(t,n,o,(function(t){return Vn("pgrep",["-P",t])}),(function(){Zn(n,e,r)}));break;default:Kn(t,n,o,(function(t){return Vn("ps",["-o","pid","--no-headers","--ppid",t])}),(function(){Zn(n,e,r)}))}}));function Xn(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((!Rn(o=e)||0===o.length||1===o.length&&qn(o[0]))&&!or(e))throw new Error("args is not an effective array or string");var o;or(e)&&(e=[e]);let i=jt(r,"mode");"spawn"!==i&&"exec"!==i&&"execFile"!==i&&(i="spawn");let u=jt(r,"cbStdout"),c=jt(r,"cbStderr"),a=jt(r,"codeCmd");or(a)||(a="utf8");let f=jt(r,"useChcp");Cn(f)||(f=!1);let s=jt(r,"timeout");(!ur(s)||s<=0)&&(s=null);let l=Un();if(!function(t,e){function r(t){return Rn(t)?t:[t]}if(qn(t))return!1;if(0===(t=r(t)).length)return!1;if(qn(t))return!1;if(0===(e=r(e)).length)return!1;for(let r=0;r<t.length;r++)for(let i=0;i<e.length;i++)if(n=t[r],o=e[i],un(n,o))return!0;var n,o;return!1}(i,["spawn","exec","execFile"]))return l.reject(`invalid mode[${i}]`),l;let d=null,h="";try{if("spawn"===i){let r=Hn(t,1),o=Nn(t,1);if('"'===r||'"'===o||"'"===r||"'"===o)throw new Error("prog of spawn doens not need to add quotes");d=n.spawn(t,e,{windowsHide:!0,shell:!1})}else if("exec"===i){let r="";f&&(r="cmd /c chcp 65001>nul &&"),d=n.exec(`${r} ${t} ${e.join(" ")} & exit`,{windowsHide:!0,encoding:a})}else"execFile"===i&&(d=n.execFile(t,e,{windowsHide:!0,encoding:a}))}catch(t){return l.reject(t),l}d.stdout.on("data",(t=>{let e="";e="spawn"===i?t.toString(a):t.toString(),h+=e+"\n",mr(u)&&u(e)})),d.stderr.on("data",(t=>{let e="";e="spawn"===i?t.toString(a):t.toString(),h+=e+"\n",mr(c)&&c(e)}));let p=null,v=!1;return null!==s&&(p=setTimeout((()=>{v=!0,d&&d.pid&&function(t){let e=Un();return Qn(Number(t),"SIGKILL",(r=>{r?e.reject(r):e.resolve(`pid[${t}] killed`)})),e}(d.pid).catch((()=>{}))}),s)),d.on("close",(t=>{null!==p&&clearTimeout(p),v?l.reject(`timeout[${s}ms]:\n${h}`):0!==t?l.reject(`code[${t}]:\n${h}`):l.resolve(h)})),d.on("error",(t=>{null!==p&&clearTimeout(p),l.reject(t)})),l}function to(t){let e=jt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs"),r=!1;try{e.statSync(t),r=!0}catch{r=!1}return r}function eo(t){let e=jt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs");return!!to(t,{fs:e})&&(!e.lstatSync(t).isDirectory()&&!e.lstatSync(t).isSymbolicLink())}function ro(t){return eo(t,{fs:o})}function no(t){let e=jt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs");if(!to(t,{fs:e}))return!1;let r=e.lstatSync(t);return!r.isFile()&&!r.isSymbolicLink()}function oo(t){let e=jt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs");if(no(t,{fs:e}))return{success:"input folder is already exists: "+t};if(to(t,{fs:e}))return{error:"input path already exists: "+t};try{e.mkdirSync(t,{recursive:!0})}catch(t){return{error:t}}return{success:"done: "+t}}function io(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=jt(r,"path"),o=jt(r,"fs"),i=jt(r,"useSync","");Cn(i)||(i=!0);let u="";return u=i?function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=jt(r,"path"),o=jt(r,"fs");if(!eo(t,{fs:o}))return{error:`fpSrc[${t}] is not a file`};try{oo(n.dirname(e),{fs:o}),o.copyFileSync(t,e)}catch(t){return{error:t}}return{success:"done: "+e}}(t,e,{path:n,fs:o}):async function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=jt(r,"path"),o=jt(r,"fs");if(!eo(t,{fs:o}))return{error:`fpSrc[${t}] is not a file`};let i=null;return await(async(t,e)=>{oo(n.dirname(e),{fs:o}),await new Promise(((r,n)=>{let i=o.createReadStream(t),u=o.createWriteStream(e);i.on("error",n),u.on("error",n),u.on("finish",r),i.pipe(u)}))})(t,e).then((()=>{i={success:"done: "+e}})).catch((t=>{i={error:t}})),i}(t,e,{path:n,fs:o}),u}function uo(e){return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=jt(e,"path"),n=jt(e,"fs");if(!to(t,{fs:n})){let e=oo(t,{fs:n});return e.error?e.error:{success:"done: "+t}}if(!no(t,{fs:n}))return{error:"input path is not a folder"};try{let e=n.readdirSync(t);for(let o of e){let e=r.join(t,o);n.statSync(e).isDirectory()?n.rmSync(e,{recursive:!0,force:!0}):n.unlinkSync(e)}}catch(t){return{error:t}}return{success:"done: "+t}}(e,{path:t,fs:o})}function co(t){return function(t){let e=jt(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs");if(!to(t,{fs:e}))return{success:"file does not exist: "+t};if(!eo(t,{fs:e}))return{error:"input path is not a file: "+t};try{e.unlinkSync(t)}catch(t){return{error:t}}return{success:"done: "+t}}(t,{fs:o})}let ao=t.resolve();return async function(n,u){let c,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=null,s=jt(a,"clean");Cn(s)||(s=!1);let l=jt(a,"funProg");if("win32"!==e.platform)return Promise.reject("operating system is not windows");if(!or(n))return Promise.reject("url is not a file");let d="yt-dlp.exe",h="";{let t=`${ao}/yt-dlp/`,e=`${ao}/node_modules/w-dwload-dlp/yt-dlp/`;if(ro(`${t}${d}`))h=t;else{if(!ro(`${e}${d}`))return Promise.reject("can not find folder for yt-dlp");h=e}}let p=t.resolve(h,d),v="ffmpeg.exe",y="";{let e=`${ao}/node_modules/w-ffmpeg/src/`;if(!or(y)&&ro(`${e}${v}`)&&(y=e),!or(y))try{let e=r.createRequire("undefined"==typeof document&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:"undefined"==typeof document?location.href:i&&i.src||new URL("w-dwload-dlp.umd.js",document.baseURI).href),n=`${t.dirname(e.resolve("w-ffmpeg/package.json"))}/src/`;ro(`${n}${v}`)&&(y=n)}catch(t){}if(!or(y))return Promise.reject("can not find folder for ffmpeg (w-ffmpeg)")}let g=t.resolve(y,v),b=e.cwd(),_=h;e.chdir(_);let m=`${function(){if(!mr(_r))throw new Error("invalid dayjs");return _r().format("YYYYMMDDHHmmss")}()}-${yr(6)}`,j=`${m}`,w=t.resolve(h,"Downloads");s&&uo(w);let $=t.resolve(w,j),S=t.resolve(w,`${m}.mp4`),O=[],x=0,M=1,D=0,A=0,k=100,T=0,z=0,P=mr(l),E=[n,"-o",$,"--newline","--no-playlist","--merge-output-format","mp4","--ffmpeg-location",g];if(await Xn(p,E,{cbStdout:t=>{let e=In(t=t.replaceAll("\n"," ")," ");if(t.indexOf("format(s):")>=0){let e=jt(In(t,"format(s):"),1,"");O=In(e,"+"),M=de(O)}if(de(O)>0){let e=-1;Re(O,((r,n)=>{t.indexOf(`.f${r}.`)>=0&&(e=n)}));let r=e+1;x<r&&(x=r)}if(0===T&&t.indexOf(" ETA ")>=0)if(t.indexOf("(frag")>=0){let e=jt(In(t,"(frag"),1,"");e=e.replaceAll(")","");let r=jt(In(e,"/"),1,"");ur(r)&&(r=hr(r),r>0&&(T=r))}else T=100;0===x&&t.indexOf(" ETA ")>=0&&t.indexOf("(frag")<0&&(x=1);let r=jt(e,1,""),n="%"===Nn(r,1),o=t.indexOf("(frag 0/")>=0,i=0;var u,c;if(n&&!o&&(c=1,i=or(u=r)&&Ln(c)?0===(c=hr(c))?u:Hn(u,u.length-c):"",i=cr(i)),i>0){i=1/M*i+(x-1)/M*100}i*=.99,z<i&&(z=i,T>0&&(k=T),A=hr(z/100*k),A<=D||(P&&l(z,A,k),D=A))}}).catch((t=>{console.log("execProcess catch",t),f=t.toString()})),e.chdir(b),f)return Promise.reject(f);if(!ro(S)){let e=t.resolve(w,m);if(!ro(e))return console.log(`can not find the merged file[${S}]`),Promise.reject(`invalid url[${n}] or can not download`);S=e}return c=function(e,r){return io(e,r,{path:t,fs:o,...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}})}(S,u),f=jt(c,"error"),f?Promise.reject(f.toString()):(c=co(S),P&&l(100,k,k),"ok")}}));
//# sourceMappingURL=w-dwload-dlp.umd.js.map