/* 脚本引用 https://raw.githubusercontent.com/DualSubs/YouTube/main/js/YouTube.response.js */ console.log("🍿 DualSubs: ▶ YouTube Response");const e=function(){if("undefined"!=typeof $environment&&$environment["surge-version"])return"Surge";if("undefined"!=typeof $environment&&$environment["stash-version"])return"Stash";if("undefined"!=typeof module&&module.exports)return"Node.js";if("undefined"!=typeof $task)return"Quantumult X";if("undefined"!=typeof $loon)return"Loon";if("undefined"!=typeof $rocket)return"Shadowrocket";if("undefined"!=typeof Egern)return"Egern"}();class a{static name="Lodash";static version="1.2.2";static about(){return console.log(`\n🟧 ${this.name} v${this.version}\n`)}static get(e={},a="",t=void 0){Array.isArray(a)||(a=this.toPath(a));const n=a.reduce(((e,a)=>Object(e)[a]),e);return void 0===n?t:n}static set(e={},a="",t){return Array.isArray(a)||(a=this.toPath(a)),a.slice(0,-1).reduce(((e,t,n)=>Object(e[t])===e[t]?e[t]:e[t]=/^\d+$/.test(a[n+1])?[]:{}),e)[a[a.length-1]]=t,e}static unset(e={},a=""){return Array.isArray(a)||(a=this.toPath(a)),a.reduce(((e,t,n)=>n===a.length-1?(delete e[t],!0):Object(e)[t]),e)}static toPath(e){return e.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean)}static escape(e){const a={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,(e=>a[e]))}static unescape(e){const a={"&":"&","<":"<",">":">",""":'"',"'":"'"};return e.replace(/&|<|>|"|'/g,(e=>a[e]))}}class t{static name="Storage";static version="1.1.0";static about(){return n("",`🟧 ${this.name} v${this.version}`,"")}static data=null;static dataFile="box.dat";static#e=/^@(?[^.]+)(?:\.(?.*))?$/;static getItem(t=new String,n=null){let s=n;if(!0===t.startsWith("@")){const{key:e,path:n}=t.match(this.#e)?.groups;t=e;let r=this.getItem(t,{});"object"!=typeof r&&(r={}),s=a.get(r,n);try{s=JSON.parse(s)}catch(e){}}else{switch(e){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":s=$persistentStore.read(t);break;case"Quantumult X":s=$prefs.valueForKey(t);break;case"Node.js":this.data=this.#a(this.dataFile),s=this.data?.[t];break;default:s=this.data?.[t]||null}try{s=JSON.parse(s)}catch(e){}}return s??n}static setItem(t=new String,n=new String){let s=!1;if("object"==typeof n)n=JSON.stringify(n);else n=String(n);if(!0===t.startsWith("@")){const{key:e,path:r}=t.match(this.#e)?.groups;t=e;let i=this.getItem(t,{});"object"!=typeof i&&(i={}),a.set(i,r,n),s=this.setItem(t,i)}else switch(e){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":s=$persistentStore.write(n,t);break;case"Quantumult X":s=$prefs.setValueForKey(n,t);break;case"Node.js":this.data=this.#a(this.dataFile),this.data[t]=n,this.#t(this.dataFile),s=!0;break;default:s=this.data?.[t]||null}return s}static removeItem(t){let n=!1;if(!0===t.startsWith("@")){const{key:e,path:s}=t.match(this.#e)?.groups;t=e;let r=this.getItem(t);"object"!=typeof r&&(r={}),keyValue=a.unset(r,s),n=this.setItem(t,r)}else switch(e){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":case"Node.js":default:n=!1;break;case"Quantumult X":n=$prefs.removeValueForKey(t)}return n}static clear(){let a=!1;switch(e){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":case"Node.js":default:a=!1;break;case"Quantumult X":a=$prefs.removeAllValues()}return a}static#a(e){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const a=this.path.resolve(e),t=this.path.resolve(process.cwd(),e),n=this.fs.existsSync(a),s=!n&&this.fs.existsSync(t);if(!n&&!s)return{};{const e=n?a:t;try{return JSON.parse(this.fs.readFileSync(e))}catch(e){return{}}}}}static#t(e=this.dataFile){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const a=this.path.resolve(e),t=this.path.resolve(process.cwd(),e),n=this.fs.existsSync(a),s=!n&&this.fs.existsSync(t),r=JSON.stringify(this.data);n?this.fs.writeFileSync(a,r):s?this.fs.writeFileSync(t,r):this.fs.writeFileSync(a,r)}}}const n=(...e)=>console.log(e.join("\n"));var s={Switch:!0,Type:"Translate",Types:["Official","Translate"],Languages:["EN","ZH"],CacheSize:50},r={breakLine:{"text/xml":" ","application/xml":" ","text/vtt":"\n","application/vtt":"\n","text/json":"\n","application/json":"\n"}},i={Settings:s,Configs:r},o={Switch:!0,Type:"Official",Types:["Translate","External"],Languages:["AUTO","ZH"],AutoCC:!0,ShowOnly:!1},l={Languages:{BG:"bg-BG",CS:"cs",DA:"da-DK",DE:"de",EL:"el",EN:"en","EN-GB":"en-GB","EN-US":"en-US","EN-US SDH":"en-US SDH",ES:"es","ES-419":"es-419","ES-ES":"es-ES",ET:"et-EE",FI:"fi",FR:"fr",HU:"hu-HU",ID:"id",IS:"is-IS",IT:"it",JA:"ja",KO:"ko",LT:"lt-LT",LV:"lv-LV",NL:"nl-NL",NO:"nb-NO",PL:"pl-PL",PT:"pt","PT-PT":"pt-PT","PT-BR":"pt-BR",RO:"ro-RO",RU:"ru-RU",SK:"sk-SK",SL:"sl-SI",SV:"sv-SE",YUE:"yue","YUE-HK":"yue-HK",ZH:"zh","ZH-HANS":"zh-Hans","ZH-HK":"zh-Hant-HK","ZH-HANT":"zh-Hant","ZH-TW":"zh-TW"},translationLanguages:{DESKTOP:[{languageCode:"sq",languageName:{simpleText:"Shqip - 阿尔巴尼亚语"}},{languageCode:"ak",languageName:{simpleText:"Ákán - 阿肯语"}},{languageCode:"ar",languageName:{simpleText:"العربية - 阿拉伯语"}},{languageCode:"am",languageName:{simpleText:"አማርኛ - 阿姆哈拉语"}},{languageCode:"as",languageName:{simpleText:"অসমীয়া - 阿萨姆语"}},{languageCode:"az",languageName:{simpleText:"آذربايجان ديلی - 阿塞拜疆语"}},{languageCode:"ee",languageName:{simpleText:"Èʋegbe - 埃维语"}},{languageCode:"ay",languageName:{simpleText:"Aymar aru - 艾马拉语"}},{languageCode:"ga",languageName:{simpleText:"Gaeilge - 爱尔兰语"}},{languageCode:"et",languageName:{simpleText:"Eesti - 爱沙尼亚语"}},{languageCode:"or",languageName:{simpleText:"ଓଡ଼ିଆ - 奥里亚语"}},{languageCode:"om",languageName:{simpleText:"Afaan Oromoo - 奥罗莫语"}},{languageCode:"eu",languageName:{simpleText:"Euskara - 巴斯克语"}},{languageCode:"be",languageName:{simpleText:"Беларуская - 白俄罗斯语"}},{languageCode:"bg",languageName:{simpleText:"Български - 保加利亚语"}},{languageCode:"nso",languageName:{simpleText:"Sesotho sa Leboa - 北索托语"}},{languageCode:"is",languageName:{simpleText:"Íslenska - 冰岛语"}},{languageCode:"pl",languageName:{simpleText:"Polski - 波兰语"}},{languageCode:"bs",languageName:{simpleText:"Bosanski - 波斯尼亚语"}},{languageCode:"fa",languageName:{simpleText:"فارسی - 波斯语"}},{languageCode:"bho",languageName:{simpleText:"भोजपुरी - 博杰普尔语"}},{languageCode:"ts",languageName:{simpleText:"Xitsonga - 聪加语"}},{languageCode:"tt",languageName:{simpleText:"Татарча - 鞑靼语"}},{languageCode:"da",languageName:{simpleText:"Dansk - 丹麦语"}},{languageCode:"de",languageName:{simpleText:"Deutsch - 德语"}},{languageCode:"dv",languageName:{simpleText:"ދިވެހިބަސް - 迪维希语"}},{languageCode:"ru",languageName:{simpleText:"Русский - 俄语"}},{languageCode:"fr",languageName:{simpleText:"français - 法语"}},{languageCode:"sa",languageName:{simpleText:"संस्कृतम् - 梵语"}},{languageCode:"fil",languageName:{simpleText:"Filipino - 菲律宾语"}},{languageCode:"fi",languageName:{simpleText:"suomi - 芬兰语"}},{languageCode:"km",languageName:{simpleText:"ភាសាខ្មែរ - 高棉语"}},{languageCode:"ka",languageName:{simpleText:"ქართული - 格鲁吉亚语"}},{languageCode:"gu",languageName:{simpleText:"ગુજરાતી - 古吉拉特语"}},{languageCode:"gn",languageName:{simpleText:"Avañe'ẽ - 瓜拉尼语"}},{languageCode:"kk",languageName:{simpleText:"Қазақ тілі - 哈萨克语"}},{languageCode:"ht",languageName:{simpleText:"Kreyòl ayisyen - 海地克里奥尔语"}},{languageCode:"ko",languageName:{simpleText:"한국어 - 韩语"}},{languageCode:"ha",languageName:{simpleText:"هَوُسَ - 豪萨语"}},{languageCode:"nl",languageName:{simpleText:"Nederlands - 荷兰语"}},{languageCode:"gl",languageName:{simpleText:"Galego - 加利西亚语"}},{languageCode:"ca",languageName:{simpleText:"català - 加泰罗尼亚语"}},{languageCode:"cs",languageName:{simpleText:"čeština - 捷克语"}},{languageCode:"kn",languageName:{simpleText:"ಕನ್ನಡ - 卡纳达语"}},{languageCode:"ky",languageName:{simpleText:"кыргыз тили - 吉尔吉斯语"}},{languageCode:"xh",languageName:{simpleText:"isiXhosa - 科萨语"}},{languageCode:"co",languageName:{simpleText:"corsu - 科西嘉语"}},{languageCode:"hr",languageName:{simpleText:"hrvatski - 克罗地亚语"}},{languageCode:"qu",languageName:{simpleText:"Runa Simi - 克丘亚语"}},{languageCode:"ku",languageName:{simpleText:"Kurdî - 库尔德语"}},{languageCode:"la",languageName:{simpleText:"lingua latīna - 拉丁语"}},{languageCode:"lv",languageName:{simpleText:"latviešu valoda - 拉脱维亚语"}},{languageCode:"lo",languageName:{simpleText:"ພາສາລາວ - 老挝语"}},{languageCode:"lt",languageName:{simpleText:"lietuvių kalba - 立陶宛语"}},{languageCode:"ln",languageName:{simpleText:"lingála - 林加拉语"}},{languageCode:"lg",languageName:{simpleText:"Luganda - 卢干达语"}},{languageCode:"lb",languageName:{simpleText:"Lëtzebuergesch - 卢森堡语"}},{languageCode:"rw",languageName:{simpleText:"Kinyarwanda - 卢旺达语"}},{languageCode:"ro",languageName:{simpleText:"Română - 罗马尼亚语"}},{languageCode:"mt",languageName:{simpleText:"Malti - 马耳他语"}},{languageCode:"mr",languageName:{simpleText:"मराठी - 马拉地语"}},{languageCode:"mg",languageName:{simpleText:"Malagasy - 马拉加斯语"}},{languageCode:"ml",languageName:{simpleText:"മലയാളം - 马拉雅拉姆语"}},{languageCode:"ms",languageName:{simpleText:"bahasa Melayu - 马来语"}},{languageCode:"mk",languageName:{simpleText:"македонски јазик - 马其顿语"}},{languageCode:"mi",languageName:{simpleText:"te reo Māori - 毛利语"}},{languageCode:"mn",languageName:{simpleText:"Монгол хэл - 蒙古语"}},{languageCode:"bn",languageName:{simpleText:"বাংলা - 孟加拉语"}},{languageCode:"my",languageName:{simpleText:"ဗမာစာ - 缅甸语"}},{languageCode:"hmn",languageName:{simpleText:"Hmoob - 苗语"}},{languageCode:"af",languageName:{simpleText:"Afrikaans - 南非荷兰语"}},{languageCode:"st",languageName:{simpleText:"Sesotho - 南索托语"}},{languageCode:"ne",languageName:{simpleText:"नेपाली - 尼泊尔语"}},{languageCode:"no",languageName:{simpleText:"Norsk - 挪威语"}},{languageCode:"pa",languageName:{simpleText:"ਪੰਜਾਬੀ - 旁遮普语"}},{languageCode:"pt",languageName:{simpleText:"Português - 葡萄牙语"}},{languageCode:"ps",languageName:{simpleText:"پښتو - 普什图语"}},{languageCode:"ny",languageName:{simpleText:"chiCheŵa - 齐切瓦语"}},{languageCode:"ja",languageName:{simpleText:"日本語 - 日语"}},{languageCode:"sv",languageName:{simpleText:"Svenska - 瑞典语"}},{languageCode:"sm",languageName:{simpleText:"Gagana fa'a Samoa - 萨摩亚语"}},{languageCode:"sr",languageName:{simpleText:"Српски језик - 塞尔维亚语"}},{languageCode:"si",languageName:{simpleText:"සිංහල - 僧伽罗语"}},{languageCode:"sn",languageName:{simpleText:"ChiShona - 绍纳语"}},{languageCode:"eo",languageName:{simpleText:"Esperanto - 世界语"}},{languageCode:"sk",languageName:{simpleText:"slovenčina - 斯洛伐克语"}},{languageCode:"sl",languageName:{simpleText:"slovenščina - 斯洛文尼亚语"}},{languageCode:"sw",languageName:{simpleText:"Kiswahili - 斯瓦希里语"}},{languageCode:"gd",languageName:{simpleText:"Gàidhlig - 苏格兰盖尔语"}},{languageCode:"ceb",languageName:{simpleText:"Binisaya - 宿务语"}},{languageCode:"so",languageName:{simpleText:"Soomaaliga - 索马里语"}},{languageCode:"tg",languageName:{simpleText:"тоҷикӣ - 塔吉克语"}},{languageCode:"te",languageName:{simpleText:"తెలుగు - 泰卢固语"}},{languageCode:"ta",languageName:{simpleText:"தமிழ் - 泰米尔语"}},{languageCode:"th",languageName:{simpleText:"ไทย - 泰语"}},{languageCode:"ti",languageName:{simpleText:"ትግርኛ - 提格利尼亚语"}},{languageCode:"tr",languageName:{simpleText:"Türkçe - 土耳其语"}},{languageCode:"tk",languageName:{simpleText:"Türkmen - 土库曼语"}},{languageCode:"cy",languageName:{simpleText:"Cymraeg - 威尔士语"}},{languageCode:"ug",languageName:{simpleText:"ئۇيغۇرچە - 维吾尔语"}},{languageCode:"und",languageName:{simpleText:"Unknown - 未知语言"}},{languageCode:"ur",languageName:{simpleText:"اردو - 乌尔都语"}},{languageCode:"uk",languageName:{simpleText:"українська - 乌克兰语"}},{languageCode:"uz",languageName:{simpleText:"O'zbek - 乌兹别克语"}},{languageCode:"es",languageName:{simpleText:"Español - 西班牙语"}},{languageCode:"fy",languageName:{simpleText:"Frysk - 西弗里西亚语"}},{languageCode:"iw",languageName:{simpleText:"עברית - 希伯来语"}},{languageCode:"el",languageName:{simpleText:"Ελληνικά - 希腊语"}},{languageCode:"haw",languageName:{simpleText:"ʻŌlelo Hawaiʻi - 夏威夷语"}},{languageCode:"sd",languageName:{simpleText:"سنڌي - 信德语"}},{languageCode:"hu",languageName:{simpleText:"magyar - 匈牙利语"}},{languageCode:"su",languageName:{simpleText:"Basa Sunda - 巽他语"}},{languageCode:"hy",languageName:{simpleText:"հայերեն - 亚美尼亚语"}},{languageCode:"ig",languageName:{simpleText:"Igbo - 伊博语"}},{languageCode:"it",languageName:{simpleText:"Italiano - 意大利语"}},{languageCode:"yi",languageName:{simpleText:"ייִדיש - 意第绪语"}},{languageCode:"hi",languageName:{simpleText:"हिन्दी - 印地语"}},{languageCode:"id",languageName:{simpleText:"Bahasa Indonesia - 印度尼西亚语"}},{languageCode:"en",languageName:{simpleText:"English - 英语"}},{languageCode:"yo",languageName:{simpleText:"Yorùbá - 约鲁巴语"}},{languageCode:"vi",languageName:{simpleText:"Tiếng Việt - 越南语"}},{languageCode:"jv",languageName:{simpleText:"Basa Jawa - 爪哇语"}},{languageCode:"zh-Hant",languageName:{simpleText:"中文(繁體)- 中文(繁体)"}},{languageCode:"zh-Hans",languageName:{simpleText:"中文(简体)"}},{languageCode:"zu",languageName:{simpleText:"isiZulu - 祖鲁语"}},{languageCode:"kri",languageName:{simpleText:"Krìì - 克里语"}}],MOBILE:[{languageCode:"sq",languageName:{runs:[{text:"Shqip - 阿尔巴尼亚语"}]}},{languageCode:"ak",languageName:{runs:[{text:"Ákán - 阿肯语"}]}},{languageCode:"ar",languageName:{runs:[{text:"العربية - 阿拉伯语"}]}},{languageCode:"am",languageName:{runs:[{text:"አማርኛ - 阿姆哈拉语"}]}},{languageCode:"as",languageName:{runs:[{text:"অসমীয়া - 阿萨姆语"}]}},{languageCode:"az",languageName:{runs:[{text:"Azərbaycanca - 阿塞拜疆语"}]}},{languageCode:"ee",languageName:{runs:[{text:"Eʋegbe - 埃维语"}]}},{languageCode:"ay",languageName:{runs:[{text:"Aymar - 艾马拉语"}]}},{languageCode:"ga",languageName:{runs:[{text:"Gaeilge - 爱尔兰语"}]}},{languageCode:"et",languageName:{runs:[{text:"Eesti - 爱沙尼亚语"}]}},{languageCode:"or",languageName:{runs:[{text:"ଓଡ଼ିଆ - 奥里亚语"}]}},{languageCode:"om",languageName:{runs:[{text:"Oromoo - 奥罗莫语"}]}},{languageCode:"eu",languageName:{runs:[{text:"Euskara - 巴斯克语"}]}},{languageCode:"be",languageName:{runs:[{text:"Беларуская - 白俄罗斯语"}]}},{languageCode:"bg",languageName:{runs:[{text:"Български - 保加利亚语"}]}},{languageCode:"nso",languageName:{runs:[{text:"Sesotho sa Leboa - 北索托语"}]}},{languageCode:"is",languageName:{runs:[{text:"Íslenska - 冰岛语"}]}},{languageCode:"pl",languageName:{runs:[{text:"Polski - 波兰语"}]}},{languageCode:"bs",languageName:{runs:[{text:"Bosanski - 波斯尼亚语"}]}},{languageCode:"fa",languageName:{runs:[{text:"فارسی - 波斯语"}]}},{languageCode:"bho",languageName:{runs:[{text:"भोजपुरी - 博杰普尔语"}]}},{languageCode:"ts",languageName:{runs:[{text:"Xitsonga - 聪加语"}]}},{languageCode:"tt",languageName:{runs:[{text:"Татарча - 鞑靼语"}]}},{languageCode:"da",languageName:{runs:[{text:"Dansk - 丹麦语"}]}},{languageCode:"de",languageName:{runs:[{text:"Deutsch - 德语"}]}},{languageCode:"dv",languageName:{runs:[{text:"ދިވެހިބަސް - 迪维希语"}]}},{languageCode:"ru",languageName:{runs:[{text:"Русский - 俄语"}]}},{languageCode:"fr",languageName:{runs:[{text:"Français - 法语"}]}},{languageCode:"sa",languageName:{runs:[{text:"संस्कृतम् - 梵语"}]}},{languageCode:"fil",languageName:{runs:[{text:"Filipino - 菲律宾语"}]}},{languageCode:"fi",languageName:{runs:[{text:"Suomi - 芬兰语"}]}},{languageCode:"km",languageName:{runs:[{text:"ភាសាខ្មែរ - 高棉语"}]}},{languageCode:"ka",languageName:{runs:[{text:"ქართული - 格鲁吉亚语"}]}},{languageCode:"gu",languageName:{runs:[{text:"ગુજરાતી - 古吉拉特语"}]}},{languageCode:"gn",languageName:{runs:[{text:"Avañe'ẽ - 瓜拉尼语"}]}},{languageCode:"kk",languageName:{runs:[{text:"Қазақ тілі - 哈萨克语"}]}},{languageCode:"ht",languageName:{runs:[{text:"海地克里奥尔语"}]}},{languageCode:"ko",languageName:{runs:[{text:"한국말 - 韩语"}]}},{languageCode:"ha",languageName:{runs:[{text:"هَوُسَ - 豪萨语"}]}},{languageCode:"nl",languageName:{runs:[{text:"Nederlands - 荷兰语"}]}},{languageCode:"gl",languageName:{runs:[{text:"Galego - 加利西亚语"}]}},{languageCode:"ca",languageName:{runs:[{text:"Català - 加泰罗尼亚语"}]}},{languageCode:"cs",languageName:{runs:[{text:"Čeština - 捷克语"}]}},{languageCode:"kn",languageName:{runs:[{text:"ಕನ್ನಡ - 卡纳达语"}]}},{languageCode:"ky",languageName:{runs:[{text:"Кыргызча - 吉尔吉斯语"}]}},{languageCode:"xh",languageName:{runs:[{text:"isiXhosa - 科萨语"}]}},{languageCode:"co",languageName:{runs:[{text:"Corsu - 科西嘉语"}]}},{languageCode:"hr",languageName:{runs:[{text:"Hrvatski - 克罗地亚语"}]}},{languageCode:"qu",languageName:{runs:[{text:"Runa Simi - 克丘亚语"}]}},{languageCode:"ku",languageName:{runs:[{text:"Kurdî - 库尔德语"}]}},{languageCode:"la",languageName:{runs:[{text:"lingua latīna - 拉丁语"}]}},{languageCode:"lv",languageName:{runs:[{text:"Latviešu - 拉脱维亚语"}]}},{languageCode:"lo",languageName:{runs:[{text:"ລາວ - 老挝语"}]}},{languageCode:"lt",languageName:{runs:[{text:"Lietuvių - 立陶宛语"}]}},{languageCode:"ln",languageName:{runs:[{text:"Lingála - 林加拉语"}]}},{languageCode:"lg",languageName:{runs:[{text:"Luganda - 卢干达语"}]}},{languageCode:"lb",languageName:{runs:[{text:"Lëtzebuergesch - 卢森堡语"}]}},{languageCode:"rw",languageName:{runs:[{text:"Kinyarwanda - 卢旺达语"}]}},{languageCode:"ro",languageName:{runs:[{text:"Română - 罗马尼亚语"}]}},{languageCode:"mt",languageName:{runs:[{text:"Malti - 马耳他语"}]}},{languageCode:"mr",languageName:{runs:[{text:"मराठी - 马拉地语"}]}},{languageCode:"mg",languageName:{runs:[{text:"Malagasy - 马拉加斯语"}]}},{languageCode:"ml",languageName:{runs:[{text:"മലയാളം - 马拉雅拉姆语"}]}},{languageCode:"ms",languageName:{runs:[{text:"Bahasa Melayu - 马来语"}]}},{languageCode:"mk",languageName:{runs:[{text:"македонски - 马其顿语"}]}},{languageCode:"mi",languageName:{runs:[{text:"Māori - 毛利语"}]}},{languageCode:"mn",languageName:{runs:[{text:"Монгол - 蒙古语"}]}},{languageCode:"bn",languageName:{runs:[{text:"বাংলা - 孟加拉语"}]}},{languageCode:"my",languageName:{runs:[{text:"ဗမာစာ - 缅甸语"}]}},{languageCode:"hmn",languageName:{runs:[{text:"Hmoob - 苗语"}]}},{languageCode:"af",languageName:{runs:[{text:"Afrikaans - 南非荷兰语"}]}},{languageCode:"st",languageName:{runs:[{text:"Sesotho - 南索托语"}]}},{languageCode:"ne",languageName:{runs:[{text:"नेपाली - 尼泊尔语"}]}},{languageCode:"no",languageName:{runs:[{text:"Norsk - 挪威语"}]}},{languageCode:"pa",languageName:{runs:[{text:"ਪੰਜਾਬੀ - 旁遮普语"}]}},{languageCode:"pt",languageName:{runs:[{text:"Português - 葡萄牙语"}]}},{languageCode:"ps",languageName:{runs:[{text:"پښتو - 普什图语"}]}},{languageCode:"ny",languageName:{runs:[{text:"chiCheŵa - 齐切瓦语"}]}},{languageCode:"ja",languageName:{runs:[{text:"日本語 - 日语"}]}},{languageCode:"sv",languageName:{runs:[{text:"Svenska - 瑞典语"}]}},{languageCode:"sm",languageName:{runs:[{text:"Gagana Samoa - 萨摩亚语"}]}},{languageCode:"sr",languageName:{runs:[{text:"Српски језик - 塞尔维亚语"}]}},{languageCode:"si",languageName:{runs:[{text:"සිංහල - 僧伽罗语"}]}},{languageCode:"sn",languageName:{runs:[{text:"ChiShona - 绍纳语"}]}},{languageCode:"eo",languageName:{runs:[{text:"Esperanto - 世界语"}]}},{languageCode:"sk",languageName:{runs:[{text:"Slovenčina - 斯洛伐克语"}]}},{languageCode:"sl",languageName:{runs:[{text:"Slovenščina - 斯洛文尼亚语"}]}},{languageCode:"sw",languageName:{runs:[{text:"Kiswahili - 斯瓦希里语"}]}},{languageCode:"gd",languageName:{runs:[{text:"Gàidhlig - 苏格兰盖尔语"}]}},{languageCode:"ceb",languageName:{runs:[{text:"Cebuano - 宿务语"}]}},{languageCode:"so",languageName:{runs:[{text:"Soomaaliga - 索马里语"}]}},{languageCode:"tg",languageName:{runs:[{text:"тоҷикӣ - 塔吉克语"}]}},{languageCode:"te",languageName:{runs:[{text:"తెలుగు - 泰卢固语"}]}},{languageCode:"ta",languageName:{runs:[{text:"தமிழ் - 泰米尔语"}]}},{languageCode:"th",languageName:{runs:[{text:"ไทย - 泰语"}]}},{languageCode:"ti",languageName:{runs:[{text:"ትግርኛ - 提格利尼亚语"}]}},{languageCode:"tr",languageName:{runs:[{text:"Türkçe - 土耳其语"}]}},{languageCode:"tk",languageName:{runs:[{text:"Türkmen - 土库曼语"}]}},{languageCode:"cy",languageName:{runs:[{text:"Cymraeg - 威尔士语"}]}},{languageCode:"ug",languageName:{runs:[{text:"ئۇيغۇرچە - 维吾尔语"}]}},{languageCode:"und",languageName:{runs:[{text:"Unknown - 未知语言"}]}},{languageCode:"ur",languageName:{runs:[{text:"اردو - 乌尔都语"}]}},{languageCode:"uk",languageName:{runs:[{text:"Українська - 乌克兰语"}]}},{languageCode:"uz",languageName:{runs:[{text:"O‘zbek - 乌兹别克语"}]}},{languageCode:"es",languageName:{runs:[{text:"Español - 西班牙语"}]}},{languageCode:"fy",languageName:{runs:[{text:"Frysk - 西弗里西亚语"}]}},{languageCode:"iw",languageName:{runs:[{text:"עברית - 希伯来语"}]}},{languageCode:"el",languageName:{runs:[{text:"Ελληνικά - 希腊语"}]}},{languageCode:"haw",languageName:{runs:[{text:"ʻŌlelo Hawaiʻi - 夏威夷语"}]}},{languageCode:"sd",languageName:{runs:[{text:"سنڌي - 信德语"}]}},{languageCode:"hu",languageName:{runs:[{text:"Magyar - 匈牙利语"}]}},{languageCode:"su",languageName:{runs:[{text:"Basa Sunda - 巽他语"}]}},{languageCode:"hy",languageName:{runs:[{text:"Հայերեն - 亚美尼亚语"}]}},{languageCode:"ig",languageName:{runs:[{text:"Igbo - 伊博语"}]}},{languageCode:"it",languageName:{runs:[{text:"Italiano - 意大利语"}]}},{languageCode:"yi",languageName:{runs:[{text:"ייִדיש - 意第绪语"}]}},{languageCode:"hi",languageName:{runs:[{text:"हिन्दी - 印地语"}]}},{languageCode:"id",languageName:{runs:[{text:"Bahasa Indonesia - 印度尼西亚语"}]}},{languageCode:"en",languageName:{runs:[{text:"English - 英语"}]}},{languageCode:"yo",languageName:{runs:[{text:"Yorùbá - 约鲁巴语"}]}},{languageCode:"vi",languageName:{runs:[{text:"Tiếng Việt - 越南语"}]}},{languageCode:"jv",languageName:{runs:[{text:"Basa Jawa - 爪哇语"}]}},{languageCode:"zh-Hant",languageName:{runs:[{text:"中文(繁體) - 中文(繁体)"}]}},{languageCode:"zh-Hans",languageName:{runs:[{text:"中文(简体)"}]}},{languageCode:"zu",languageName:{runs:[{text:"isiZulu - 祖鲁语"}]}},{languageCode:"kri",languageName:{runs:[{text:"Krìì - 克里语"}]}}]}},u={Settings:o,Configs:l},g=Database={Default:Object.freeze({__proto__:null,Configs:r,Settings:s,default:i}),YouTube:Object.freeze({__proto__:null,Configs:l,Settings:o,default:u})};function c(e,s,r){n("☑️ Set Environment Variables","");let{Settings:i,Caches:o,Configs:l}=function(e,n,s){let r=t.getItem(e,s),i={};switch(typeof $argument){case"string":let e=Object.fromEntries($argument.split("&").map((e=>e.split("=").map((e=>e.replace(/\"/g,""))))));for(let t in e)a.set(i,t,e[t]);break;case"object":for(let e in $argument)a.set(i,e,$argument[e])}const o={Settings:s?.Default?.Settings||{},Configs:s?.Default?.Configs||{},Caches:{}};Array.isArray(n)||(n=[n]);for(let e of n)o.Settings={...o.Settings,...s?.[e]?.Settings,...i,...r?.[e]?.Settings},o.Configs={...o.Configs,...s?.[e]?.Configs},r?.[e]?.Caches&&"string"==typeof r?.[e]?.Caches&&(r[e].Caches=JSON.parse(r?.[e]?.Caches)),o.Caches={...o.Caches,...r?.[e]?.Caches};return function e(a,t){for(var n in a){var s=a[n];a[n]="object"==typeof s&&null!==s?e(s,t):t(n,s)}return a}(o.Settings,((e,a)=>("true"===a||"false"===a?a=JSON.parse(a):"string"==typeof a&&(a=a.includes(",")?a.split(",").map((e=>l(e))):l(a)),a))),o;function l(e){return e&&!isNaN(e)&&(e=parseInt(e,10)),e}}(e,s,r);return Array.isArray(i?.Types)||(i.Types=i.Types?[i.Types]:[]),n(`✅ Set Environment Variables, Settings: ${typeof i}, Settings内容: ${JSON.stringify(i)}`,""),("object"!=typeof o?.Playlists||Array.isArray(o?.Playlists))&&(o.Playlists={}),o.Playlists.Master=new Map(JSON.parse(o?.Playlists?.Master||"[]")),o.Playlists.Subtitle=new Map(JSON.parse(o?.Playlists?.Subtitle||"[]")),"object"!=typeof o?.Subtitles&&(o.Subtitles=new Map(JSON.parse(o?.Subtitles||"[]"))),("object"!=typeof o?.Metadatas||Array.isArray(o?.Metadatas))&&(o.Metadatas={}),"object"!=typeof o?.Metadatas?.Tracks&&(o.Metadatas.Tracks=new Map(JSON.parse(o?.Metadatas?.Tracks||"[]"))),{Settings:i,Caches:o,Configs:l}}function m(e){let a=typeof e;if("object"==a){if(Array.isArray(e))return"array";if(null===e)return"null"}return a}let d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),f=[];for(let e=0;e>4,!(128&t))return this.assertBounds(),[e,a];for(let t=3;t<=31;t+=7){let n=this.buf[this.pos++];if(a|=(127&n)<>>n,r=!(s>>>7==0&&0==a),i=255&(r?128|s:s);if(t.push(i),!r)return}const n=e>>>28&15|(7&a)<<4,s=!!(a>>3);if(t.push(255&(s?128|n:n)),s){for(let e=3;e<31;e+=7){const n=a>>>e,s=!(n>>>7==0),r=255&(s?128|n:n);if(t.push(r),!s)return}t.push(a>>>31&1)}}f["-".charCodeAt(0)]=d.indexOf("+"),f["_".charCodeAt(0)]=d.indexOf("/"),function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=(t,n,s,r,i)=>{(a(n)?n[e.symbol]:n[e.symbol]=[]).push({no:s,wireType:r,data:i})},e.onWrite=(a,t,n)=>{for(let{no:a,wireType:s,data:r}of e.list(t))n.tag(a,s).raw(r)},e.list=(t,n)=>{if(a(t)){let a=t[e.symbol];return n?a.filter((e=>e.no==n)):a}return[]},e.last=(a,t)=>e.list(a,t).slice(-1)[0];const a=a=>a&&Array.isArray(a[e.symbol])}(h||(h={})),function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(p||(p={}));const b=4294967296;function y(e){let a="-"==e[0];a&&(e=e.slice(1));const t=1e6;let n=0,s=0;function r(a,r){const i=Number(e.slice(a,r));s*=t,n=n*t+i,n>=b&&(s+=n/b|0,n%=b)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),[a,n,s]}function C(e,a){if(a>>>0<=2097151)return""+(b*a+(e>>>0));let t=(e>>>24|a<<8)>>>0&16777215,n=a>>16&65535,s=(16777215&e)+6777216*t+6710656*n,r=t+8147497*n,i=2*n,o=1e7;function l(e,a){let t=e?String(e):"";return a?"0000000".slice(t.length)+t:t}return s>=o&&(r+=Math.floor(s/o),s%=o),r>=o&&(i+=Math.floor(r/o),r%=o),l(i,0)+l(r,i)+l(s,1)}function x(e,a){if(e>=0){for(;e>127;)a.push(127&e|128),e>>>=7;a.push(e)}else{for(let t=0;t<9;t++)a.push(127&e|128),e>>=7;a.push(1)}}function k(){let e=this.buf[this.pos++],a=127&e;if(!(128&e))return this.assertBounds(),a;if(e=this.buf[this.pos++],a|=(127&e)<<7,!(128&e))return this.assertBounds(),a;if(e=this.buf[this.pos++],a|=(127&e)<<14,!(128&e))return this.assertBounds(),a;if(e=this.buf[this.pos++],a|=(127&e)<<21,!(128&e))return this.assertBounds(),a;e=this.buf[this.pos++],a|=(15&e)<<28;for(let a=5;128&e&&a<10;a++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),a>>>0}let w;function S(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}!function(){const e=new DataView(new ArrayBuffer(8)),a=void 0!==globalThis.BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64;w=a?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}();const I=/^-?[0-9]+$/,v=4294967296,E=2147483648;class O{constructor(e,a){this.lo=0|e,this.hi=0|a}isZero(){return 0==this.lo&&0==this.hi}toNumber(){let e=this.hi*v+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}}class B extends O{static from(e){if(w)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=w.C(e);case"number":if(0===e)return this.ZERO;e=w.C(e);case"bigint":if(!e)return this.ZERO;if(ew.UMAX)throw new Error("ulong too large");return w.V.setBigUint64(0,e,!0),new B(w.V.getInt32(0,!0),w.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;if(e=e.trim(),!I.test(e))throw new Error("string is no integer");let[a,t,n]=y(e);if(a)throw new Error("signed value for ulong");return new B(t,n);case"number":if(0==e)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");if(e<0)throw new Error("signed value for ulong");return new B(e,e/v)}throw new Error("unknown value "+typeof e)}toString(){return w?this.toBigInt().toString():C(this.lo,this.hi)}toBigInt(){return S(w),w.V.setInt32(0,this.lo,!0),w.V.setInt32(4,this.hi,!0),w.V.getBigUint64(0,!0)}}B.ZERO=new B(0,0);class A extends O{static from(e){if(w)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=w.C(e);case"number":if(0===e)return this.ZERO;e=w.C(e);case"bigint":if(!e)return this.ZERO;if(ew.MAX)throw new Error("signed long too large");return w.V.setBigInt64(0,e,!0),new A(w.V.getInt32(0,!0),w.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;if(e=e.trim(),!I.test(e))throw new Error("string is no integer");let[a,t,n]=y(e);if(a){if(n>E||n==E&&0!=t)throw new Error("signed long too small")}else if(n>=E)throw new Error("signed long too large");let s=new A(t,n);return a?s.negate():s;case"number":if(0==e)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");return e>0?new A(e,e/v):new A(-e,-e/v).negate()}throw new Error("unknown value "+typeof e)}isNegative(){return!!(this.hi&E)}negate(){let e=~this.hi,a=this.lo;return a?a=1+~a:e+=1,new A(a,e)}toString(){if(w)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return"-"+C(e.lo,e.hi)}return C(this.lo,this.hi)}toBigInt(){return S(w),w.V.setInt32(0,this.lo,!0),w.V.setInt32(4,this.hi,!0),w.V.getBigInt64(0,!0)}}A.ZERO=new A(0,0);const L={readUnknownField:!0,readerFactory:e=>new R(e)};class R{constructor(e,a){this.varint64=N,this.uint32=k,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=null!=a?a:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),a=e>>>3,t=7&e;if(a<=0||t<0||t>5)throw new Error("illegal tag: field no "+a+" wire type "+t);return[a,t]}skip(e){let a=this.pos;switch(e){case p.Varint:for(;128&this.buf[this.pos++];);break;case p.Bit64:this.pos+=4;case p.Bit32:this.pos+=4;break;case p.LengthDelimited:let a=this.uint32();this.pos+=a;break;case p.StartGroup:let t;for(;(t=this.tag()[1])!==p.EndGroup;)this.skip(t);break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(a,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return new A(...this.varint64())}uint64(){return new B(...this.varint64())}sint64(){let[e,a]=this.varint64(),t=-(1&e);return e=(e>>>1|(1&a)<<31)^t,a=a>>>1^t,new A(e,a)}bool(){let[e,a]=this.varint64();return 0!==e||0!==a}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new B(this.sfixed32(),this.sfixed32())}sfixed64(){return new A(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),a=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(a,a+e)}string(){return this.textDecoder.decode(this.bytes())}}function D(e,a){if(!e)throw new Error(a)}function U(e){if("number"!=typeof e)throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw new Error("invalid int 32: "+e)}function F(e){if("number"!=typeof e)throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw new Error("invalid uint 32: "+e)}function j(e){if("number"!=typeof e)throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw new Error("invalid float 32: "+e)}const V={writeUnknownFields:!0,writerFactory:()=>new $};class ${constructor(e){this.stack=[],this.textEncoder=null!=e?e:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let a=0;a>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(F(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return U(e),x(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let a=this.textEncoder.encode(e);return this.uint32(a.byteLength),this.raw(a)}float(e){j(e);let a=new Uint8Array(4);return new DataView(a.buffer).setFloat32(0,e,!0),this.raw(a)}double(e){let a=new Uint8Array(8);return new DataView(a.buffer).setFloat64(0,e,!0),this.raw(a)}fixed32(e){F(e);let a=new Uint8Array(4);return new DataView(a.buffer).setUint32(0,e,!0),this.raw(a)}sfixed32(e){U(e);let a=new Uint8Array(4);return new DataView(a.buffer).setInt32(0,e,!0),this.raw(a)}sint32(e){return U(e),x(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let a=new Uint8Array(8),t=new DataView(a.buffer),n=A.from(e);return t.setInt32(0,n.lo,!0),t.setInt32(4,n.hi,!0),this.raw(a)}fixed64(e){let a=new Uint8Array(8),t=new DataView(a.buffer),n=B.from(e);return t.setInt32(0,n.lo,!0),t.setInt32(4,n.hi,!0),this.raw(a)}int64(e){let a=A.from(e);return T(a.lo,a.hi,this.buf),this}sint64(e){let a=A.from(e),t=a.hi>>31;return T(a.lo<<1^t,(a.hi<<1|a.lo>>>31)^t,this.buf),this}uint64(e){let a=B.from(e);return T(a.lo,a.hi,this.buf),this}}const K={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},P={ignoreUnknownFields:!1};const M=Symbol.for("protobuf-ts/message-type");function X(e){let a=!1;const t=[];for(let n=0;n!n.includes(e))))return!1;if(!t&&n.some((e=>!s.known.includes(e))))return!1;if(a<1)return!0;for(const n of s.oneofs){const s=e[n];if(!z(s))return!1;if(void 0===s.oneofKind)continue;const r=this.fields.find((e=>e.localName===s.oneofKind));if(!r)return!1;if(!this.field(s[s.oneofKind],r,t,a))return!1}for(const n of this.fields)if(void 0===n.oneof&&!this.field(e[n.localName],n,t,a))return!1;return!0}field(e,a,t,n){let s=a.repeat;switch(a.kind){case"scalar":return void 0===e?a.opt:s?this.scalars(e,a.T,n,a.L):this.scalar(e,a.T,a.L);case"enum":return void 0===e?a.opt:s?this.scalars(e,J.INT32,n):this.scalar(e,J.INT32);case"message":return void 0===e||(s?this.messages(e,a.T(),t,n):this.message(e,a.T(),t,n));case"map":if("object"!=typeof e||null===e)return!1;if(n<2)return!0;if(!this.mapKeys(e,a.K,n))return!1;switch(a.V.kind){case"scalar":return this.scalars(Object.values(e),a.V.T,n,a.V.L);case"enum":return this.scalars(Object.values(e),J.INT32,n);case"message":return this.messages(Object.values(e),a.V.T(),t,n)}}return!0}message(e,a,t,n){return t?a.isAssignable(e,n):a.is(e,n)}messages(e,a,t,n){if(!Array.isArray(e))return!1;if(n<2)return!0;if(t){for(let t=0;tparseInt(e))),a,t);case J.BOOL:return this.scalars(n.slice(0,t).map((e=>"true"==e||"false"!=e&&e)),a,t);default:return this.scalars(n,a,t,G.STRING)}}}function q(e,a){switch(a){case G.BIGINT:return e.toBigInt();case G.NUMBER:return e.toNumber();default:return e.toString()}}class W{constructor(e){this.info=e}prepare(){var e;if(void 0===this.fMap){this.fMap={};const a=null!==(e=this.info.fields)&&void 0!==e?e:[];for(const e of a)this.fMap[e.name]=e,this.fMap[e.jsonName]=e,this.fMap[e.localName]=e}}assert(e,a,t){if(!e){let e=m(t);throw"number"!=e&&"boolean"!=e||(e=t.toString()),new Error(`Cannot parse JSON ${e} for ${this.info.typeName}#${a}`)}}read(e,a,t){this.prepare();const n=[];for(const[r,i]of Object.entries(e)){const e=this.fMap[r];if(!e){if(!t.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${r}`);continue}const o=e.localName;let l;if(e.oneof){if(null===i&&("enum"!==e.kind||"google.protobuf.NullValue"!==e.T()[0]))continue;if(n.includes(e.oneof))throw new Error(`Multiple members of the oneof group "${e.oneof}" of ${this.info.typeName} are present in JSON.`);n.push(e.oneof),l=a[e.oneof]={oneofKind:o}}else l=a;if("map"==e.kind){if(null===i)continue;this.assert(null!==(s=i)&&"object"==typeof s&&!Array.isArray(s),e.name,i);const a=l[o];for(const[n,s]of Object.entries(i)){let r;switch(this.assert(null!==s,e.name+" map value",null),e.V.kind){case"message":r=e.V.T().internalJsonRead(s,t);break;case"enum":if(r=this.enum(e.V.T(),s,e.name,t.ignoreUnknownFields),!1===r)continue;break;case"scalar":r=this.scalar(s,e.V.T,e.V.L,e.name)}this.assert(void 0!==r,e.name+" map value",s);let i=n;e.K==J.BOOL&&(i="true"==i||"false"!=i&&i),i=this.scalar(i,e.K,G.STRING,e.name).toString(),a[i]=r}}else if(e.repeat){if(null===i)continue;this.assert(Array.isArray(i),e.name,i);const a=l[o];for(const n of i){let s;switch(this.assert(null!==n,e.name,null),e.kind){case"message":s=e.T().internalJsonRead(n,t);break;case"enum":if(s=this.enum(e.T(),n,e.name,t.ignoreUnknownFields),!1===s)continue;break;case"scalar":s=this.scalar(n,e.T,e.L,e.name)}this.assert(void 0!==s,e.name,i),a.push(s)}}else switch(e.kind){case"message":if(null===i&&"google.protobuf.Value"!=e.T().typeName){this.assert(void 0===e.oneof,e.name+" (oneof member)",null);continue}l[o]=e.T().internalJsonRead(i,t,l[o]);break;case"enum":let a=this.enum(e.T(),i,e.name,t.ignoreUnknownFields);if(!1===a)continue;l[o]=a;break;case"scalar":l[o]=this.scalar(i,e.T,e.L,e.name)}}var s}enum(e,a,t,n){if("google.protobuf.NullValue"==e[0]&&D(null===a||"NULL_VALUE"===a,`Unable to parse field ${this.info.typeName}#${t}, enum ${e[0]} only accepts null.`),null===a)return 0;switch(typeof a){case"number":return D(Number.isInteger(a),`Unable to parse field ${this.info.typeName}#${t}, enum can only be integral number, got ${a}.`),a;case"string":let s=a;e[2]&&a.substring(0,e[2].length)===e[2]&&(s=a.substring(e[2].length));let r=e[1][s];return(void 0!==r||!n)&&(D("number"==typeof r,`Unable to parse field ${this.info.typeName}#${t}, enum ${e[0]} has no value for "${a}".`),r)}D(!1,`Unable to parse field ${this.info.typeName}#${t}, cannot parse enum value from ${typeof a}".`)}scalar(e,a,t,n){let s;try{switch(a){case J.DOUBLE:case J.FLOAT:if(null===e)return 0;if("NaN"===e)return Number.NaN;if("Infinity"===e)return Number.POSITIVE_INFINITY;if("-Infinity"===e)return Number.NEGATIVE_INFINITY;if(""===e){s="empty string";break}if("string"==typeof e&&e.trim().length!==e.length){s="extra whitespace";break}if("string"!=typeof e&&"number"!=typeof e)break;let n=Number(e);if(Number.isNaN(n)){s="not a number";break}if(!Number.isFinite(n)){s="too large or small";break}return a==J.FLOAT&&j(n),n;case J.INT32:case J.FIXED32:case J.SFIXED32:case J.SINT32:case J.UINT32:if(null===e)return 0;let r;if("number"==typeof e?r=e:""===e?s="empty string":"string"==typeof e&&(e.trim().length!==e.length?s="extra whitespace":r=Number(e)),void 0===r)break;return a==J.UINT32?F(r):U(r),r;case J.INT64:case J.SFIXED64:case J.SINT64:if(null===e)return q(A.ZERO,t);if("number"!=typeof e&&"string"!=typeof e)break;return q(A.from(e),t);case J.FIXED64:case J.UINT64:if(null===e)return q(B.ZERO,t);if("number"!=typeof e&&"string"!=typeof e)break;return q(B.from(e),t);case J.BOOL:if(null===e)return!1;if("boolean"!=typeof e)break;return e;case J.STRING:if(null===e)return"";if("string"!=typeof e){s="extra whitespace";break}try{encodeURIComponent(e)}catch(s){s="invalid UTF8";break}return e;case J.BYTES:if(null===e||""===e)return new Uint8Array(0);if("string"!=typeof e)break;return function(e){let a=3*e.length/4;"="==e[e.length-2]?a-=2:"="==e[e.length-1]&&(a-=1);let t,n=new Uint8Array(a),s=0,r=0,i=0;for(let a=0;a>4,i=t,r=2;break;case 2:n[s++]=(15&i)<<4|(60&t)>>2,i=t,r=3;break;case 3:n[s++]=(3&i)<<6|t,r=0}}if(1==r)throw Error("invalid base64 string.");return n.subarray(0,s)}(e)}}catch(e){s=e.message}this.assert(!1,n+(s?" - "+s:""),e)}}class _{constructor(e){var a;this.fields=null!==(a=e.fields)&&void 0!==a?a:[]}write(e,a){const t={},n=e;for(const e of this.fields){if(!e.oneof){let s=this.field(e,n[e.localName],a);void 0!==s&&(t[a.useProtoFieldName?e.name:e.jsonName]=s);continue}const s=n[e.oneof];if(s.oneofKind!==e.localName)continue;const r="scalar"==e.kind||"enum"==e.kind?Object.assign(Object.assign({},a),{emitDefaultValues:!0}):a;let i=this.field(e,s[e.localName],r);D(void 0!==i),t[a.useProtoFieldName?e.name:e.jsonName]=i}return t}field(e,a,t){let n;if("map"==e.kind){D("object"==typeof a&&null!==a);const s={};switch(e.V.kind){case"scalar":for(const[t,n]of Object.entries(a)){const a=this.scalar(e.V.T,n,e.name,!1,!0);D(void 0!==a),s[t.toString()]=a}break;case"message":const n=e.V.T();for(const[r,i]of Object.entries(a)){const a=this.message(n,i,e.name,t);D(void 0!==a),s[r.toString()]=a}break;case"enum":const r=e.V.T();for(const[n,i]of Object.entries(a)){D(void 0===i||"number"==typeof i);const a=this.enum(r,i,e.name,!1,!0,t.enumAsInteger);D(void 0!==a),s[n.toString()]=a}}(t.emitDefaultValues||Object.keys(s).length>0)&&(n=s)}else if(e.repeat){D(Array.isArray(a));const s=[];switch(e.kind){case"scalar":for(let t=0;t0||t.emitDefaultValues)&&(n=s)}else switch(e.kind){case"scalar":n=this.scalar(e.T,a,e.name,e.opt,t.emitDefaultValues);break;case"enum":n=this.enum(e.T(),a,e.name,e.opt,t.emitDefaultValues,t.enumAsInteger);break;case"message":n=this.message(e.T(),a,e.name,t)}return n}enum(e,a,t,n,s,r){if("google.protobuf.NullValue"==e[0])return s||n?null:void 0;if(void 0!==a){if(0!==a||s||n)return D("number"==typeof a),D(Number.isInteger(a)),r||!e[1].hasOwnProperty(a)?a:e[2]?e[2]+e[1][a]:e[1][a]}else D(n)}message(e,a,t,n){return void 0===a?n.emitDefaultValues?null:void 0:e.internalJsonWrite(a,n)}scalar(e,a,t,n,s){if(void 0===a)return void D(n);const r=s||n;switch(e){case J.INT32:case J.SFIXED32:case J.SINT32:return 0===a?r?0:void 0:(U(a),a);case J.FIXED32:case J.UINT32:return 0===a?r?0:void 0:(F(a),a);case J.FLOAT:j(a);case J.DOUBLE:return 0===a?r?0:void 0:(D("number"==typeof a),Number.isNaN(a)?"NaN":a===Number.POSITIVE_INFINITY?"Infinity":a===Number.NEGATIVE_INFINITY?"-Infinity":a);case J.STRING:return""===a?r?"":void 0:(D("string"==typeof a),a);case J.BOOL:return!1===a?!r&&void 0:(D("boolean"==typeof a),a);case J.UINT64:case J.FIXED64:D("number"==typeof a||"string"==typeof a||"bigint"==typeof a);let e=B.from(a);if(e.isZero()&&!r)return;return e.toString();case J.INT64:case J.SFIXED64:case J.SINT64:D("number"==typeof a||"string"==typeof a||"bigint"==typeof a);let t=A.from(a);if(t.isZero()&&!r)return;return t.toString();case J.BYTES:return D(a instanceof Uint8Array),a.byteLength?function(e){let a,t="",n=0,s=0;for(let r=0;r>2],s=(3&a)<<4,n=1;break;case 1:t+=d[s|a>>4],s=(15&a)<<2,n=2;break;case 2:t+=d[s|a>>6],t+=d[63&a],n=0}return n&&(t+=d[s],t+="=",1==n&&(t+="=")),t}(a):r?"":void 0}}}function Q(e,a=G.STRING){switch(e){case J.BOOL:return!1;case J.UINT64:case J.FIXED64:return q(B.ZERO,a);case J.INT64:case J.SFIXED64:case J.SINT64:return q(A.ZERO,a);case J.DOUBLE:case J.FLOAT:return 0;case J.BYTES:return new Uint8Array(0);case J.STRING:return"";default:return 0}}class ee{constructor(e){this.info=e}prepare(){var e;if(!this.fieldNoToField){const a=null!==(e=this.info.fields)&&void 0!==e?e:[];this.fieldNoToField=new Map(a.map((e=>[e.no,e])))}}read(e,a,t,n){this.prepare();const s=void 0===n?e.len:e.pos+n;for(;e.pose.no-a.no))}}write(e,a,t){this.prepare();for(const n of this.fields){let s,r,i=n.repeat,o=n.localName;if(n.oneof){const a=e[n.oneof];if(a.oneofKind!==o)continue;s=a[o],r=!0}else s=e[o],r=!1;switch(n.kind){case"scalar":case"enum":let e="enum"==n.kind?J.INT32:n.T;if(i)if(D(Array.isArray(s)),i==Z.PACKED)this.packed(a,e,n.no,s);else for(const t of s)this.scalar(a,e,n.no,t,!0);else void 0===s?D(n.opt):this.scalar(a,e,n.no,s,r||n.opt);break;case"message":if(i){D(Array.isArray(s));for(const e of s)this.message(a,t,n.T(),n.no,e)}else this.message(a,t,n.T(),n.no,s);break;case"map":D("object"==typeof s&&null!==s);for(const[e,r]of Object.entries(s))this.mapEntry(a,t,n,e,r)}}let n=t.writeUnknownFields;!1!==n&&(!0===n?h.onWrite:n)(this.info.typeName,e,a)}mapEntry(e,a,t,n,s){e.tag(t.no,p.LengthDelimited),e.fork();let r=n;switch(t.K){case J.INT32:case J.FIXED32:case J.UINT32:case J.SFIXED32:case J.SINT32:r=Number.parseInt(n);break;case J.BOOL:D("true"==n||"false"==n),r="true"==n}switch(this.scalar(e,t.K,1,r,!0),t.V.kind){case"scalar":this.scalar(e,t.V.T,2,s,!0);break;case"enum":this.scalar(e,J.INT32,2,s,!0);break;case"message":this.message(e,a,t.V.T(),2,s)}e.join()}message(e,a,t,n,s){void 0!==s&&(t.internalBinaryWrite(s,e.tag(n,p.LengthDelimited).fork(),a),e.join())}scalar(e,a,t,n,s){let[r,i,o]=this.scalarInfo(a,n);o&&!s||(e.tag(t,r),e[i](n))}packed(e,a,t,n){if(!n.length)return;D(a!==J.BYTES&&a!==J.STRING),e.tag(t,p.LengthDelimited),e.fork();let[,s]=this.scalarInfo(a);for(let a=0;age}])}};const ge=new class extends le{constructor(){super("Captions",[{no:51621377,name:"playerCaptionsTracklistRenderer",kind:"message",T:()=>ce}])}};const ce=new class extends le{constructor(){super("PlayerCaptionsTracklistRenderer",[{no:1,name:"captionTracks",kind:"message",repeat:1,T:()=>me},{no:2,name:"audioTracks",kind:"message",repeat:1,T:()=>de},{no:3,name:"translationLanguages",kind:"message",repeat:1,T:()=>fe},{no:4,name:"defaultAudioTrackIndex",kind:"scalar",opt:!0,T:5},{no:6,name:"defaultCaptionTrackIndex",kind:"scalar",opt:!0,T:5}])}};const me=new class extends le{constructor(){super("CaptionTracks",[{no:1,name:"baseUrl",kind:"scalar",T:9},{no:2,name:"name",kind:"message",T:()=>he},{no:3,name:"vssId",kind:"scalar",T:9},{no:4,name:"languageCode",kind:"scalar",T:9},{no:5,name:"kind",kind:"scalar",opt:!0,T:9},{no:6,name:"rtl",kind:"scalar",opt:!0,T:8},{no:7,name:"isTranslatable",kind:"scalar",T:8}])}};const de=new class extends le{constructor(){super("AudioTracks",[{no:2,name:"captionTrackIndices",kind:"scalar",repeat:2,T:5},{no:3,name:"defaultCaptionTrackIndex",kind:"scalar",opt:!0,T:5},{no:4,name:"forcedCaptionTrackIndex",kind:"scalar",opt:!0,T:5},{no:5,name:"visibility",kind:"scalar",opt:!0,T:5},{no:6,name:"hasDefaultTrack",kind:"scalar",opt:!0,T:8},{no:7,name:"hasForcedTrack",kind:"scalar",opt:!0,T:8},{no:8,name:"audioTrackId",kind:"scalar",opt:!0,T:9},{no:11,name:"captionsInitialState",kind:"scalar",opt:!0,T:5}])}};const fe=new class extends le{constructor(){super("TranslationLanguages",[{no:1,name:"languageCode",kind:"scalar",T:9},{no:2,name:"languageName",kind:"message",T:()=>he}])}};const he=new class extends le{constructor(){super("Name",[{no:1,name:"runs",kind:"message",repeat:1,T:()=>pe}])}};const pe=new class extends le{constructor(){super("Runs",[{no:1,name:"text",kind:"scalar",T:9}])}};const Ne=new class extends le{constructor(){super("youtube.api.innertube.GetWatchResponse",[{no:2,name:"playerResponse",kind:"message",T:()=>ue},{no:3,name:"watchNextResponse",kind:"message",T:()=>Te},{no:4,name:"getPlayerErrorMsg",kind:"scalar",opt:!0,T:9},{no:5,name:"getWatchNextErrorMsg",kind:"scalar",opt:!0,T:9}])}};const Te=new class extends le{constructor(){super("youtube.api.innertube.WatchNextResponse",[])}};n("v1.4.2(1013)");const be=new URL($request.url);n(`⚠ url: ${be.toJSON()}`,"");const ye=$request.method,Ce=be.hostname,xe=be.pathname;n(`⚠ METHOD: ${ye}, HOST: ${Ce}, PATH: ${xe}`,"");const ke=($response.headers?.["Content-Type"]??$response.headers?.["content-type"])?.split(";")?.[0];function we(e,a){if(console.log("☑️ Captions",""),e&&(n("⚠ Captions",""),e?.playerCaptionsRenderer&&(n("⚠ playerCaptionsRenderer",""),e.playerCaptionsRenderer.visibility="ON",e.playerCaptionsRenderer.showAutoCaptions=!0),e?.playerCaptionsTracklistRenderer)){switch(n("⚠ playerCaptionsTracklistRenderer",""),e?.playerCaptionsTracklistRenderer?.captionTracks&&(e.playerCaptionsTracklistRenderer.captionTracks=e?.playerCaptionsTracklistRenderer.captionTracks.map((e=>(e.isTranslatable=!0,e)))),e?.playerCaptionsTracklistRenderer?.audioTracks&&(e.playerCaptionsTracklistRenderer.audioTracks=e?.playerCaptionsTracklistRenderer.audioTracks.map((e=>(e.visibility=2,e.hasDefaultTrack=!0,e.captionsInitialState=3,e)))),Ce){case"www.youtube.com":case"tv.youtube.com":default:e.playerCaptionsTracklistRenderer.translationLanguages=a.translationLanguages.DESKTOP;break;case"m.youtube.com":case"youtubei.googleapis.com":e.playerCaptionsTracklistRenderer.translationLanguages=a.translationLanguages.MOBILE}e?.playerCaptionsTracklistRenderer?.defaultCaptionTrackIndex||(e.playerCaptionsTracklistRenderer.defaultCaptionTrackIndex=0)}return n("✅ Captions",""),e}n(`⚠ FORMAT: ${ke}`,""),(async()=>{const{Settings:a,Caches:t,Configs:s}=c("DualSubs","YouTube",g);switch(n(`⚠ Settings.Switch: ${a?.Switch}`,""),a.Switch){case!0:default:const r=be.searchParams.get("subtype")??a.Type,i=[be.searchParams.get("lang")?.toUpperCase?.()??a.Languages[0],(be.searchParams.get("tlang")??t?.tlang)?.toUpperCase?.()??a.Languages[1]];n(`⚠ Type: ${r}, Languages: ${i}`,"");let o={captions:{playerCaptionsTracklistRenderer:{captionTracks:[],audioTracks:[],translationLanguages:[]}}};switch(ke){case void 0:case"application/x-www-form-urlencoded":case"text/plain":default:case"application/x-mpegURL":case"application/x-mpegurl":case"application/vnd.apple.mpegurl":case"audio/mpegurl":case"text/xml":case"text/html":case"text/plist":case"application/xml":case"application/plist":case"application/x-plist":case"text/vtt":case"application/vtt":break;case"text/json":case"application/json":if(o=JSON.parse($response.body??"{}"),"/youtubei/v1/player"===xe)o?.captions&&(o.captions=we(o.captions,s));$response.body=JSON.stringify(o);break;case"application/protobuf":case"application/x-protobuf":case"application/vnd.google.protobuf":case"application/grpc":case"application/grpc+proto":case"application/octet-stream":let a="Quantumult X"===e?new Uint8Array($response.bodyBytes??[]):$response.body??new Uint8Array;switch(ke){case"application/protobuf":case"application/x-protobuf":case"application/vnd.google.protobuf":switch(xe){case"/youtubei/v1/get_watch":class e extends le{constructor(){super("get_watch_response",[{no:1,name:"contents",kind:"message",repeat:1,T:()=>Ne}])}}const t=new e;o=t.fromBinary(a),o?.contents?.[0]?.playerResponse?.captions&&(o.contents[0].playerResponse.captions=we(o.contents[0].playerResponse.captions,s)),a=t.toBinary(o);break;case"/youtubei/v1/player":o=ue.fromBinary(a),o?.captions&&(o.captions=we(o.captions,s)),a=ue.toBinary(o)}}$response.body=a}case!1:}})().catch((a=>function(a){switch(e){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":case"Quantumult X":default:n("","❗️执行错误!",a,"");break;case"Node.js":n("","❗️执行错误!",a.stack,"")}}(a))).finally((()=>function(t={}){switch(e){case"Surge":t.policy&&a.set(t,"headers.X-Surge-Policy",t.policy),n("",`🚩 执行结束! 🕛 ${(new Date).getTime()/1e3-$script.startTime} 秒`,""),$done(t);break;case"Loon":t.policy&&(t.node=t.policy),n("",`🚩 执行结束! 🕛 ${(new Date-$script.startTime)/1e3} 秒`,""),$done(t);break;case"Stash":t.policy&&a.set(t,"headers.X-Stash-Selected-Proxy",encodeURI(t.policy)),n("",`🚩 执行结束! 🕛 ${(new Date-$script.startTime)/1e3} 秒`,""),$done(t);break;case"Egern":case"Shadowrocket":default:n("","🚩 执行结束!",""),$done(t);break;case"Quantumult X":t.policy&&a.set(t,"opts.policy",t.policy),delete t["auto-redirect"],delete t["auto-cookie"],delete t["binary-mode"],delete t.charset,delete t.host,delete t.insecure,delete t.method,delete t.opt,delete t.path,delete t.policy,delete t["policy-descriptor"],delete t.scheme,delete t.sessionIndex,delete t.statusCode,delete t.timeout,t.body instanceof ArrayBuffer?(t.bodyBytes=t.body,delete t.body):ArrayBuffer.isView(t.body)?(t.bodyBytes=t.body.buffer.slice(t.body.byteOffset,t.body.byteLength+t.body.byteOffset),delete t.body):t.body&&delete t.bodyBytes,n("","🚩 执行结束!",""),$done(t);break;case"Node.js":n("","🚩 执行结束!",""),process.exit(1)}}($response)));