xiaomianao666

小程序:轻合集.香雅情

Nov 13th, 2021
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@轻合集.香雅情@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6L275ZCI6ZuGLummmembheaDhSIsImF1dGhvciI6Iui9u+WQiOmbhueUn+aIkOWZqCIsInVybCI6Imhpa2VyOi8vZW1wdHkiLCJ2ZXJzaW9uIjo3MiwiY29sX3R5cGUiOiJpY29uXzJfcm91bmQiLCJjbGFzc19uYW1lIjoiIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG5sZXQgZWwgPSBbe1xuICAgIHRpdGxlOiAn5riF6Zmk57yT5a2YLOeri+WNs+abtOaWsCA8c21hbGw+KOWfuuS6jui/nOeoi+S7k+W6kyzkuI3opoHpopHnuYHngrnlh7spJyxcbiAgICB1cmw6ICQoKS5sYXp5UnVsZSgoKSA9PiB7XG4gICAgICAgIGNsZWFySXRlbSgndXBkYXRldGltZScpXG4gICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXG4gICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7Lmm7TmlrAnXG4gICAgfSksXG4gICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjEnLFxuICAgIGNvbF90eXBlOiAnYXZhdGFyJ1xufV1cbmVsLnB1c2goe1xuICAgIHVybDogJ1wiaGlrZXI6Ly9zZWFyY2g/cz1cIitpbnB1dCtcIiZydWxlPScgKyBnZXRJdGVtKCdteUNvbGxlY3Rpb24nKSArICdcIicsXG4gICAgZGVzYzogJ+aQnOS9oOaDs+imgeeahC4uLicsXG4gICAgdGl0bGU6ICfmkJzntK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G4gICAgICAgICAgICBsZXQgUlVMRSA9IE9iamVjdC5hc3NpZ24oe30sIE1ZX1JVTEUpXG5cbiAgICAgICAgICAgIGlmICghdi51cmwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdlxuICAgICAgICAgICAgfSBlbHNlIGlmICh2LnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XG4gICAgICAgICAgICAgICAgdi51cmwgPSB2LnVybC5yZXBsYWNlKCcuanM6JywgJy5qczpcXG5pZihNWV9SVUxFKU9iamVjdC5hc3NpZ24oTVlfUlVMRSwnICsgJC5zdHJpbmdpZnkoeyB0aXRsZTogTVlfUlVMRS50aXRsZSwgcGFnZXM6IE1ZX1JVTEUucGFnZXMsIHBhZ2VMaXN0OiBNWV9SVUxFLnBhZ2VMaXN0LCBmaW5kX3J1bGU6ICcnLCBwYXJhbXM6ICcnIH0pICsgJyk7JylcbiAgICAgICAgICAgICAgICByZXR1cm4gdlxuICAgICAgICAgICAgfSBlbHNlIGlmICh2LnVybC5pbmNsdWRlcygnQHJ1bGU9JykpIHtcbiAgICAgICAgICAgICAgICBsZXQgW18sIHVybCwgcnVsZV0gPSB2LnVybC5tYXRjaCgvXihbXFxzXFxTXSo/KUBydWxlPShbXFxzXFxTXSopJC8pXG4gICAgICAgICAgICAgICAgdi51cmwgPSB1cmxcbiAgICAgICAgICAgICAgICBSVUxFLmRldGFpbF9maW5kX3J1bGUgPSBydWxlXG4gICAgICAgICAgICAgICAgUlVMRS5kZXRhaWxfY29sX3R5cGUgPSBNWV9SVUxFLmNvbF90eXBlXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vcGFnZS8nKSkge1xuICAgICAgICAgICAgICAgIGlmICh2LnVybC5pbmNsdWRlcygncnVsZT0nKSB8fCAodi5leHRyYSB8fCB7fSkucnVsZSlcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcbiAgICAgICAgICAgICAgICBsZXQ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1bmN0aW9uIHNldFNlYXJjaFJlc3VsdChhLCBwYXJhbTEsIHBhcmFtMiwgcGFyYW0zKSB7XG4gICAgICAgIHNldFJlc3VsdChhLCBwYXJhbTEsIHBhcmFtMiwgcGFyYW0zKVxuICAgIH1cblxuICAgIGV2YWwoTVlfUlVMRS5maW5kX3J1bGUuc2xpY2UoMykpXG59IGVsc2Uge1xuICAgIGxldCBmaW5kUnVsZSA9IE1ZX1JVTEUuZmluZF9ydWxlLnNwbGl0KCc7JylcbiAgICBwYXJzZURvbUZvckFycmF5KGluZGV4SHRtbCwgZmluZFJ1bGUuc2hpZnQoKSkuZm9yRWFjaCgoZGF0YSkgPT4ge1xuICAgICAgICBsZXQgW3RpdGxlLCB1cmwsIGRlc2MsIGNvbnRlbnQsIGltZ10gPSBmaW5kUnVsZS5tYXAoKHYsIGkpID0+IHtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodiA9PSAnKicpIHJldHVybiAnJ1xuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gNCkgP1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb20oZGF0YSwgdikgOlxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb21Gb3JIdG1sKGRhdGEsIHYpXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDEpIHYgPSBydW5Db2RlKHYpXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgcmVzID0ge1xuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXG4gICAgICAgICAgICAgICAgaW1nOiBpbWdcb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gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgZm9sZGVkKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9KVxcbiAgICAgICAgbGV0IGFyciA9IGZvbGRlZCA/IFt0aGlzLmFyclswXV0gOiB0aGlzLmFyclxcbiAgICAgICAgYXJyLmZvckVhY2goKHYpID0+IHtcXG4gICAgICAgICAgICBsZXQgeyBpZCwgY2xhc3NfbmFtZSwgY2xhc3NfdXJsIH0gPSB2LFxcbiAgICAgICAgICAgICAgICBzZWxlY3RlZCA9IEpTT04uc3RyaW5naWZ5KHRoaXMuZ2V0Q2xhc3MoaWQpKVxcbiAgICAgICAgICAgIGNsYXNzX25hbWUuZm9yRWFjaCgobmFtZSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gY2xhc3NfdXJsW2ldLFxcbiAgICAgICAgICAgICAgICAgICAgbm93ID0gSlNPTi5zdHJpbmdpZnkoeyBuYW1lOiBuYW1lLCB1cmw6IHVybCB9KVxcbiAgICAgICAgICAgICAgICBlbC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAoc2VsZWN0ZWQgPT0gbm93ID8gJ+KAnOKAnOKAneKAnTxzcGFuIHN0eWxlPVxcXCJjb2xvcjonICsgdGhpcy5jb2xvciArICdcXFwiPjxiPicgOiAnJykgKyBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBpZCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKHNpZ24gKyBpZCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdGhpcy5zaWduLCBpZCwgbm93KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGVsLnB1c2goeyBjb2xfdHlwZTogdGhpcy5ib3VuZGFyeSB9KVxcbiAgICAgICAgfSlcXG4gICAgfSxcXG4gICAgaW5pdChjbGFzc09iamVjdCkge1xcbiAgICAgICAgaWYgKHR5cGVvZiBjbGFzc09iamVjdC5jbGFzc19uYW1lID09ICdzdHJpbmcnKVxcbiAgICAgICAgICAgIGNsYXNzT2JqZWN0LmNsYXNzX25hbWUgPSBjbGFzc09iamVjdC5jbGFzc19uYW1lLnNwbGl0KCcmJylcXG4gICAgICAgIGlmICh0eXBlb2YgY2xhc3NPYmplY3QuY2xhc3NfdXJsID09ICdzdHJpbmcnKVxcbiAgICAgICAgICAgIGNsYXNzT2JqZWN0LmNsYXNzX3VybCA9IGNsYXNzT2JqZWN0LmNsYXNzX3VybC5zcGxpdCgnJicpXFxuICAgICAgICByZXR1cm4gY2xhc3NPYmplY3RcXG4gICAgfSxcXG4gICAgcHVzaChjbGFzc09iamVjdCkge1xcbiAgICAgICAgdGhpcy5hcnIucHVzaCh0aGlzLmluaXQoY2xhc3NPYmplY3QpKVxcbiAgICB9LFxcbiAgICBnZXRDbGFzcyhpZCkge1xcbiAgICAgICAgbGV0IGRlZmF1bHRDbGFzcyA9IHRoaXMuYXJyLmZpbmQoaXRlbSA9PiBpdGVtLmlkID09IGlkKVxcbiAgICAgICAgaWYgKGRlZmF1bHRDbGFzcykgZGVmYXVsdENsYXNzID0gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAg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VxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIHJlcyA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBNWV9SVUxFLmNvbF90eXBlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgaWYgKHJlcy51cmwpIHtcXG4gICAgICAgICAgICBpZiAocmVzLnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxuICAgICAgICAgICAgICAgIHJlcy51cmwgPSByZXMudXJsLnJlcGxhY2UoJy5qczonLCAnLmpzOlxcXFxuaWYoTVlfUlVMRSlPYmplY3QuYXNzaWduKE1ZX1JVTEUsJyArICQuc3RyaW5naWZ5KHsgdGl0bGU6IE1ZX1JVTEUudGl0bGUsIHBhZ2VzOiBNWV9SVUxFLnBhZ2VzLCBwYWdlTGlzdDogTVlfUlVMRS5wYWdlTGlzdCwgZmluZF9ydWxlOiAnJywgcGFyYW1zOiAnJyB9KSArICcpOycpXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChNWV9SVUxFLmRldGFpbF9maW5kX3J1bGUpIHtcXG4gICAgICAgICAgICAgICAgcmVzLnVybCA9ICdoaWtlcjovL3BhZ2UvZGV0YWlsTG9hZD9ydWxlPScgKyBnZXRJdGVtKCdteUNvbGxlY3Rpb24nKVxcbiAgICAgICAgICAgICAgICByZXMuZXh0cmEgPSB7IHVybDogdXJsLCBSVUxFOiBNWV9SVUxFLCBwYWdlVGl0bGU6IHRpdGxlICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgbXlDb2xsZWN0aW9uX2VsLnB1c2gocmVzKVxcbiAgICB9KVxcbiAgICBzZXRSZXN1bHQobXlDb2xsZWN0aW9uX2VsKVxcbn1cX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WxzZSB2ID0gKGkgPT0gMSB8fCBpID09IDMpID9cXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbShkYXRhLCB2KSA6XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb21Gb3JIdG1sKGRhdGEsIHYpXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSAzKSB2ID0gcnVuQ29kZSh2KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICByZXMgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogTVlfUlVMRS5jb2xfdHlwZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIGlmIChyZXMudXJsICYmIHJlcy51cmwuaW5jbHVkZXMoJ0BsYXp5UnVsZT0nKSlcXG4gICAgICAgICAgICByZXMudXJsID0gcmVzLnVybC5yZXBsYWNlKCcuanM6JywgJy5qczpcXFxcbmlmKE1ZX1JVTEUpT2JqZWN0LmFzc2lnbihNWV9SVUxFLCcgKyAkLnN0cmluZ2lmeSh7IHRpdGxlOiBNWV9SVUxFLnRpdGxlLCBwYWdlczogTVlfUlVMRS5wYWdlcywgcGFnZUxpc3Q6IE1ZX1JVTEUucGFnZUxpc3QsIGZpbmRfcnVsZTogJycsIHBhcmFtczogJycgfSkgKyAnKTsnKVxcbiAgICAgICAgbXlDb2xsZWN0aW9uX2VsLnB1c2gocmVzKVxcbiAgICB9KVxcbiAgICBzZXRSZXN1bHQobXlDb2xsZWN0aW9uX2VsKVxcbn1cXG5cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWV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vliqDlhajlsYBVQVxcbiAgICAgICAgaWYgKCFvcHRpb25zLmhlYWRlcnNbJ1VzZXItQWdlbnQnXSkge1xcbiAgICAgICAgICAgIGlmIChNWV9SVUxFLnVhID09ICdwYycpXFxuICAgICAgICAgICAgICAgIG9wdGlvbnMuaGVhZGVyc1snVXNlci1BZ2VudCddID0gUENfVUFcXG4gICAgICAgICAgICBlbHNlIGlmIChNWV9SVUxFLnVhID09ICdtb2JpbGUnKVxcbiAgICAgICAgICAgICAgICBvcHRpb25zLmhlYWRlcnNbJ1VzZXItQWdlbnQnXSA9IE1PQklMRV9VQVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHsgTVlfVVJMOiB1cmxbMF0sIGluZGV4SHRtbDogZmV0Y2godXJsWzBdLCBvcHRpb25zKSB9XFxuICAgIH1cXG59XFxuXCJ9XSIsImljb24iOiIifQ==
Add Comment
Please, Sign In to add comment