Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@撸源@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5pK45rqQIiwiYXV0aG9yIjoiIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjI2Z5QWxsIiwidmVyc2lvbiI6MCwiY29sX3R5cGUiOiJtb3ZpZV8yIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJsaXZlIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIgZGF0YSA9IFtdO1xuZGF0YS5wdXNoKHtcbiAgICB0aXRsZTogXCLwn5SOXCIsXG4gICAgdXJsOiBcIidoaWtlcjovL3NlYXJjaD9ydWxlPVwiICsgTVlfUlVMRS50aXRsZSArIFwiJnM9JytpbnB1dFwiLFxuICAgIGRlc2M6IFwi5pCc57Si6aKR6YGTXCIsXG4gICAgY29sX3R5cGU6IFwiaW5wdXRcIlxufSlcbnZhciBzMiA9ICdodHRwOi8vYXBpLmJ0c3R1LmNuL3NqYno/Z2xpZGVDYWNoZT1za2lwJyArICcjJyArIG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xuLypmdW5jdGlvbiBnZXRUaXRsZUFuZERlc2MoKSB7XG4gICAgbGV0IGhpdG9rb3RvID1bXTtcbiAgICBsZXQganNvbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2h0dHBzOi8vdjEuaGl0b2tvdG8uY24vP2M9aScsIHt9KSk7XG4gICAgbGV0IHNvdXJjZSA9IGpzb24uZnJvbV93aG87XG4gICAgaWYgKHNvdXJjZSA9PSBudWxsKSBzb3VyY2UgPSAn5pyq55+lJztcbiAgICBoaXRva290by5wdXNoKGpzb24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2UpO1xuICAgIC8vIGxvZyhpdGVtcyk7XG4gICAgLy8gbGV0IGdyb3VwcyA9IE9iamVjdC5rZXlzKGl0ZW1zKTtcbiAgICAvLyBncm91cHMucHVzaChncm91cHMuc3BsaWNlKGdyb3Vwcy5pbmRleE9mKDApLCAxKVswXSk7XG4gICAgLy8gbGV0IHNlbGVjdEdyb3VwID0gZ2V0TXlWYXIoJ3NlbGVjdEdyb3VwJywgZ3JvdXBzWzBdKTtcbiAgICAvLyBpZiAoc2VsZWN0R3JvdXAgPT0gXCJcIikgc2VsZWN0R3JvdXAgPSBncm91cHNbMF07XG4gICAgLy8gZ3JvdXBzLmZvckVhY2goKGdyb3VwKSA9PiB7XG4gICAgLy8gICAgIGlmIChncm91cCkge1xuICAgIC8vICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAvLyAgICAgICAgICAgICB0aXRsZTogZ3JvdXAgPT0gc2VsZWN0R3JvdXAgPyBcIuKAnOKAnOKAneKAnTxzcGFuIHN0eWxlPSdjb2xvcjogIzE5Qjg5RCc+XCIgKyBncm91cCArIFwiPC9zcGFuPlwiIDogZ3JvdXAsXG4gICAgLy8gICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChncm91cCkgPT4ge1xuICAgIC8vICAgICAgICAgICAgICAgICBwdXRNeVZhcignc2VsZWN0R3JvdXAnLCBncm91cCk7XG4gICAgLy8gICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XG4gICAgLy8gICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcbiAgICAvLyAgICAgICAgICAgICB9LCBncm91cCksXG4gICAgLy8gICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcbiAgICAvLyAgICAgICAgICAgICBleHRyYToge1xuICAgIC8vICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcbiAgICAvLyAgICAgICAgICAgICB9XG4gICAgLy8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U5GLio/LC4qP1xcc2h0dHAuKj9cXHMvZylcbiAgICAvLyAvLyBsZXQgbSA9IC8oLio/KSwoLio/KVxccysoKGh0dHB8cnRtcClbXiNcXHNdKikvZ1xuICAgIC8vIC8vIGxldCBhID0gbS5leGVjKG0zdSlcbiAgICAvLyAvLyBsb2coYSlcbiAgICAvLyBiID0gLy4qP3R2Zy1sb2dvPVwiKC4qPylcIi4qP2dyb3VwLXRpdGxlPVwiKC4qPylcIiwoLio/KVxccysoKHt8dmlkZW98aHR0cHxydG1wKVteI1xcc10qKS9nO1xuICAgIC8vIGxldCBjO1xuICAgIC8vIGxldCBncm91cHMgPSBuZXcgU2V0KCk7XG4gICAgLy8gd2hpbGUgKChjID0gYi5leGVjKG0zdSkpKSB7XG4gICAgLy8gICAgIGxldCB0aXRsZSA9IGNbM107XG4gICAgLy8gICAgIGxldCB1cmwgPSBjWzRdO1xuICAgIC8vICAgICBsZXQgZ3JvdXAgPSBjWzJdO1xuICAgIC8vICAgICBncm91cHMuYWRkKGdyb3VwKVxuICAgIC8vICAgICBsZXQgc2VsZWN0R3JvdXAgPSBnZXRNeVZhcignc2VsZWN0R3JvdXAnKVxuICAgIC8vICAgICBpZiAoc2VsZWN0R3JvdXAgPT09IGdyb3VwIHx8IHNlbGVjdEdyb3VwID09PSAn5YWo6YOoJykge1xuICAgIC8vICAgICAgICAgLy8gbGV0IGkgPSBkYXRhLmZpbmRJbmRleChkID0+IGQudGl0bGUuaW5jbHVkZXModGl0bGUpKVxuICAgIC8vICAgICAgICAgbGV0IGk9LTFcbiAgICAvLyAgICAgICAgIGlmICh+aSkge1xuICAgIC8vICAgICAgICAgICAgIGRhdGFbaV0udXJsLnVybHMucHVzaCh1cmwpXG4gICAgLy8gICAgICAgICB9IGVsc2Uge1xuICAgIC8vICAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgLy8gICAgICAgICAgICAgICAgIGltZzogY1sxXSxcbiAgICAvLyAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxuICAgIC8vICAgICAgICAgICAgICAgICB1cmw6IHsgdXJsczogW3VybF0gfVxuICAgIC8vICAgICAgICAgICAgIH0pO1xuICAgIC8vICAgICAgICAgfVxuICAgIC8vICAgICB9XG4gICAgLy8gfVxuICAgIC8vIGxldCBkID0gQXJyYXkuZnJvbShncm91cHMpXG4gICAgLy8gZC51bnNoaWZ0KCflhajpg6gnKVxuICAgIC8vIGdldE15VmFyKCdzZWxlY3RHcm91cCcpIHx8IHB1dE15VmFyKCdzZWxlY3RHcm91cCcsICflhajpg6gnKTtcbiAgICAvLyBkID0gZC5tYXAoZ3JvdXAgPT4gKHtcbiAgICAvLyAgICAgdGl0bGU6IGdyb3VwID09IGdldE15VmFyKCdzZWxlY3RHcm91cCcpID8gXCLigJzigJzigJ3igJ08c3BhbiBzdHlsZT0nY29sb3I6ICMxOUI4OUQnPlwiICsgZ3JvdXAgKyBcIjwvc3Bhbj5cIiA6IGdyb3VwLFxuICAgIC8vICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGdyb3VwKSA9PiB7XG4gICAgLy8gICAgICAgICBwdXRNeVZhcignc2VsZWN0R3JvdXAnLCBncm91cCk7XG4gICAgLy8gICAgICAgICByZWZyZXNoUGFnZSgpO1xuICAgIC8vICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xuICAgIC8vICAgICB9LCBncm91cCksXG4gICAgLy8gICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXG4gICAgLy8gICAgIGV4dHJhOiB7XG4gICAgLy8gICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcbiAgICAvLyAgICAgfVxuICAgIC8vIH0pKVxuICAgIC8vIHN0b3JhZ2UwLnB1dE15VmFyKCdncm91cHMnLCBkKVxuICAgIC8vIC8vIGxvZyhkKVxuICAgIC8vIGQudW5zaGlmdCg0LCAwKVxuICAgIC8vIEFycmF5LnByb3RvdHlwZS5zcGxpY2UuYXBwbHk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zogXCJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8yMjgucG5nXCJcbiAgICAvLyAgICAgICAgIH0pXG4gICAgLy8gICAgIH1cbiAgICAvLyB9XG4gICAgY29uc3QgbGlzdCA9IHN0b3JhZ2UwLmdldE15VmFyKCdsaXN0Jyk7XG4gICAgLy8gbG9nKGxpc3RbMF0pXG4gICAgZm9yIChsZXQgZCBvZiBsaXN0KSB7XG4gICAgICAgIGxldCBncm91cCA9IEFycmF5LmZyb20obmV3IFNldChkLmdyb3VwKSlcbiAgICAgICAgaWYgKGdyb3VwLmluY2x1ZGVzKGtleXdvcmQpIHx8IGQudGl0bGUuaW5jbHVkZXMoa2V5d29yZCkpIHtcbiAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IGQudGl0bGUsXG4gICAgICAgICAgICAgICAgaW1nOiBkLmltZ1tNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiBkLmltZy5sZW5ndGgpXSxcbiAgICAgICAgICAgICAgICBkZXNjOiBncm91cC5qb2luKCcgwrcgJyksXG4gICAgICAgICAgICAgICAgdXJsOiBkLnVybC5sZW5ndGggPT09IDEgPyBsYXp5UnVsZShkLnVybFswXSkgOiAoeyB1cmxzOiBkLnVybCB9KVxuICAgICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgIH1cbn0gY2F0Y2ggKGUpIHtcbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogXCLmlbDmja7liqDovb3lpLHotKVcIixcbiAgICAgICAgZGVzYzogSlNPTi5zdHJpbmdpZnkoZSksXG4gICAgICAgIGNvbF90eXBlOiBcInRleHRfMVwiXG4gICAgfSlcbn1cbi8vIGZvciAobGV0IGl0IG9mIGRhdGEpIHtcbi8vICAgICBpZiAoIWl0LmNvbF90eXBlICYmIGl0LnVybCAmJiAhaXQudXJsLnN0YXJ0c1dpdGgoXCJ7XCIpKSB7XG4vLyAgICAgICAg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gICAgICAgLy9sb2coaik7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIC8vdXJsID0gdXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChmaWx0ZXIgIT0gbnVsbCAmJiAhdGl0bGUuaW5jbHVkZXMoZmlsdGVyKSkge1xcbiAgICAgICAgICAgIGNvbnRpbnVlXFxuICAgICAgICB9XFxuICAgICAgICBpZiAoaXRlbXNbZ3JvdXBdKSB7XFxuICAgICAgICAgICAgaWYgKGl0ZW1zW2dyb3VwXVt0aXRsZV0pIHtcXG4gICAgICAgICAgICAgICAgaXRlbXNbZ3JvdXBdW3RpdGxlXSA9IGl0ZW1zW2dyb3VwXVt0aXRsZV0uY29uY2F0KFt1cmxdKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpdGVtc1tncm91cF1bdGl0bGVdID0gW3VybF07XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBpdGVtc1tncm91cF0gPSB7fTtcXG4gICAgICAgICAgICBpdGVtc1tncm91cF1bdGl0bGVdID0gW3VybF07XFxuICAgICAgICB9O1xcbiAgICB9XFxuICAgIHJldHVybiBpdGVtcztcXG59XFxuJC5leHBvcnRzID0ge1xcbiAgICByZW5kZXJMaXZlRGF0YTogcmVuZGVyTGl2ZURhdGEsXFxufVwifV0iLCJpY29uIjoiaHR0cHM6Ly96aGVuZ3hpbi1wdWIuY2RuLmJjZWJvcy5jb20vbG9nb3BpYy8wNjc2ZjI3OTY1MmFkODk5OWQwYmUxOGQ3NGU4ZDIwOV9mdWxsc2l6ZS5qcGciLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment