Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@短剧大全@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi55+t5Ymn5aSn5YWoIiwiYXV0aG9yIjoiIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cDovL21wNS5oei5jei9pbmRleC5waHAvdm9kL3Nob3cvaWQvMS9wYWdlL2Z5cGFnZS5odG1sIiwidmVyc2lvbiI6MCwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxudmFyIGQgPSBbXTtcbnZhciBnZXRSYW5nZUNvbG9ycyA9IGZ1bmN0aW9uKCkge1xuICAgIHJldHVybiAnIycgKyAoJzAwMDAwJyArIChNYXRoLnJhbmRvbSgpICogMHgxMDAwMDAwIDw8IDApLnRvU3RyaW5nKDE2KSkuc3Vic3RyKC02KTtcbn1cblxuY29uc3Qg5YiG57G76aKc6ImyID0gZ2V0UmFuZ2VDb2xvcnMoKVxuY29uc3Qg5aSn57G75a6a5L2NID0gJ2JvZHkmJi5zY3JvbGwtY29udGVudCYmLmxpYnJhcnktbGlzdCdcbmNvbnN0IOaLvOaOpeWIhuexuyA9ICdib2R5LS0ubGlicmFyeS1ib3guc2Nyb2xsLWJveCYmLmxpYnJhcnktYm94LnNjcm9sbC1ib3gnXG5jb25zdCDlsI/nsbvlrprkvY0gPSAnYm9keSYmYTpub3QoOm1hdGNoZXMo6aaW6aG1fOS7iuaXpeabtOaWsHzng63mppx8QVBQKSknXG5jb25zdCDliIbnsbvmoIfpopggPSAnYSYmdGl0bGV8f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gICBmb3IgKHZhciBpIGluIHVybHMpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWV4Y2x1ZGUudGVzdCh1cmxzW2ldKSAmJiBjb250YWluLnRlc3QodXJsc1tpXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZnlfYnJpZGdlX2FwcC5sb2codXJsc1tpXSlcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9tZ3R2fHNvaHUvLnRlc3QodXJsc1tpXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmxzW2ldICsgXCI7e1VzZXItQWdlbnRATW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMCl9XCI7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL2JpbGkvLnRlc3QodXJsc1tpXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmxzW2ldICsgXCI7e1VzZXItQWdlbnRATW96aWxsYS81LjAmJlJlZmVyZXJAaHR0cHM6Ly93d3cuYmlsaWJpbGkuY29tfVwiO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9peGlndWEvLnRlc3QodXJsc1tpXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmxzW2ldICsgXCIjaXNWaWRlbz10cnVlI1wiICsgXCIjLm1wNDt7UmVmZXJlckBodHRwczovL3d3dy5peGlndWEuY29tLyYmVXNlci1BZ2VudEBNb3ppbGxhLzUuMH1cIjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmxzW2ldXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdmlkZW87XG4gICAgfVxufSk7XG5cbi8v57q/6Lev5ZCN5YiX6KGo55qE5a6a5L2NXG52YXIgYXJ0cyA9IHBhcnN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ICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbChsaXN0W2pdLCAnYSYmVGV4dCcpLnJlcGxhY2UoL+esrHzpm4Z86K+dfOacny9nLCAnJyksXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJykgKyBsYXp5LFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGxpc3QubGVuZ3RoID4gNCA/ICd0ZXh0XzUnIDogJ3RleHRfMidcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybHggPSAnaGlrZXI6Ly9wYWdlL3B1c2g/cHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwibmFtZVwiOiBnZXRQYWdlVGl0bGUoKSArIHBhcnNlRG9tRm9ySHRtbChsaXN0W2pdLCAnYSYmVGV4dCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJwaWNcIjogcGFyc2VEb20oaHRtbCwgJy5sYXp5bG9hZCYmZGF0YS1zcmN8fGRhdGEtb3JpZ2luYWwnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiY29udGVudFwiOiBwYXJzZURvbUZvckh0bWwoaHRtbCwgJy52aWRlby1pbmZvLWNvbnRlbnQmJlRleHQnKS5yZXBsYWNlKCfmlLbotbcnLCAnJyksXG4gICAgICAgICAgICAgICAgICAgICAgICBcImZyb21cIjogZ2V0UGFnZVRpdGxlKCkgKyBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwidXJsXCI6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJylcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJylcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKS5yZXBsYWNlKC/nrKx86ZuGfOivnXzmnJ8vZywgJycpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmx4LFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGxpc3QubGVuZ3RoID4gNCA/ICd0ZXh0XzUnIDogJ3RleHRfMicsXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmF4XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgICAgIHRpdGxlOiAn5rKh5pyJ6YCJ6ZuG5ZOf77yM5LiN5L+h54K55Zu+54mH5Y6755yL55yL8J+RgCcsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRmcHVzaCA9PSAnMCcpIHtcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKS5yZXBsYWNlKC/nrKx86ZuGfOivnXzmnJ8vZywgJycpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBwYXJzZURvbShsaXN0W2pdLCAnYSYmaHJlZicpICsgbGF6eSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBsaXN0Lmxlbmd0aCA+IDQgPyAndGV4dF81JyA6ICd0ZXh0XzInXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmx4ID0gJ2hpa2VyOi8vcGFnZS9wdXNoP3B1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBcIm5hbWVcIjogZ2V0UGFnZVRpdGxlKCkgKyBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwicGljXCI6IHBhcnNlRG9tKGh0bWwsICcubGF6eWxvYWQmJmRhdGEtc3JjfHxkYXRhLW9yaWdpbmFsJyksXG4gICAgICAgICAgICAgICAgICAgICAgICBcImNvbnRlbnRcIjogcGFyc2VEb21Gb3JIdG1sKGh0bWwsICcudmlkZW8taW5mby1jb250ZW50JiZUZXh0JykucmVwbGFjZSgn5pS26LW3JywgJycpLFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJmcm9tXCI6IGdldFBhZ2VUaXRsZSgpICsgcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdhJiZUZXh0JyksXG4gICAgICAgICAgICAgICAgICAgICAgICBcInVybFwiOiBwYXJzZURvbShsaXN0W2pdLCAnYSYmaHJlZicpXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYXJzZURvbShsaXN0W2pdLCAnYSYmaHJlZicpXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdhJiZUZXh0JykucmVwbGFjZSgv56ysfOmbhnzor5185pyfL2csICcnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJseCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBsaXN0Lmxlbmd0aCA+IDQgPyAndGV4dF81JyA6ICd0ZXh0XzInLFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJheFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICfmsqHmnInpgInpm4blk5/vvIzkuI3kv6Hngrnlm77niYfljrvnnIvnnIvwn5GAJyxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgfVxufVxuc2V0VGFicyh0YWJzLCBNWV9VUkwpO1xuc2V0TGlzdHMobGlzdHMsIGdldFZhcihNWV9VUkwsICcwJykpO1xuZC5wdXNoKHtcbiAgICB0aXRsZTogJzxicj4nLFxuICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xufSk7XG5zZXRSZXN1bHQoZCk7Iiwic2RldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJzZGV0YWlsX2ZpbmRfcnVsZSI6IioiLCJ1YSI6InBjIiwicHJlUnVsZSI6IiIsInBhZ2VzIjoiW3tcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLmjqjpgIFcIixcInBhdGhcIjpcInB1c2hcIixcInJ1bGVcIjpcImpzOl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nZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgfSwgZm9sZCksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICB9KVxcblxcbmNhdGVnb3JpZXMuZm9yRWFjaCgoY2F0ZWdvcnksIGluZGV4KSA9PiB7XFxuICAgICAgICBsZXQgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0pO1xcbiAgICAgICAgaWYgKGluZGV4ID09PSAwKSB7XFxuICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjogJyArIOWIhuexu+minOiJsiArICdcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwZChpdGVtLCDliIbnsbvpk77mjqUpICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChmb2xkID09PSAnMScpIHtcXG4gICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiAnICsg5YiG57G76aKc6ImyICsgJ1xcXCI+JyArIHRpdGxlICsgJzwvc3Bhbj48L2I+JyA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnVybCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cXG5cIn1dIiwiaWNvbiI6Imh0dHA6Ly9tcDUuaHouY3ovdXBsb2FkL2R5Y21zLzIwMjQwNTA5LTEvN2Q0NjU1NmMwZGY1NDk4ZmU2NzEzZjA3YWUyNzIwYjUucG5nIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment