xiaomianao666

小程序:福利吧Ⓜ️

Apr 7th, 2023
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@福利吧Ⓜ️@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi56aP5Yip5ZCn4pOC77iPIiwiYXV0aG9yIjoiIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSNmeUFsbCNmeXBhZ2UjaHR0cHM6Ly9mdWxpYmEyMDIzLm5ldCIsInZlcnNpb24iOjEsImNvbF90eXBlIjoibW92aWVfMV92ZXJ0aWNhbF9waWMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6Im5ld3MiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbi8v5Lul5LiL5pivIOWIl+ihqOino+aekOinhOWIme+8iEpT77yJXG52YXIgcmVzID0ge307XG52YXIgaXRlbSA9IFtdO1xuXG4vLyB2YXIgdHlwZT1NWV9VUkwuc3BsaXQoJyMnKVsxXTtcbnZhciBwYWdlPU1ZX1VSTC5zcGxpdCgnIycpWzJdO1xudmFyIG1Vcmw9TVlfVVJMLnNwbGl0KCcjJylbM107XG5cbmlmKGdldE15VmFyKCdmdWxpYmEudGl0bGVDb2xvcicpPT1cIlwiKSBwdXRNeVZhcignZnVsaWJhLnRpdGxlQ29sb3InLFwiI0ZBNzI5OFwiKTtcbmlmKGdldE15VmFyKCdmdWxpYmEuZGVzY0NvbG9yJyk9PVwiXCIpIHB1dE15VmFyKCdmdWxpYmEuZGVzY0NvbG9yJyxcIiM3MDgwOTBcIik7XG5cbmlmKGdldE15VmFyKCdmdWxpYmEuY2F0ZWdvcnlOdW0nKT09XCJcIikgcHV0TXlWYXIoJ2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IC5yZXBsYWNlV2l0aENhbGxiYWNrKC88KHNvdXJjZXx2aWRlbykoW1xcc1xcU10qPyk8XFwvKHNvdXJjZXx2aWRlbyk+L2csICc8dmlkZW8gZGF0YS12PicsIHZpZGVvVGFnUmVwbGFjZW1lbnQyKTtcbiAgICAgICAgICAgIC8vIC5yZXBsYWNlKC88cD48XFwvcD4vZywnJyk7XG5cblxuXG4gICAgICAgIGxldCB0ZW1wID0gcGFyc2VEb21Gb3JIdG1sKGdldE5ld1RleHQocXVvdGVDb250ZW50LCdkaXYnKSwgJ1RleHQnKTtcbiAgICAgICAgaWYoZ2V0TXlWYXIoJ2Z1bGliYS5zaG93TW9kZScpPT0nMycpe1xuICAgICAgICAgICAgaWYoIXRlbXAubWF0Y2goL15cXHMqJC8pKSBodG1sTGlzdCArPSAn4peHJm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7JyArIHRlbXAgKyAnPGJyPic7XG4gICAgICAgICAgICBpZihqPT1jb250ZW50bGlzdC5sZW5ndGgtMSAmJiBodG1sTGlzdCAhPT0gJycpe1xuICAgICAgICAgICAgICAgIGQucHVzaCh7dGl0bGU6IGh0bWxMaXN0LFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgY2xpY2s6IHRydWVcbiAgICAgICAgICAgICAgICB9fSk7XG4gICAgICAgICAgICAgICAgaHRtbExpc3QgPSAnJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfWVsc2V7XG4gICAgICAgICAgICBpZighdGVtcC5tYXRjaCgvXlxccyokLykgfHwgcXVvdGVDb250ZW50LmluY2x1ZGVzKCdibG9ja3F1b3RlPicpIHx8IChxdW90ZUNvbnRlbnQuaW5jbHVkZXMoJ2Rpdj4nKSAmJiBxdW90ZUNvbnRlbnQubWF0Y2goLzwoZGl2KShbXFxzXFxTXSo/KTxcXC8oZGl2KT4vZykgPT0gbnVsbCkpIGh0bWxMaXN0ICs9IHF1b3RlQ29udGVudDtcbiAgICAgICAgICAgIGlmKGltZ2xpc3QubGVuZ3RoID4gMCB8fCBqPT1jb250ZW50bGlzdC5sZW5ndGgtMSl7XG4gICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBwYXJzZURvbUZvckh0bWwoZ2V0TmV3VGV4dChodG1sTGlzdCwnZGl2JyksICdUZXh0Jyk7XG4gICAgICAgICAgICAgICAgaWYoIXRlbXAubWF0Y2goL15cXHMqJC8pICYmIGdldE15VmFyKCdmdWxpYmEuc2hvd01vZGUnKSE9PScxJykgZC5wdXNoKHt0aXRsZTogaHRtbExpc3QsXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiBzaXplLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaWNrOiB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICB9fSk7XG4gICAgICAgICAgICAgICAgaHRtbExpc3QgPSAnJztcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGltZ2xpc3QubGVuZ3RoOyBrKyspe1xuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDppbWdsaXN0W2tdLFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOmdldE15VmFyKCdmdWxpYmEuYnJvd3NlckxpbmsnKStpbWdsaXN0W2tdLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6Z2V0TXlWYXIoJ2Z1bGliYS5iaWdJbWcnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IHNpemUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpY2s6IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAg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ICAgICAgICAgY29sX3R5cGU6Z2V0TXlWYXIoJ2Z1bGliYS5iaWdJbWcnKVxuICAgIC8vICAgICB9KTtcbiAgICAvLyB9XG59ZWxzZXtcbiAgICAvLyBpZihnZXRNeVZhcignZnVsaWJhLnNob3dNb2RlJyk9PScxJykgY29udGVudCA9IEdldEltZ1RhZ0FycmF5KGNvbnRlbnQsLzxpbWcoW1xcc1xcU10qPyk+L2cpO1xuICAgIGlmKGdldE15VmFyKCdmdWxpYmEuc2hvd01vZGUnKT09JzEnKXtcbiAgICAgICAgbGV0IG1hdGNoQXJyYXkgPSBjb250ZW50Lm1hdGNoKC88aW1nKFtcXHNcXFNdKj8pPi9nKTtcbiAgICAgICAgbGV0IGltZ2xpc3QgPSAnJztcbiAgICAgICAgaWYgKG1hdGNoQXJyYXkgIT0gbnVsbCkge1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXRjaEFycmF5Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IHBpYyA9IG1hdGNoQXJyYXlbaV0gLnJlcGxhY2VXaXRoQ2FsbGJhY2soLzxpbWcoW1xcc1xcU10qPyk+L2csICc8aW1nIGRhdGEtdj4nLCBpbWdUYWdSZXBsYWNlbWVudE9uZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvPHNob3dpbWcvZywgJzxpbWcnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgIGlmKGdldE15VmFyKCdmdWxpYmEuaGlkZUltZycpID09ICcwJykgZC5wdXNoKHt0aXRsZTogcGljLFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGljazogdHJ1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgfX0pO1xuICAgICAgICAgICAgICAgIGltZ2xpc3QgKz0gcGljO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmKGdldE15VmFyKCdmdWxpYmEuaGlkZUltZycpID09ICcxJykgZC5wdXNoKHt0aXRsZTogaW1nbGlzdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IHNpemUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpY2s6IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgIH19KTtcbiAgICB9ZWxzZXtcbiAgICAgICAgY29udGVudCA9IGNvbnRlbnQucmVwbGFjZVdpdGhDYWxsYmFjaygvPGltZyhbXFxzXFxTXSo/KT4vZywgJzxpbWcgZGF0YS12PicsIGltZ1RhZ1JlcGxhY2VtZW50T25lKVxuICAgICAgICAgICAgLnJlcGxhY2UoLzxzaG93aW1nL2csICc8aW1nJylcbiAgICAgICAgICAgIC5yZXBsYWNlV2l0aENhbGxiYWNrKC88KGlmcmFtZSkoW1xcc1xcU10qPyk8XFwvKGlmcmFtZSk+L2csICc8bGluayBkYXRhLXY+JywgbGlua1RhZ1JlcGxhY2VtZW50MilcbiAgICAgICAgICAgIC5yZXBsYWNlV2l0aENhbGxiYWNrKC88KHNvdXJjZXx2aWRlbykoW1xcc1xcU10qPyk8XFwvKHNvdXJjZXx2aWRlbyk+L2csICc8dmlkZW8gZGF0YS12PicsIHZpZGVvVGFnUmVwbGFjZW1lbnQyKTtcblxuICAgICAgICBsZXQgY29udGVudGxpc3QgPSBjb250ZW50LnNwbGl0KCdcXG4nKTtcbiAgICAgICAgbGV0IGh0bWxMaXN0ID0gJyc7XG4gICAgICAgIGZvcihsZXQgaj0wO2o8Y29udGVudGxpc3QubGVuZ3RoO2orKyl7XG4gICAgICAgICAgICBsZXQgcXVvdGVDb250ZW50ID0gY29udGVudGxpc3Rbal07XG5cbiAgICAgICAgICAgIGxldCB0ZW1wID0gcGFyc2VEb21Gb3JIdG1sKGdldE5ld1RleHQocXVvdGVDb250ZW50LCdkaXYnKSwgJ1RleHQnKTtcbiAgICAgICAgICAgIGlmKGdldE15VmFyKCdmdWxpYmEuc2hvd01vZGUnKT09JzMnKXtcbiAgICAgICAgICAgICAgICBpZighdGVtcC5tYXRjaCgvXlxccyokLykpIGh0bWxMaXN0ICs9ICc8cD4mbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDsnICsgdGVtcCArICc8L3A+JztcbiAgICAgICAgICAgICAgICBpZihqPT1jb250ZW50bGlzdC5sZW5ndGgtMSAmJiBodG1sTGlzdCAhPT0gJycpe1xuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe3RpdGxlOiBodG1sTGlzdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsaWNrOiB0cnVlXG4gICAgICAgICAgICAgICAgICAgIH19KTtcbiAgICAgICAgICAgICAgICAgICAgaHRtbExpc3QgPSAnJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgICAgICBpZighdGVtcC5tYXRjaCgvXlxccyokLykgfHwgcXVvdGVDb250ZW50LmluY2x1ZGVzKCdibG9ja3F1b3RlPicpIHx8IChxdW90ZUNvbnRlbnQuaW5jbHVkZXMoJ2Rpdj4nKSAmJiBxdW90ZUNvbnRlbnQubWF0Y2goLzwoZGl2KShbXFxzXFxTXSo/KTxcXC8oZGl2KT4vZykgPT0gbnVsbCkpIGh0bWxMaXN0ICs9IHF1b3RlQ29udGVudDtcblxuICAgICAgICAgICAgICAgIGlmKHF1b3RlQ29udGVudC5tYXRjaCgvPGltZyhbXFxzXFxTXSo/KT4vZykgIT09IG51bGwgfHwgaj09Y29udGVudGxpc3QubGVuZ3RoLTEpe1xuICAgICAgICAgICAgICAgICAgICBpZihnZXRNeVZhcignZnVsaWJhLnNob3dNb2RlJykhPT0nMScgJiYgaHRtbExpc3QgIT09ICcnKSBkLnB1c2goe3RpdGxlOiBodG1sTGlzdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsaWNrOiB0cnVlXG4gICAgICAgICAgICAgICAgICAgIH19KTtcbiAgICAgICAgICAgICAgICAgICAgaHRtbExpc3QgPSAnJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYocXVvdGVDb250ZW50Lm1hdGNoKC88aW1nKFtcXHNcXFNdKj8pPi9nKSAhPT0gbnVsbCkgZC5wdXNoKHt0aXRsZTogcXVvdGVDb250ZW50LFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgY2xpY2s6IHRydWVcbiAgICAgICAgICAgICAgICB9fSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59XG5cblxuZC5wdXNoKHtjb2xfdHlwZTogJ2xpbmVfYmxhbmsnfSk7XG5sZXQgdGlwcyA9ICfor6Xmlofnq6DmnaXmupDkuo7npo/liKnlkKfvvIzlpoLmgqjllpzmrKLvvIzor7fov5vlhaXnpo/liKnlkKfnvZHpobXniYgnO1xubGV0IHdhcm5pbmcgPSAn5q2k6KeE5YiZ5LuF6ZmQ5a2m5Lmg5L2/55So77yM5aaC5pyJ5LiN5aal77yM6K+35pys5ZCn5Li76IGU57O75oiR5Yig6ZmkJztcblxuLy8gaWYoZ2V0TXlWYXIoJ2Z1bGliYS5zaG93TW9kZScpPT0nMCcgfHwgZ2V0TXlWYXIoJ2Z1bGliYS5zaG93TW9kZScpP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RpbWUgPSAnJztcbiAgICAgICAgICAgICAgICB0cnl7XG4gICAgICAgICAgICAgICAgICAgIGlmKG09PTApIGZsb29yID0gJ/Cfj6InICsgcGFyc2VEb21Gb3JIdG1sKGxpc3RbbV0sJy5jb210LWYmJlRleHQnKS5yZXBsYWNlKCcjJywnJykrJ+alvCc7XG4gICAgICAgICAgICAgICAgfWNhdGNoKGUpe1xuICAgICAgICAgICAgICAgICAgICBmbG9vciA9IGwrJ+alvOWxgumUmeivryEhIScrbVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0cnl7XG4gICAgICAgICAgICAgICAgICAgIG1haW4gPSAgcGFyc2VEb21Gb3JIdG1sKGxpc3RbbV0sJy5jb210LW1haW4mJnAmJlRleHQnKTtcbiAgICAgICAgICAgICAgICB9Y2F0Y2goZSl7XG4gICAgICAgICAgICAgICAgICAgIG1haW4gPSBsKyflm57lpI3lhoXlrrnplJnor68hISEnK21cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdHJ5e1xuICAgICAgICAgICAgICAgICAgICBhdXRvciA9ICfwn5GxJyArIHBhcnNlRG9tRm9ySHRtbChsaXN0W21dLCcuY29tdC1hdXRob3ImJlRleHQnKTtcbiAgICAgICAgICAgICAgICB9Y2F0Y2goZSl7XG4gICAgICAgICAgICAgICAgICAgIGF1dG9yID0gbCsn5L2c6ICF5ZCN56ew6ZSZ6K+vISEhJyttXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRyeXtcbiAgICAgICAgICAgICAgICAgICAgdGltZSA9ICfwn5WiJyArIHBhcnNlRG9tRm9ySHRtbChsaXN0W21dLCcuY29tdC1tZXRhLS1zcGFuJiZUZXh0JykucmVwbGFjZSgn5Zue5aSNJywnJyk7XG4gICAgICAgICAgICAgICAgfWNhdGNoKGUpe1xuICAgICAgICAgICAgICAgICAgICB0aW1lID0gbCsn5pe26Ze06ZSZ6K+vISEhJyttXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgbGV0IGNvbW1lbnRUZXh0ID0gR2V0Q29tbWVudChtYWluLGF1dG9yLHRpbWUsZmxvb3IpO1xuICAgICAgICAgICAgICAgIGlmKGw9PTAgJiYgbT09MCkgY29tbWVudFRleHQgPSBjb21tZW50TnVtICsnPGJyPjxicj4nKyBjb21tZW50VGV4dDtcblxuICAgICAgICAgICAgICAgIGNvbW1lbnRUZXh0PWNvbW1lbnRUZXh0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2VXaXRoQ2FsbGJhY2soLyhodHRwOlxcL1xcL3xmdHA6XFwvXFwvfGh0dHBzOlxcL1xcL3wpW1xcd1xcLV9dKyhcXC5bXFx3XFwtX10rKSsoW1xcd1xcLVxcLixAP149JSZhbXA7Oi9+XFwrI10qW1xcd1xcLVxcQD9ePSUmYW1wOy9+XFwrI10pPy9nLCAnPG4gZGF0YS12PicsIG51bGxUYWdSZXBsYWNlbWVudDIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2VXaXRoQ2FsbGJhY2soLzxhKC4qPykgaHJlZj1cIiguKj8pYWxpeXVuZHJpdmUoLio/KVwiKC4qPyk8XFwvYT4vZywgJzxhIGRhdGEtdj4nLCBhVGFnUmVwbGFjZW1lbnQyKTtcbiAgICAgICAgICAgICAgICBkLnB1c2goe3RpdGxlOiBjb21tZW50VGV4dCxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IHNpemUsXG4gICAgICAgICAgICAgICAgICAgIGNsaWNrOiB0cnVlXG4gICAgICAgICAgICAgICAgfX0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufVxuXG5yZXMuZGF0YT1kO1xuc2V0SG9tZVJlc3VsdChyZXMpOyIsInNkZXRhaWxfY29sX3R5cGUiOiJtb3ZpZV8xIiwic2RldGFpbF9maW5kX3J1bGUiOiIqIiwidWEiOiJtb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