Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥月光骑士@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZGlzcGxheU5hbWVcIjpcIuebiui+vuW9semZolwiLFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJqczooXFxuZnVuY3Rpb24gKGFwcHR5cGUsIGFwcFVybCkge1xcbiAgICBsZXQgY2hwID0gW107XFxuICAgIHRyeSB7XFxuICAgICAgICBsZXQgY29udHMgPSBbXSwgaHRtbCA9IEpTT04ucGFyc2UoZmV0Y2goTVlfVVJMLnNwbGl0KFxcXCIjI1xcXCIpWzFdLCB7aGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogXFxcIkRhcnQvMi4xMyAoZGFydDppbylcXFwifX0pKTtcXG4gICAgICAgIGlmIChhcHB0eXBlLmluY2x1ZGVzKFxcXCJUVlxcXCIpKSB7XFxuICAgICAgICAgICAgY29udHMgPSBPYmplY3Qua2V5cyhodG1sLnZpZGVvbGlzdCk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGlmIChhcHBVcmwuaW5jbHVkZXMoXFxcImFwaS5waHAvYXBwL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgIGNvbnRzID0gaHRtbC5kYXRhLnZvZF91cmxfd2l0aF9wbGF5ZXI7XFxuICAgICAgICAgICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV91cmwuc3BsaXQoXFxcIiQkJFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKGFwcFVybC5pbmNsdWRlcyhcXFwieGdhcHAucGhwL3YxL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfaW5mby52b2RfdXJsX3dpdGhfcGxheWVyO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRzLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfaW5mby52b2RfcGxheV91cmwuc3BsaXQoXFxcIiQkJFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX3BsYXlfbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX3BsYXlfdXJsLnNwbGl0KFxcXCIkJCRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBsaXN0ID0gW107XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvbnRzLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgaWYgKGFwcHR5cGUuaW5jbHVkZXMoXFxcIlRWXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IGh0bWwudmlkZW9saXN0W2NvbnRzW2ldXTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAoY29udHNbaV0udXJscykge1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGNvbnRzW2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kej5p6QXCIsXCJwYXRoXCI6XCJsYXp5UGFyc2VcIixcInJ1bGVcIjpcIihcXG5mdW5jdGlvbiAoKSB7XFxuICAgIHJldHVybiAkKFxcXCJcXFwiKS5sYXp5UnVsZSgocHRhYiwgdmxpbmssIGp4VXJsLCBhcHBVcmwpID0+IHtcXG4gICAgICAgIGxvZyhcXFwiXFxcXHU4OWM2XFxcXHU5ODkxXFxcXHU5NGZlXFxcXHU2M2E1OlxcXCIgKyB2bGluayk7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGZ1bmN0aW9uIGNoYW5nZVZpZGVvVXJsKHVybCkge1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLmluY2x1ZGVzKFxcXCJ3a2ZpbGVcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsICsgXFxcIjt7UmVmZXJlckBodHRwczovL2ZhbnR1YW4ud2tmaWxlLmNvbS99XFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwdGFiID09IFxcXCJiaWxpYmlsaVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyBcXFwiO3tSZWZlcmVyQGh0dHBzOi8vd3d3LmJpbGliaWxpLmNvbS8mJlVzZXItQWdlbnRATW96aWxsYS81LjB9XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIgPT0gXFxcIm1ndHZcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IHVybCArIFxcXCI7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5pbmNsdWRlcyhcXFwib2pia1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyBcXFwiO3tSZWZlcmVyQGh0dHBzOi8vYmFrLm9qYmtqeC5jb20vfVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwuaW5jbHVkZXMoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCJcXFxcdTk0ZmVcXFxcdTYzYTVcXFxcdTRlMGRcXFxcdTY2MmZcXFxcdTRlZTVodHRwXFxcXHU1ZjAwXFxcXHU1OTM0XFxcIik7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFwubTN1OC8udGVzdCh1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhY2hlTTN1OCh1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoL1xcXFwubTN1OHxcXFxcLm1wNHxvYmpcXFxcL3Rvc3xuZXRlYXNlXFxcXC5jb20vLnRlc3QodmxpbmspICYmIC9odHRwLy50ZXN0KHZsaW5rKSAmJiAhL1xcXFwuaHRtbC8udGVzdCh2bGluaykpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHB1cmwgPSB2bGluaztcXG4gICAgICAgICAgICAgICAgaWYgKHB0YWIuaW5jbHVkZXMoXFxcImR1b2R1b3p5XFxcIikgfHwgdmxpbmsuaW5jbHVkZXMoXFxcIm0zdTguY2FjaGUuc3VveW8uY2NcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIERlKHdvcmQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKG1kNShcXFwiclhqV3ZYbDZcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShcXFwiTlhiSG9XSmJwc0VPaW44YlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBDcnlwdG9KUy5BRVMuZGVjcnlwdCh3b3JkLCBhLCB7aXY6IHQsIG1vZGU6IENyeXB0b0pTLm1vZGUuQ0JDLCBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczd9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBwdXJsID0gRGUoSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9qaHBjLm1hbmR1aHUuY29tL2R1b2R1by9hcGkucGhwP3VybD1cXFwiICsgdmxpbmspKS51cmwpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIuaW5jbHVkZXMoXFxcIkNMNEtcXFwiKSB8fCB2bGluay5pbmNsdWRlcyhcXFwicnVpZmVuZ2xiXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKFxcXCJodHRwczovL3R2LnlqaGFuLmNvbTo0NDMzL0NMNEsvP3VybD1cXFwiICsgdmxpbmspLCB0b2tlbiA9IGh0bWwubWF0Y2goL2xlX3Rva2VuLio9LipcXFwiKC4qKVxcXCIvKVsxXSwgdXJsID0gaHRtbC5tYXRjaCgvXFxcInVybFxcXCIuKjouKlxcXCIoLiopXFxcIi8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZ2V0Q3J5cHRvSlMoKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gRGUod29yZCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIga2V5ID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UoXFxcIkE0MkVBQzBDMkI0MDg0NzJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGl2ID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UodG9rZW4pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQ3J5cHRvSlMuQUVTLmRlY3J5cHQod29yZCwga2V5LCB7aXY6IGl2LCBtb2RlOiBDcnlwdG9KUy5tb2RlLkNCQywgcGFkZGluZzogQ3J5cHRvSlMucGFkLlBrY3M3fSkudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXJsID0gRGUodXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gY2hhbmdlVmlkZW9VcmwocHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwdGFiLmluY2x1ZGVzKFxcXCJuZXRmbGl4bW9tXFxcIikgfHwgL15uZXRmbGl4bW9tLy50ZXN0KHZsaW5rKSkge1xcbiAgICAgICAgICAgICAgICBqeFVybCA9IFxcXCJodHRwczovL2RwLmtvbmdidXlhLmNvbS9qc29uLnBocD91cmw9XFxcIjtcXG4gICAgICAgICAgICB9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XFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5pbmNsdWRlcyhcXFxcXFxcIm9qYmtcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsICsgXFxcXFxcXCI7e1JlZmVyZXJAaHR0cHM6Ly9iYWsub2pia2p4LmNvbS99XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmICghdXJsLmluY2x1ZGVzKFxcXFxcXFwiaHR0cFxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcXFxcXCJcXFxcXFxcXHU5NGZlXFxcXFxcXFx1NjNhNVxcXFxcXFxcdTRlMGRcXFxcXFxcXHU2NjJmXFxcXFxcXFx1NGVlNWh0dHBcXFxcXFxcXHU1ZjAwXFxcXFxcXFx1NTkzNFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFxcXFxcLm0zdTgvLnRlc3QodXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhY2hlTTN1OCh1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXFxcXFwiI2lzVmlkZW89dHJ1ZSNcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIG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sb2NhdGlvblswXS5yZXBsYWNlKC9cXFxcXFxcXFxcXFxcXFxcL2csIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGxvZyhcXFxcXFxcIlxcXFxcXFxcdTkxY2RcXFxcXFxcXHU1YjlhXFxcXFxcXFx1NTQxMTpcXFxcXFxcIiArIHJlZHVybCk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHB1cmwgPSByZWR1cmw7XFxcXG4gICAgICAgICAgICAgICAgaWYgKC9cXFxcXFxcXD1odHRwLy50ZXN0KHJlZHVybCkgJiYgL2h0bWx8YmlsaWJpbGkvLnRlc3QocmVkdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXJsID0gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXFxcXFw9aHR0cC8udGVzdChyZWR1cmwpICYmIC9cXFxcXFxcXC5tM3U4fFxcXFxcXFxcLm1wNHxcXFxcXFxcXC5mbHYvLnRlc3QocmVkdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHVybCA9IHJlZHVybC5zdWJzdHJpbmcocmVkdXJsLmluZGV4T2YoXFxcXFxcXCI9aHR0cFxcXFxcXFwiKSArIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiBjaGFuZ2VWaWRlb1VybChwdXJsKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBodG1sID0gc2NvZGUuYm9keTtcXFxcbiAgICAgICAgICAgIGlmICgvNDA0IE5vdCBGb3VuZHzlpIfmoYjlkI7lj6/nu6fnu63orr/pl64vLnRlc3QoaHRtbCkpIHtcXFxcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJ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JcXFxcXFxcXC18cmVucmVubWlcXFxcXFxcXC18eGZ5XFxcXFxcXFwtLykgIT0gLTE7XFxcXG4gICAgICAgICAgICBpZiAoKHRlc3QxIHx8IHRlc3QyKSAmJiBlbkRuID09IFxcXFxcXFwiMVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgbG9nKFxcXFxcXFwiXFxcXFxcXFx1OGMwM1xcXFxcXFxcdTc1MjhcXFxcXFxcXHU2NWFkXFxcXFxcXFx1NjNkMlxcXFxcXFxcdTg5ZTNcXFxcXFxcXHU2NzkwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGV2YWwoXFxcXFxcXCJsZXQgY29uZmlnID1cXFxcXFxcIiArIGZldGNoKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZSh2bGluayk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiB2bGluaztcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICAsIHB0YWIsIHZsaW5rLCBqeFVybCwgYXBwVXJsKTtcXFxcbn1cXFxcbikoKVxcXCJ9XVwifSIsInBpY1VybCI6Imh0dHA6Ly90dS5obm1qLnZpcC90dS91cGxvYWQvdm9kLzIwMjIwMzMwLTEvYjc3MDU3NjkwMTQ5YWVhMjU3ZWFkMTAzNmZlMWI5NWQuanBnQFJlZmVyZXI9IiwidGl0bGUiOiLmnIjlhYnpqpHlo6sifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement