Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@巨魔@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5beo6a2UIiwiYXV0aG9yIjoiQExveURnSWsiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IyNmeWNsYXNzIiwidmVyc2lvbiI6MCwiY29sX3R5cGUiOiJpY29uX3JvdW5kXzQiLCJjbGFzc19uYW1lIjoi6aaW6aG1JuaJqeWxlSbnu7zlkIgiLCJ0eXBlIjoidmlkZW8iLCJjbGFzc191cmwiOiLpppbpobUm5omp5bGVJue7vOWQiCIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxubGV0IHNwID0gKGl0LCBzLCBlKSA9PiBTdHJpbmcoaXQuc3BsaXQocylbMV0pLnNwbGl0KGUpWzBdO1xubGV0IGQgPSBbXTtcblxuaWYgKE1ZX0NMQVNTX1VSTCA9PT0gXCLpppbpobVcIikge1xuICAgIGxldCBzb3VyY2UgPSBmZXRjaChcImh0dHA6Ly9hcGkueGthMS50b3AvcWllemkvc2hvdXllLnR4dFwiLCB7XG4gICAgICAgIGhlYWRlcnM6IHtcbiAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnY2hhcnNldD1HQksnXG4gICAgICAgIH1cbiAgICB9KTtcblxuICAgIGZ1bmN0aW9uIGdldFZpZXcodGl0bGUsIHR5cGUpIHtcbiAgICAgICAgaWYgKHR5cGUgPT09IFwi5b+r54yrXCIpIHtcbiAgICAgICAgICAgIHJldHVybiBcImhpa2VyOi8vcGFnZS9rdWFpbWFvLnY/cGFnZT1meXBhZ2VcIjtcbiAgICAgICAgfWVsc2UgaWYodHlwZSA9PT0gXCLnjKvlkqpcIil7XG4gICAgICAgICA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h0dHA6Ly9hcGkueGthMS50b3BcIiArIHNwKGl0LCBcInRwKFwiLCBcIiltY1wiKSxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcImljb25fNF9jYXJkXCIsXG4gICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgIGtleTogc3AoaXQsIFwiZ2pjKFwiLCBcIilcIiksXG4gICAgICAgICAgICAgICAgYXBpOiBzcChpdCwgXCJ5bShcIiwgXCIpXCIpLFxuICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogdGl0bGVcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgIH0pO1xufSBlbHNlIGlmIChNWV9DTEFTU19VUkwgPT09IFwi5omp5bGVXCIpIHtcbiAgICBsZXQgc291cmNlID0gZmV0Y2goXCJodHRwOi8veXMtai55c2VwYW4uY29tLzYwOTg1NzE1Ni8wMTQ2NzEzODYvaDQ5NjU0NDU3RjVROEpjbXRPclRKNzYvJUU2JTg5JUE5JUU1JUIxJTk1MDkudHh0XCIsIHtcbiAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdjaGFyc2V0PUdCSydcbiAgICAgICAgfVxuICAgIH0pO1xuXG4gICAgbGV0IG1pYW5EYXRhID0gc291cmNlLnNwbGl0KFwi5omp5bGV5pWw5o2u57uT5p2fXCIpWzBdLnNwbGl0KFwi5omp5bGV5pWw5o2u5byA5aeLXCIpWzFdIHx8IFwiXCI7XG4gICAgbWlhbkRhdGEgPSBtaWFuRGF0YS50cmltKCkuc3BsaXQoXCLmjaLooYxcIik7XG4gICAgZCA9IG1pYW5EYXRhLm1hcChpdCA9PiB7XG4gICAgICAgIGl0ID0gaXQudHJpbSgpO1xuICAgICAgICBsZXQgdGl0bGUgPSBzcChpdCwgXCJtYyhcIiwgXCIpXCIpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxuICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9vcGVuP3J1bGU96JOd5aWP5LqR55uY8J+QkVwiLFxuICAgICAgICAgICAgcGljX3VybDogc3AoaXQsIFwidHAoXCIsIFwiKW1jXCIpLFxuICAgICAgICAgICAgY29sX3R5cGU6IFwiaWNvbl80X2NhcmRcIixcbiAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgc3VybDpzcChpdCwgXCJ5bShcIiwgXCIpXCIpLFxuICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogdGl0bGVcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgIH0pO1xufSBlbHNlIGlmIChNWV9DTEFTU19VUkwgPT09IFwi57u85ZCIXCIpIHtcbiAgICBsZXQgc291cmNlID0gZmV0Y2goXCJodHRwOi8veXMtai55c2VwYW4uY29tLzYwOTg1NzE3Mi8wMTQ2NzEzODcvaTY2NjM0Njc1R082V2JqeVJvUUthNi8lRTYlOTclQTAlRTYlOUUlODF6b25naGUudHh0XCIsIHtcbiAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdjaGFyc2V0PUdCSydcbiAgICAgICAgfVxuICAgIH0pO1xuXG4gICAgbGV0IG1pYW5EYXRhID0gc291cmNlLnNwbGl0KFwi57u85ZCI5pWw5o2u57uT5p2fXCIpWzBdLnNwbGl0KFwi57u85ZCI5pWw5o2u5byA5aeLXCIpWzFdIHx8IFwiXCI7XG4gICAgbWlhbkRhdGEgPSBtaWFuRGF0YS50cmltKCkuc3BsaXQoXCLmjaLooYxcIik7XG4gICAgZCA9IG1pYW5EYXRhLm1hcChpdCA9PiB7XG4gICAgICAgIGl0ID0gaXQudHJpbSgpO1xuICAgICAgICBsZXQgdGl0bGUgPSBzcChpdCwgXCJtYyhcIiwgXCIpXCIpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxuICAgICAgICAgICAgdXJsOiBcIng1Oi8vX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AgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBpdC51cGRhdGVfYXQgKyBcXFwiXFxcXG5cXFwiICsgaXQudmlkZW9fbmFtZSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdC5pbWFnZSxcXG4gICAgICAgICAgICB1cmw6IGl0LnZpZGVvX2lkK2xhenksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJwaWNfMl9jYXJkXFxcIixcXG4gICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbn0gY2F0Y2ggKGUpIHtcXG5cXG59XFxuc2V0UmVzdWx0KGQpO1wifV0iLCJpY29uIjoiIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment