Advertisement
xiaomianao666

邀您一起看:三体 电视剧

Jan 16th, 2023
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥三体 电视剧@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaOqOmAgVwiLFwicGF0aFwiOlwicHVzaFwiLFwicnVsZVwiOlwianM6XFxuLy9sb2coTVlfVVJMKTtcXG52YXIgaXRlbXMgPSBbXTtcXG52YXIgcmVhbHVybCA9IE1ZX1VSTC5zcGxpdCgnIyMnKVsxXS5zcGxpdCgnPz8/JylbMF07XFxudmFyIHR2aXAgPSBnZXRJdGVtKCdoaWtlcnR2Ym94c2V0JywgJycpO1xcbnZhciBjbHRleHQgPSBnZXRNeVZhcihcXFwibmFtZVxcXCIsIHJlYWx1cmwpO1xcbi8vbG9nKHJlYWx1cmwpO1xcbml0ZW1zLnB1c2goe1xcbiAgICB0aXRsZTogZGVjb2RlVVJJQ29tcG9uZW50KGNsdGV4dCksXFxuICAgIHVybDogXFxcImlucHV0Oi8vXFxcIiArIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgIHZhbHVlOiBcXFwiXFxcIixcXG4gICAgICAgIGhpbnQ6IFxcXCLor7fovpPlhaV0dmJveOaOqOmAgeWGheWuuVxcXCIsXFxuICAgICAgICBqczogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignbmFtZScpO1xcbiAgICAgICAgICAgIHZhciBudW0gPSBlbmNvZGVVUklDb21wb25lbnQoaW5wdXQpO1xcbiAgICAgICAgICAgIGlmIChudW0gPT0gJycpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i+k+WFpeeahOWAvOaYr+epuueahOOAgic7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ25hbWUnLCBudW0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgIH0pLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fMV9zZWFyY2gnXFxufSk7XFxuXFxuaWYgKGdldE15VmFyKCduYW1lJywgJycpICE9ICcnKSB7XFxuICAgIHJlYWx1cmwgPSBnZXRNeVZhcignbmFtZScpO1xcbn1cXG4vL2xvZyhcXFwi5a6e6ZmFXFxcIityZWFsdXJsKTtcXG5pZiAodHZpcC5pbmNsdWRlcygnaHR0cCcpKSB7XFxuICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLwn5O9IOaOqOmAgeWIsFRWQm94IPCfk7pcXFwiLFxcbiAgICAgICAgdXJsOiAkKHJlYWx1cmwpLmxhenlSdWxlKCh0dmlwKSA9PiB7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignbmFtZScpO1xcbiAgICAgICAgICAgIGlucHV0ID0gZGVjb2RlVVJJQ29tcG9uZW50KGlucHV0KTtcXG4gICAgICAgICAgICB2YXIgcHVybCA9IGlucHV0LnNwbGl0KFxcXCI7XFxcIilbMF07XFxuICAgICAgICAgICAgaWYgKHB1cmwuaW5jbHVkZXMoXFxcIlxcXFxuXFxcIikpIHtcX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ZW50KHZhbCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSA8IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhYWEgPSB2dnY7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGFhYSArPSBcXFwiJlxcXCIgKyB2dnZcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBwdXJsID0gcHVybCArIFxcXCJ8XFxcIiArIGFhYTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBwdXJsID0gcHVybC5yZXBsYWNlKC9cXFxcJi9nLCAn77yG77yGJylcXG5cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy9sb2cocHVybCk7XFxuICAgICAgICAgICAgLy9sb2codHZpcCk7XFxuICAgICAgICAgICAgaWYgKGlucHV0LnN0YXJ0c1dpdGgoJ2h0dHBzOi8vd3d3LmFsaXl1bmRyaXZlLmNvbS9zLycpKSB7XFxuICAgICAgICAgICAgICAgIGxldCByZWZ0b2tlbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMvaWN5L2ljeS1hbGktdG9rZW4uanNvbicsIHt9KSlbMF0ucmVmcmVzaF90b2tlbjtcXG4gICAgICAgICAgICAgICAgcHVybCA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJyZWZyZXNoX3Rva2VuXFxcIjogcmVmdG9rZW5cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgdmFyIHN0YXRlID0gcmVxdWVzdCh0dmlwICsgJy9hY3Rpb24nLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcXG4gICAgICAgICAgICAgICAgICAgIC8vJ1gtUmVxdWVzdGVkLVdpdGgnOiAnWE1MSHR0cFJlcXVlc3QnLFxcbiAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiB0dmlwXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDIwMDAsXFxuICAgICAgICAgICAgICAgIGJvZHk6ICdkbz1wdXNoJnVybD0nICsgcHVybCxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsb2coc3RhdGUpO1xcbiAgICAgICAgICAgIGlmIChzdGF0ZSA9PSAnb2snKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mjqjpgIHmiJDlip/vvIzlpoLmnpx0dmJveOaYvuekuuKAnOayoeaJvuWIsOaVsOaNruKAneWPr+iDveaYr+ivpemTvuaOpemcgOimgeWvhueggeaIluiAheW9k+WJjeeahGphcuS4jeaUr+aMgeOAgic7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+aOqOmAgeWksei0pSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCB0dmlwKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJcXFwiXFxuICAgIH0pO1xcbn0gZWxzZSB7XFxuICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfmjqjpgIHlpLHotKXvvIxJUOWcsOWdgOiuvue9ruS4jeato+ehruOAgicsXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2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2YXIgY29udHMgPSBKU09OLnBhcnNlKHJlc2NvZCkuaXRlbXM7XFxuICAgIHZhciBkb25ndGFpID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xhenl1cmwnLCB7fSkpLnJ1bGUudG9TdHJpbmcoKTtcXG4gICAgdmFyIHR1aXNvbmcgPSBbXTtcXG4gICAgZm9yICh2YXIgaSBpbiBjb250cykge1xcbiAgICAgICAgdmFyIGxpc3R5cCA9IGNvbnRzW2ldLnR5cGU7XFxuICAgICAgICBpZiAobGlzdHlwICE9ICdmb2xkZXInKSB7XFxuICAgICAgICAgICAgdmFyIGNhdGUgPSBjb250c1tpXS5jYXRlZ29yeTtcXG4gICAgICAgICAgICB2YXIgZm5hbWUgPSBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgICAgIGlmIChjYXRlID09ICd2aWRlbycpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk7onICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ2RvYycpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk5YnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ2ltYWdlJykge1xcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+WvCcgKyBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F0ZSA9PSAnemlwJykge1xcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TpicgKyBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGNvbnRzW2ldLm5hbWVcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGNvbnRzW2ldLmZpbGVfaWQpLmxhenlSdWxlKChzaGFyZUlkLCBzaGFyZXRva2VuLCBkb25ndGFpLCBjYXRlLCBmbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChkb25ndGFpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5XFxuICAgICAgICAgICAgICAgIH0sIHNoYXJlSWQsIHNoYXJldG9rZW4sIGRvbmd0YWksIGNhdGUsIGZuYW1lKSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZm9ybWF0RGF0ZShjb250c1tpXS51cGRhdGVkX2F0KSArICcgICcgKyBmb3JtYXRTaXplKGNvbnRzW2ldLnNpemUpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMSdcXG5cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpZiAoY2F0ZSA9PSAndmlkZW8nIHx8IGNhdGUgPT0gJ2F1ZGlvJykge1xcbiAgICAgICAgICAgICAgICB0dWlzb25nLnB1c2goXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZS5yZXBsYWNlKC9cXFxcIy9nLCAnXycpLnJlcGxhY2UoL1xcXFwkL2csICdfJykgKyAnJCcgKyBjYXRlICsgJ3wnICsgY29udHNbaV0uZmlsZV9pZFxcbiAgICAgICAgICAgICAgICApO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn8J+TgicgKyBjb250c1tpXS5uYW1lLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHknICsgY29udHNbaV0uZmlsZV9pZCArICc/Pz9meXBhZ2UnKS5ydWxlKChzaGFyZUlkLCBzaGFyZXRva2VuLCBwdXNobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgIC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cy8nICsgc2hhcmVJZCArICcvZm9sZGVyLycgKyBnZXRSZXNDb2RlKCkuc3BsaXQoJz8/PycpWzBdKS5sYXp5UnVsZSgodHZpcCkgPT4ge1xcbiAgICAgICAgICAgIGlmICghdHZpcC5pbmNsdWRlcygnOjk5NycpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly9JUOS4uuepuuaIluS4jeato+ehru+8jOivt+WFiOiuvue9ruOAgidcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGxldCByZWZ0b2tlbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMvaWN5L2ljeS1hbGktdG9rZW4uanNvbicsIHt9KSlbMF0ucmVmcmVzaF90b2tlbjtcXG4gICAgICAgICAgICBsZXQgcHVybCA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IGlucHV0LFxcbiAgICAgICAgICAgICAgICBcXFwicmVmcmVzaF90b2tlblxcXCI6IHJlZnRva2VuXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdmFyIHN0YXRlID0gcmVxdWVzdCh0dmlwICsgJy9hY3Rpb24nLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcXG4gICAgICAgICAgICAgICAgICAgIC8vJ1gtUmVxdWVzdGVkLVdpdGgnOiAnWE1MSHR0cFJlcXVlc3QnLFxcbiAgICAgICAgICAgICAgICAgICAgJ1JlZmVyZXInOiB0dmlwXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDIwMDAsXFxuICAgICAgICAgICAgICAgIGJvZHk6ICdkbz1wdXNoJnVybD0nICsgcHVybCxcXG4gICAgICAgICAgICAgICAgbWV0aG9k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7XFxuICAgICAgICB2YXIgZm5hbWUgPSBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgaWYgKGNhdGUgPT0gJ3ZpZGVvJykge1xcbiAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5O6JyArIGNvbnRzW2ldLm5hbWU7XFxuICAgICAgICB9IGVsc2UgaWYgKGNhdGUgPT0gJ2RvYycpIHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+TlicgKyBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICdpbWFnZScpIHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSAn8J+WvCcgKyBjb250c1tpXS5uYW1lO1xcbiAgICAgICAgfSBlbHNlIGlmIChjYXRlID09ICd6aXAnKSB7XFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk6YnICsgY29udHNbaV0ubmFtZTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gY29udHNbaV0ubmFtZVxcbiAgICAgICAgfVxcbiAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgIHVybDogJChjb250c1tpXS5maWxlX2lkKS5sYXp5UnVsZSgoc2hhcmVJZCwgc2hhcmV0b2tlbiwgZG9uZ3RhaSwgY2F0ZSwgZm5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgZXZhbChkb25ndGFpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHBsYXlcXG4gICAgICAgICAgICB9LCBzaGFyZUlkLCBzaGFyZXRva2VuLCBkb25ndGFpLCBjYXRlLCBmbmFtZSksXFxuICAgICAgICAgICAgZGVzYzogZm9ybWF0RGF0ZShjb250c1tpXS51cGRhdGVkX2F0KSArICcgICcgKyBmb3JtYXRTaXplKGNvbnRzW2ldLnNpemUpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8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B9KSxcXG4gICAgfSksXFxuICAgIGNvbF90eXBlOiAnaWNvbl8xX3NlYXJjaCdcXG59KTtcXG5cXG5pZiAoZ2V0TXlWYXIoJ25hbWUnLCAnJykgIT0gJycpIHtcXG4gICAgcmVhbHVybCA9IGdldE15VmFyKCduYW1lJyk7XFxufVxcbi8vbG9nKFxcXCLlrp7pmYVcXFwiK3JlYWx1cmwpO1xcbmlmICh0dmlwLmluY2x1ZGVzKCdodHRwJykpIHtcXG4gICAgaXRlbXMucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIvCfk70g5o6o6YCB5YiwVFZCb3gg8J+TulxcXCIsXFxuICAgICAgICB1cmw6ICQocmVhbHVybCkubGF6eVJ1bGUoKHR2aXApID0+IHtcXG4gICAgICAgICAgICBjbGVhck15VmFyKCduYW1lJyk7XFxuICAgICAgICAgICAgaW5wdXQgPSBkZWNvZGVVUklDb21wb25lbnQoaW5wdXQpO1xcbiAgICAgICAgICAgIHZhciBwdXJsID0gaW5wdXQuc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgICAgICBpZiAocHVybC5pbmNsdWRlcyhcXFwiXFxcXG5cXFwiKSkge1xcbiAgICAgICAgICAgICAgICBwdXJsID0gcHVybC5yZXBsYWNlKFxcXCJcXFxcblxcXCIsICckJyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHZhciBoZWFkID0gaW5wdXQuc3BsaXQoXFxcIjtcXFwiKVsxXTtcXG4gICAgICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwie1xcXCIpICYmIGlucHV0LmVuZHNXaXRoKFxcXCJ9XFxcIikpIHtcXG5cXG4gICAgICAgICAgICAgICAgcHVybCA9IGlucHV0LnJlcGxhY2UoL1xcXFwmL2csICfvvIbvvIYnKTtcXG4gICAgICAgICAgICAgICAgLy9sb2cocHVybCk7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChoZWFkICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICB2YXIgaGVhZCA9IGlucHV0LnNwbGl0KFxcXCI7e1xcXCIpWzFdLnNwbGl0KFxcXCJ9XFxcIilbMF0uc3BsaXQoXFxcIiYmXFxcIik7XFxuICAgICAgICAgICAgICAgIHZhciBwdXJsID0gaW5wdXQuc3BsaXQoXFxcIjt7XFxcIilbMF0ucmVwbGFjZSgvXFxcXCYvZywgJ++8hu+8hicpO1xcblxcbiAgICAgICAgICAgICAgICB2YXIgYWFhID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaGVhZC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGtleSA9IGhlYWRbaV0uc3BsaXQoXFxcIkBcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB2YWwgPSBoZWFkW2ldLnNwbGl0KFxcXCJAXFxcIilbMV0ucmVwbGFjZSgvXFxcXO+8m1xcXFzvvJsvZywgJzsnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB2dnYgPSBrZXkgKyBcXFwiPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQodmFsKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpIDwgMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGFhYSA9IHZ2djtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYWFhICs9IFxcXCImXFxcIiArIHZ2dlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHB1cmwgPSBwdXJsICsgXFxcInxcXFwiICsgYWFhO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHB1cmwgPSBwdXJsLnJlcGxhY2UoL1xcXFwmL2csICfvvIbvvIYnKVxcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAvL2xvZyhwdXJsKTtcXG4gICAgICAgICAgICAvL2xvZyh0dmlwKTtcXG4gICAgICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aCgnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvJykpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlZnRva2VuID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy9pY3kvaWN5LWFsaS10b2tlbi5qc29uJywge30pKVswXS5yZWZyZXNoX3Rva2VuO1xcbiAgICAgICAgICAgICAgICBwdXJsID0gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInJlZnJlc2hfdG9rZW5cXFwiOiByZWZ0b2tlblxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICB2YXIgc3RhdGUgPSByZXF1ZXN0KHR2aXAgKyAnL2FjdGlvbicsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxcbiAgICAgICAgICAgICAgICAgICAgLy8nWC1SZXF1ZXN0ZWQtV2l0aCc6ICdYTUxIdHRwUmVxdWVzdCcsXFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6IHR2aXBcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgdGltZW91dDogMjAwMCxcXG4gICAgICAgICAgICAgICAgYm9keTogJ2RvPXB1c2gmdXJsPScgKyBwdXJsLFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxvZyhzdGF0ZSk7XFxuICAgICAgICAgICAgaWYgKH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iO1xcXFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaGVhZC5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0gaGVhZFtpXS5zcGxpdChcXFxcXFxcIkBcXFxcXFxcIilbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB2YWwgPSBoZWFkW2ldLnNwbGl0KFxcXFxcXFwiQFxcXFxcXFwiKVsxXS5yZXBsYWNlKC9cXFxcXFxcXO+8m1xcXFxcXFxc77ybL2csICc7Jyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB2dnYgPSBrZXkgKyBcXFxcXFxcIj1cXFxcXFxcIiArIGVuY29kZVVSSUNvbXBvbmVudCh2YWwpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSA8IDEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFhYSA9IHZ2djtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFhYSArPSBcXFxcXFxcIiZcXFxcXFxcIiArIHZ2dlxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHB1cmwgPSBwdXJsICsgXFxcXFxcXCJ8XFxcXFxcXCIgKyBhYWE7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHB1cmwgPSBwdXJsLnJlcGxhY2UoL1xcXFxcXFxcJi9nLCAn77yG77yGJylcXFxcblxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgLy9sb2cocHVybCk7XFxcXG4gICAgICAgICAgICAvL2xvZyh0dmlwKTtcXFxcbiAgICAgICAgICAgIGlmIChpbnB1dC5zdGFydHNXaXRoKCdodHRwczovL3d3dy5hbGl5dW5kcml2ZS5jb20vcy8nKSkge1xcXFxuICAgICAgICAgICAgICAgIGxldCByZWZ0b2tlbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMvaWN5L2ljeS1hbGktdG9rZW4uanNvbicsIHt9KSlbMF0ucmVmcmVzaF90b2tlbjtcXFxcbiAgICAgICAgICAgICAgICBwdXJsID0gSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInVybFxcXFxcXFwiOiBpbnB1dCxcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZWZyZXNoX3Rva2VuXFxcXFxcXCI6IHJlZnRva2VuXFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgdmFyIHN0YXRlID0gcmVxdWVzdCh0dmlwICsgJy9hY3Rpb24nLCB7XFxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXFxcXG4gICAgICAgICAgICAgICAgICAgIC8vJ1gtUmVxdWVzdGVkLVdpdGgnOiAnWE1MSHR0cFJlcXVlc3QnLFxcXFxuICAgICAgICAgICAgICAgICAgICAnUmVmZXJlcic6IHR2aXBcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDIwMDAsXFxcXG4gICAgICAgICAgICAgICAgYm9keTogJ2RvPXB1c2gmdXJsPScgKyBwdXJsLFxcXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxvZyhzdGF0ZSk7XFxcXG4gICAgICAgICAgICBpZiAoc3RhdGUgPT0gJ29rJykge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mjqjpgIH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b2MnKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/Cfk5YnICsgY29udHNbaV0ubmFtZTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F0ZSA9PSAnaW1hZ2UnKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gJ/CflrwnICsgY29udHNbaV0ubmFtZTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F0ZSA9PSAnemlwJykge1xcXFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9ICfwn5OmJyArIGNvbnRzW2ldLm5hbWU7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGNvbnRzW2ldLm5hbWVcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoY29udHNbaV0uZmlsZV9pZCkubGF6eVJ1bGUoKHNoYXJlSWQsIHNoYXJldG9rZW4sIGRvbmd0YWksIGNhdGUsIGZuYW1lKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZG9uZ3RhaSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5XFxcXG4gICAgICAgICAgICAgICAgfSwgc2hhcmVJZCwgc2hhcmV0b2tlbiwgZG9uZ3RhaSwgY2F0ZSwgZm5hbWUpLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IGZvcm1hdERhdGUoY29udHNbaV0udXBkYXRlZF9hdCkgKyAnICAnICsgZm9ybWF0U2l6ZShjb250c1tpXS5zaXplKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMSdcXFxcblxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBpZiAoY2F0ZSA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z8nKVswXSkubGF6eVJ1bGUoKHR2aXApID0+IHtcXFxcbiAgICAgICAgICAgIGlmICghdHZpcC5pbmNsdWRlcygnOjk5NycpKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL0lQ5Li656m65oiW5LiN5q2j56Gu77yM6K+35YWI6K6+572u44CCJ1xcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIGxldCByZWZ0b2tlbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMvaWN5L2ljeS1hbGktdG9rZW4uanNvbicsIHt9KSlbMF0ucmVmcmVzaF90b2tlbjtcXFxcbiAgICAgICAgICAgIGxldCBwdXJsID0gSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwidXJsXFxcXFxcXCI6IGlucHV0LFxcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwicmVmcmVzaF90b2tlblxcXFxcXFwiOiByZWZ0b2tlblxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB2YXIgc3RhdGUgPSByZXF1ZXN0KHR2aXAgKyAnL2FjdGlvbicsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgLy8nWC1SZXF1ZXN0ZWQtV2l0aCc6ICdYTUxIdHRwUmVxdWVzdCcsXFxcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogdHZpcFxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgdGltZW91dDogMjAwMCxcXFxcbiAgICAgICAgICAgICAgICBib2R5OiAnZG89cHVzaCZ1cmw9JyArIHB1cmwsXFxcXG4gICAgICAgICAgICAgICAgbWV0aG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dXJsOiAkKHB1c2gpLmxhenlSdWxlKCh0dmlwKSA9PiB7XFxcXG4gICAgICAgIGlmICghdHZpcC5pbmNsdWRlcygnOjk5NycpKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vSVDkuLrnqbrmiJbkuI3mraPnoa7vvIzor7flhYjorr7nva7jgIInXFxcXG4gICAgICAgIH07XFxcXG4gICAgICAgIHZhciBzdGF0ZSA9IHJlcXVlc3QodHZpcCArICcvYWN0aW9uJywge1xcXFxuICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcXFxcbiAgICAgICAgICAgICAgICAvLydYLVJlcXVlc3RlZC1XaXRoJzogJ1hNTEh0dHBSZXF1ZXN0JyxcXFxcbiAgICAgICAgICAgICAgICAnUmVmZXJlcic6IHR2aXBcXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICB0aW1lb3V0OiAyMDAwLFxcXFxuICAgICAgICAgICAgYm9keTogJ2RvPXB1c2gmdXJsPScgKyBpbnB1dCxcXFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsb2coc3RhdGUpO1xcXFxuICAgICAgICBpZiAoc3RhdGUgPT0gJ29rJykge1xcXFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+aOqOmAgeaIkOWKn++8jOWmguaenHR2Ym945pi+56S64oCc5rKh5om+5Yiw5pWw5o2u4oCd5Y+v6IO95piv5b2T5YmN55qEamFy5LiN5pSv5oyB44CCJztcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mjqjpgIHlpLHotKUnXFxcXG4gICAgICAgIH1cXFxcbiAgICB9LCB0dmlwKSxcXFxcbiAgICBjb2xfdHlwZTogXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCJcXFxcbn0pO1xcXFxufVxcXFxuLy9cXFwifV1cIixcInByb3h5XCI6XCJcIn0iLCJ0aXRsZSI6IuS4ieS9kyDnlLXop4bliacifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement