{"id":208,"date":"2022-02-15T16:20:32","date_gmt":"2022-02-15T08:20:32","guid":{"rendered":"https:\/\/me.nicejelly.xyz\/?p=208"},"modified":"2022-06-13T18:31:34","modified_gmt":"2022-06-13T10:31:34","slug":"pagermaid%e6%9c%ba%e5%99%a8%e4%ba%ba%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/me.spacelite.top\/?p=208","title":{"rendered":"Pagermaid\u673a\u5668\u4eba\u5b89\u88c5\u65b9\u6cd5"},"content":{"rendered":"<pre><span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">2022.2.25\u66f4\u65b0<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u56e0github\u5220\u5e93\uff0c\u65b0\u7684\u5b89\u88c5\u65b9\u6cd5\u5982\u4e0b\uff1a<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u65b9\u6cd5\u2460<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u4f60\u53ef\u4ee5\u7528\u4e00\u952e\u811a\u672c\u8fdb\u884c\u91cd\u65b0\u90e8\u7f72 wget https:\/\/gitlab.com\/Xtao-Labs\/pagermaid-modify\/-\/raw\/master\/install.sh -O install.sh&amp;&amp; chmod +x install.sh &amp;&amp; bash install.sh<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u65b9\u6cd5\u2461<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u5728ssh\u8fd0\u884c cd \/var\/lib\/pagermaid &amp;&amp; git remote set-url origin https:\/\/gitlab.com\/Xtao-Labs\/pagermaid-modify.git &amp;&amp; git reset --hard &amp;&amp; git pull<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u7136\u540e\u4fee\u6539 config.yml \u4e2d\u4ee5\u4e0b\u5185\u5bb9<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">git_source: \"https:\/\/gitlab.com\/Xtao-Labs\/PagerMaid_Plugins\/-\/raw\/master\/\"<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">git_ssh: \"https:\/\/gitlab.com\/Xtao-Labs\/pagermaid-modify.git\"<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u4e4b\u540e -restart \u6216\u5728ssh\u8fd0\u884c systemctl restart pagermaid<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u4ee5\u4e0a\u65b9\u6cd5\u8bf7\u4e8c\u9009\u4e00\u6267\u884c<\/span><\/pre>\n<hr \/>\n<pre><span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u89e3\u51b3PagerMaid\u65e0\u6cd5\u66f4\u65b0\u7684\u95ee\u9898\uff1a<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u65b9\u6cd5\u2460<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u53d1\u9001 -sh git remote set-url upstream https:\/\/gitlab.com\/Xtao-Labs\/pagermaid-modify.git \u547d\u4ee4\u5230\u4efb\u610f\u5bf9\u8bdd<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u7136\u540e\u6b63\u5e38\u8fd0\u884c -update \u5373\u53ef<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u65b9\u6cd5\u2461<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u53d1\u9001 -sh git remote set-url origin https:\/\/gitlab.com\/Xtao-Labs\/pagermaid-modify.git \u547d\u4ee4\u5230\u4efb\u610f\u5bf9\u8bdd<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u7136\u540e\u8fd0\u884c -sh git pull<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6700\u540e\u8fd0\u884c -restart \u5373\u53ef<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6b64\u65b9\u6cd5\u4e0d\u53ef\u4ee5\u4f7f\u7528 -update \u547d\u4ee4<\/span><\/pre>\n<hr \/>\n<pre><span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u539f\u7248\u6559\u7a0b\uff1a<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u62c9\u53d6\u9879\u76ee<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u672c\u9879\u76ee\u6258\u7ba1\u5728\u00a0github\u00a0\uff0c\u6240\u4ee5\u60a8\u9996\u5148\u9700\u8981\u68c0\u67e5\u60a8\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u00a0git\u00a0\u8f6f\u4ef6\u5305\u3002\u5e76\u4e14\u6211\u4eec\u53d1\u73b0\u5f53\u00a0git\u00a0\u8f6f\u4ef6\u5305\u7248\u672c\u8fc7\u4f4e\u65f6\uff0c\u65e0\u6cd5\u5b9e\u73b0\u7a0b\u5e8f\u7684\u81ea\u52a8\u66f4\u65b0\uff0c\u6240\u4ee5\u60a8\u9700\u8981\u9996\u5148\u5347\u7ea7\u00a0git\u00a0\u8f6f\u4ef6\u5305\uff1a<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">sudo apt install --upgrade git -y<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u4ece\u4ed3\u5e93\u62c9\u53d6\u9879\u76ee<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">cd \/var\/lib &amp;&amp; git clone https:\/\/github.com\/Xtao-Labs\/PagerMaid-Modify.git pagermaid &amp;&amp; cd pagermaid<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u5b89\u88c5\u8f6f\u4ef6\u5305<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">imagemagick<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6b64\u8f6f\u4ef6\u5305\u7528\u4e8e\u5904\u7406\u56fe\u7247\uff0c\u5982\u60a8\u6ca1\u6709\u56fe\u7247\u5904\u7406\u9700\u6c42\uff0c\u60a8\u53ef\u4ee5\u65e0\u9700\u5b89\u88c5\u6b64\u8f6f\u4ef6\u5305\u3002<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">sudo apt install imagemagick -y<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">neofetch<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6b64\u8f6f\u4ef6\u5305\u7528\u4e8e\u663e\u793a\u7cfb\u7edf\u4fe1\u606f\uff0c\u5982\u60a8\u6ca1\u6709\u663e\u793a\u7cfb\u7edf\u4fe1\u606f\u9700\u6c42\uff0c\u60a8\u53ef\u4ee5\u65e0\u9700\u5b89\u88c5\u6b64\u8f6f\u4ef6\u5305\u3002<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">sudo apt install neofetch -y<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">zbar<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6b64\u8f6f\u4ef6\u5305\u7528\u4e8e\u5904\u7406\u4e8c\u7ef4\u7801\u4fe1\u606f\uff0c\u5982\u60a8\u6ca1\u6709\u5904\u7406\u4e8c\u7ef4\u7801\u4fe1\u606f\u9700\u6c42\uff0c\u60a8\u53ef\u4ee5\u65e0\u9700\u5b89\u88c5\u6b64\u8f6f\u4ef6\u5305\u3002<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">sudo apt install libzbar-dev -y<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">tesseract<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6b64\u8f6f\u4ef6\u5305\u7528\u4e8e\u56fe\u7247\u5149\u5b66\u5b57\u7b26\u8bc6\u522b\uff0c\u5982\u4f60\u6ca1\u6709\u5904\u7406\u6b64\u65b9\u9762\u7684\u9700\u6c42\uff0c\u4f60\u53ef\u4ee5\u65e0\u9700\u5b89\u88c5\u6b64\u8f6f\u4ef6\u5305\u3002<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6700\u5927\u5316\u5b89\u88c5<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">sudo apt install tesseract-ocr tesseract-ocr-all -y<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6700\u5c0f\u5316\u5b89\u88c5<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">sudo apt install tesseract-ocr tesseract-ocr-eng tesseract-ocr-chi-sim -y<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">Redis<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6b64\u8f6f\u4ef6\u5305\u7528\u4e8e\u8bb0\u5f55\u4fe1\u606f\uff0c\u4ee5\u65b9\u4fbf\u8f6f\u4ef6\u91cd\u542f\u540e\u4ecd\u7136\u53ef\u4ee5\u8fdb\u884c\u4e0a\u4e00\u6b21\u672a\u5b8c\u6210\u7684\u4efb\u52a1\uff0c\u4f60\u4e5f\u53ef\u4ee5\u65e0\u9700\u5b89\u88c5\u6b64\u8f6f\u4ef6\u5305\u3002<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">sudo apt install redis-server -y<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">Pip<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6b64\u8f6f\u4ef6\u5305\u4e3a\u5fc5\u987b\u4f9d\u8d56\u5305\uff0c\u7528\u4e8e\u5b89\u88c5 python \u4f9d\u8d56\u3002<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">sudo apt install python3-pip -y<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u5b89\u88c5\u4f9d\u8d56\u5305<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">pip3 install -r requirements.txt<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u5c06\u914d\u7f6e\u00a0config.gen.yml\u00a0\u6587\u4ef6\u590d\u5236\u4e00\u4efd\u5e76\u4e14\u547d\u540d\u4e3a\u00a0config.yml<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">cp config.gen.yml config.yml<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u7136\u540e\u53bb\u00a0telegram \u5b98\u7f51\u00a0\u751f\u6210 api \u586b\u5165\u914d\u7f6e\u6587\u4ef6\u5185\uff0c\u6211\u4eec\u53ea\u9700\u8981\u590d\u5236\u00a0api id\u00a0\u548c\u00a0api_hash\u00a0\u503c \u586b\u5165\u00a0api_key\u00a0\u548c\u00a0api_hash\u00a0\u3002<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">vi config.yml<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6309 i \u8fdb\u5165\u7f16\u8f91\u6a21\u5f0f\uff0c\u7c98\u8d34\u597d\u540e\uff0c\u6309\u4e0b esc \u8f93\u5165 shift \u52a0\u5192\u53f7\uff0c\u8f93\u5165 wq \u4fdd\u5b58\u9000\u51fa<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u767b\u5f55\u8d26\u53f7<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">python3 -m pagermaid<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6b64\u6b65\u9700\u8981\u586b\u5165\u5b8c\u6574\u7684\u7535\u8bdd\u53f7\u7801\uff08eg\uff1a+12569986522\uff09\u7136\u540e tg \u4f1a\u53d1\u7ed9\u4f60\u7684\u5176\u4ed6\u5ba2\u6237\u7aef\u53d1\u9001\u9a8c\u8bc1\u7801\uff0c\u586b\u5165\u9a8c\u8bc1\u7801\u540e\uff0c\u56de\u8f66\uff0c\u5982\u6709\u4e24\u6b65\u9a8c\u8bc1\u5bc6\u7801\uff0c\u5219\u518d\u8f93\u5165\u4e24\u6b65\u9a8c\u8bc1\u5bc6\u7801\u5373\u53ef\u3002<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u505c\u6b62\u8fd0\u884c\uff1a<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">ctrl + c<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u6709\u65f6\uff08\u6216\u5927\u90e8\u5206\u65f6\u95f4\uff09\uff0c\u5f53\u60a8\u5728\u670d\u52a1\u5668\u90e8\u7f72 PagerMaid-modify \u65f6\uff0c\u767b\u5f55\u4f1a\u6709\u95ee\u9898\uff0c\u5f53\u51fa\u73b0\u4e86\u95ee\u9898\uff0c\u8bf7\u5728\u5e94\u7528\u7a0b\u5e8f\u7684\u914d\u7f6e\u6b65\u9aa4\u914d\u7f6e\u552f\u4e00\u7684 api_key \u548c api_hash \uff0c\u7136\u540e\u5728\u60a8\u7684\u672c\u5730\u7535\u8111\u4e0a\u6267\u884c python3 utils\/mksession.py \uff0c\u5728\u8d26\u53f7\u767b\u5f55\u6210\u529f\u4ee5\u540e\uff0c\u5c06\u751f\u6210\u7684 pagermaid.session \u6587\u4ef6\u590d\u5236\u5230\u670d\u52a1\u5668\u5bf9\u5e94\u76ee\u5f55\u5373\u53ef\u3002<\/span>\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u8bf7\u6ce8\u610f\u4fdd\u62a4\u597d\u60a8\u5df2\u767b\u5f55\u7684\u00a0pagermaid.session\u00a0\u3002\u6b64\u6587\u4ef6\u53ef\u4ee5\u8fdb\u884c\u8d26\u53f7\u6240\u6709\u64cd\u4f5c\uff0c\u8bf7\u4e0d\u8981\u5206\u4eab\u7ed9\u4ed6\u4eba\u4f7f\u7528\u3002<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u52a0\u4e2a\u8fdb\u7a0b\u5b88\u62a4<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">cat &lt;&lt;'TEXT' &gt; \/etc\/systemd\/system\/pagermaid.service\r\n[Unit]\r\nDescription=PagerMaid-Modify telegram utility daemon\r\nAfter=network.target\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n\r\n[Service]\r\nType=simple\r\nWorkingDirectory=\/var\/lib\/pagermaid\r\nExecStart=\/usr\/bin\/python3 -m pagermaid\r\nRestart=always\r\nTEXT<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u5c0ftips \u8fd9\u91cc\u7684\u4ee3\u7801\u8981\u5168\u90e8\u4e00\u8d77\u590d\u5236\u7c98\u8d34\u8fc7\u53bb\u54e6omo<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u542f\u52a8bot<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">systemctl daemon-reload &amp;&amp; systemctl start pagermaid &amp;&amp; systemctl enable pagermaid<\/span>\r\n\r\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: 14pt;\">\u597d\u529b\uff0c\u5f04\u5b8c\u4e86\u53ef\u4ee5\u5f00\u59cb\u6109\u5feb\u7684\u73a9\u800d\u4e86<\/span>\r\n\r\n<audio style=\"display: none;\" controls=\"controls\"><\/audio>\r\n\r\n<audio style=\"display: none;\" controls=\"controls\"><\/audio>\r\n\r\n<audio style=\"display: none;\" controls=\"controls\"><\/audio>\r\n\r\n<audio style=\"display: none;\" controls=\"controls\"><\/audio><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>2022.2.25\u66f4\u65b0 \u56e0github\u5220\u5e93\uff0c\u65b0\u7684\u5b89\u88c5\u65b9\u6cd5\u5982\u4e0b\uff1a \u65b9\u6cd5\u2460 \u4f60\u53ef\u4ee5\u7528\u4e00\u952e\u811a\u672c\u8fdb\u884c\u91cd\u65b0\u90e8\u7f72&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-208","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/posts\/208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208"}],"version-history":[{"count":16,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/posts\/208\/revisions"}],"predecessor-version":[{"id":387,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/posts\/208\/revisions\/387"}],"wp:attachment":[{"href":"https:\/\/me.spacelite.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}