Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@555电影APP@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoiNTU155S15b2xQVBQIiwiYXV0aG9yIjoi54ix5L2sJumBk+mVvyZCdGVhIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cHM6Ly92aXA3LmZ6d2R5eS5jbjo4MDgzIyNmeXBhZ2UiLCJ2ZXJzaW9uIjowLCJjb2xfdHlwZSI6Im1vdmllXzNfbWFycXVlZSIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidmlkZW8iLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBkID0gW107XG52YXIgTSA9IE1ZX1VSTC5zcGxpdChcIiMjXCIpO1xudmFyIGdldFJhbmdlQ29sb3JzID0gZnVuY3Rpb24oKSB7wqDCoMKgwqDCoMKgwqBcbiAgICByZXR1cm4gJyMnICsgKCcwMDAwMCcgKyAoTWF0aC5yYW5kb20oKSAqIDB4MTAwMDAwMCA8PCAwKS50b1N0cmluZygxNikpLnN1YnN0cigtNik7wqDCoMKgwqDCoFxufVxuY29uc3Qg5YiG57G76aKc6ImyID0gZ2V0UmFuZ2VDb2xvcnMoKVxubGV0IHRydWVfdXJsID0gZ2V0TXlWYXIoJ2hlYWRlci51cmwnLCBNWV9VUkwpO1xuY29uc3QgcGFnZSA9IE1ZX1BBR0U7XG52YXIgaG9zdEFwaSA9IE1bMV07XG52YXIgdCA9IE1hdGguZmxvb3IobmV3IERhdGUoKS5nZXRUaW1lKCkgLyAxMDAwKS50b1N0cmluZygpO1xuZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGF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YXlVcmwocGxheVVybCkge1xuICAgICAgICBpZiAoL21ndHZ8c29odS8udGVzdChwbGF5VXJsKSkge1xuICAgICAgICAgICAgcmV0dXJuIHBsYXlVcmwgKyBcIjt7VXNlci1BZ2VudEBNb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wKX1cIjtcbiAgICAgICAgfSBlbHNlIGlmICgvYmlsaS8udGVzdChwbGF5VXJsKSkge1xuICAgICAgICAgICAgcmV0dXJuIHBsYXlVcmwgKyBcIjt7UmVmZXJlckBodHRwczovL3d3dy5iaWxpYmlsaS5jb219XCI7XG4gICAgICAgIH0gZWxzZSBpZiAoL2l4aWd1YS8udGVzdChwbGF5VXJsKSkge1xuICAgICAgICAgICAgcmV0dXJuIHBsYXlVcmwgKyBcIjt7VXNlci1BZ2VudEBNb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wKSYmUmVmZXJlckBodHRwczovL3d3dy5peGlndWEuY29tL31cIjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBwbGF5VXJsICsgXCIjaXNWaWRlbz10cnVlI1wiO1xuICAgICAgICB9XG4gICAgfVxuICAgIGlmIChpc19wYXJzZSA9PSBcIjFcIikge1xuICAgICAgICBsZXQgcGxheVVybCA9IGhvc3RBcGkgKyBcIi9hcGkvZ2V0UGFyc2VcIjtcbiAgICAgICAgdmFyIHQgPSBNYXRoLmZsb29yKG5ldyBEYXRlKCkuZ2V0VGltZSgpIC8gMTAwMCkudG9TdHJpbmcoKTtcbiAgICAgICAgbGV0IHBsYXlwYXJhbXMgPSB7XG4gICAgICAgICAgICBcInR5cGVcIjogdnR5cGUsXG4gICAgICAgICAgICBcInVybFwiOiBzcmMsXG4gICAgICAgICAgICBcInRpbWVzdGFtcFwiOiB0LFxuICAgICAgICAgICAgXCJzaWduXCI6IG1kNShcInRpbWVzdGFtcFwiICsgdCArIFwidHlwZVwiICsgdnR5cGUgKyBcInVybFwiICsgc3JjICsgXCJCRG1OS3pu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aNruWIl+ihqFxudmFyIHNldExpc3RzID0gZnVuY3Rpb24oZCwgcGRhdGEsIGxhenkpIHtcbiAgICB2YXIgcGRMaXN0cyA9IHBkYXRhLmxpc3Q7XG4gICAgdmFyIGxlbiA9IHBkTGlzdHMubGVuZ3RoO1xuICAgIGlmIChnZXRNeVZhcign6aG65bqPJywgJ+ato+W6jycpID09ICfpgIbluo8nKSB7XG4gICAgICAgIHBkTGlzdHMgPSBwZExpc3RzLnJldmVyc2UoKTtcbiAgICB9XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW47IGkrKykge1xuICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgdGl0bGU6IHBkTGlzdHNbaV0uaXRlbSxcbiAgICAgICAgICAgIHVybDogXCJoaWtlcjovL2VtcHR5IyNcIiArIHBkTGlzdHNbaV0uc3JjICsgXCIjI1wiICsgcGRMaXN0c1tpXS5pc19wYXJzZSArIFwiIyNcIiArIHBkYXRhLnR5cGUgKyBsYXp5LFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzMnLFxuICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICBpZDogcGRMaXN0c1tpXS5zcmMsXG4gICAgICAgICAgICAgICAgY2xzOiBNWV9SVUxFICsgXCJpdGVtaWRcIlxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG59XG5cbi8v57q/6Lev5Yy56YWN77yM5Yqg6L295a+55bqU5pWw5o2uXG50YWJzLmZvckVhY2goKFRhYm5hbWUsIGkpID0+IHtcbiAgICAvL2xvZyhUYWJuYW1lKVxuICAgIGQucHVzaCh7XG4gICAgICAgIHRpdGxlOiBnZXRNeVZhcigndGFibnVtJywgJzAnKSA9PSBpID8gZ2V0SGVhZChUYWJuYW1lKSA6IFRhYm5hbWUsXG4gICAgICAgIHVybDogJChcIiNub0xvYWRpbmcjXCIpLmxhenlSdWxlKChvcmRlcmlkLCBjbHMsIHNldExpc3RzLCBnZXRIZW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XFxcImxpc3RJdGVtc1xcXCI6IFt7XFxuICAgICAgICAgICAgXFxcImVOYW1lXFxcIjogXFxcImNsYXNzXFxcIixcXG4gICAgICAgICAgICBcXFwiaXRlbXNcXFwiOiBbe1xcbiAgICAgICAgICAgICAgICBcXFwiaWRcXFwiOiBpdC5jbGFzcyxcXG4gICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBpdC5jbGFzc1xcbiAgICAgICAgICAgIH1dXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgXFxcImVOYW1lXFxcIjogXFxcImFyZWFcXFwiLFxcbiAgICAgICAgICAgIFxcXCJpdGVtc1xcXCI6IFt7XFxuICAgICAgICAgICAgICAgIFxcXCJpZFxcXCI6IGl0LmFyZWEsXFxuICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogaXQuYXJlYVxcbiAgICAgICAgICAgIH1dXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgXFxcImVOYW1lXFxcIjogXFxcImxhbmdcXFwiLFxcbiAgICAgICAgICAgIFxcXCJpdGVtc1xcXCI6IFt7XFxuICAgICAgICAgICAgICAgIFxcXCJpZFxcXCI6IGl0LmxhbmcsXFxuICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogaXQubGFuZ1xcbiAgICAgICAgICAgIH1dXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgXFxcImVOYW1lXFxcIjogXFxcInllYXJcXFwiLFxcbiAgICAgICAgICAgIFxcXCJpdGVtc1xcXCI6IFt7XFxuICAgICAgICAgICAgICAgIFxcXCJpZFxcXCI6IGl0LnllYXIsXFxuICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogaXQueWVhclxcbiAgICAgICAgICAgIH1dXFxuICAgICAgICB9XVxcbiAgICB9XFxuICAgIHJldHVybiB0Y2F0ZXNcXG59XFxuXFxuXFxuLy/liIbnsbvmi7zmjqVcXG5sZXQgdGNhdGVzID0gW107XFxuaWYgKGdldE15VmFyKCdjaGF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9idXR0b24nLFxcbiAgICB9KVxcbiAgICAvL2xvZyhjYXRlZ29yaWVzLmxlbmd0aClcXG4gICAgY2F0ZWdvcmllcy5mb3JFYWNoKChjYXRlZ29yeSwgaW5kZXgpID0+IHtcXG4gICAgICAgIC8vbG9nKGNhdGVnb3J5KVxcbiAgICAgICAgbGV0IGNsYXNzX2tleSA9IGNhdGVnb3J5LmVOYW1lO1xcbiAgICAgICAgbGV0IHN1Yl9jYXRlZ29yaWVzID0gY2F0ZWdvcnkuaXRlbXM7XFxuICAgICAgICAvL2xvZyhzdWJfY2F0ZWdvcmllcykgICAgXFxuICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcXG4gICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gaXRlbS5uYW1lO1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjogJyArIOWIhuexu+minOiJsiArICdcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChpdGVtLmlkICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2hlYWRlci5jYXRlZ29yeScsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuY2xhc3Nfa2V5LCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjbGFzcycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2FyZWEnKTsgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3llYXInKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdsYW5nJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3Nfa2V5OiBjbGFzc19rZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09ICcxJykge1xcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gY2F0ZWdvcnkuaXRlbXNbMF0ubmFtZTtcXG4gICAgICAgICAgICBsZXQgaWQgPSBjYXRlZ29yeS5pdGVtc1swXS5pZDtcXG4gICAgICAgICAgICAvL2xvZyhzdWJfY2F0ZWdvcmllcy5sZW5ndGgpXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBpdGVtO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVpZCA9IGlkW2tleV07XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyh1aWQpXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICcgKyDliIbnsbvpopzoibIgKyAnXFxcIj4nICsgdGl0bGUgKyAnPC9zcGFuPjwvYj4nIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHVpZCArICcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdoZWFkZXIuY2F0ZWdvcnknLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2cocGFyYW1zLmNsYXNzX2tleSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuY2xhc3Nfa2V5LCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzX2tleTogY2xhc3Nfa2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgbG9nKHN1Yl9jYXRlZ29yaWVzKVxcbiAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgfVxcblxcbiAgICB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AgICBcXFwidGltZXN0YW1wXFxcIjogdCxcXG4gICAgICAgICAgICBcXFwic2lnblxcXCI6IG1kNShcXFwiaWQ5NTI4NzF0aW1lc3RhbXBcXFwiICsgdCArIFxcXCJCRG1OS3puZUdQUVRYdTZFXFxcIilcXG4gICAgICAgIH0sXFxuICAgICAgICBtZXRob2Q6IFxcXCJwb3N0XFxcIlxcbiAgICB9KVxcbiAgICAvL2xvZyhsb2dpbkh0bWwpICAgICAgICBcXG4gICAgbGV0IGxvZ1QgPSBKU09OLnBhcnNlKEFFU0Rjb2RlKEpTT04ucGFyc2UobG9naW5IdG1sKS5kYXRhKSk7ICBcXG4gICAgLy9sb2cobG9nVCkgIFxcbiAgICBsZXQgQXV0aG9yaXphdGlvbiA9IGxvZ1QudG9rZW5fdHlwZSArIFxcXCIgXFxcIiArIGxvZ1QudG9rZW47XFxuICAgIHJldHVybiBBdXRob3JpemF0aW9uXFxufVwifV0iLCJpY29uIjoiaHR0cHM6Ly90MS5zenJ0Y3BhLmNvbS8yMDIyLzA3LzEyLzg4YzJmMTYxMzM1N2UucG5nQFJlZmVyZXI9IiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment