{"id":34716,"date":"2020-02-21T01:19:49","date_gmt":"2020-02-20T17:19:49","guid":{"rendered":"http:\/\/4563.org\/?p=34716"},"modified":"2020-02-21T01:19:52","modified_gmt":"2020-02-20T17:19:52","slug":"%e5%88%86%e4%ba%ab%e9%83%a8%e7%bd%b2%e6%98%a8%e5%a4%a9%e4%bb%8b%e7%bb%8d%e7%9a%84%e9%a1%b9%e7%9b%aepegermaid-%e7%9a%84%e4%b8%80%e4%ba%9b%e7%bb%8f%e9%aa%8c%e5%92%8c%e5%bf%83%e5%be%97","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=34716","title":{"rendered":"\u5206\u4eab\u90e8\u7f72\u6628\u5929\u4ecb\u7ecd\u7684\u9879\u76eePegerMaid \u7684\u4e00\u4e9b\u7ecf\u9a8c\u548c\u5fc3\u5f97"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>\u5206\u4eab\u90e8\u7f72\u6628\u5929\u4ecb\u7ecd\u7684\u9879\u76eePegerMaid \u7684\u4e00\u4e9b\u7ecf\u9a8c\u548c\u5fc3\u5f97<\/p>\n<p>\u7528PegerMaid\u5c06\u81ea\u5df1\u53d8\u4e3a\u4eba\u5f62\u81ea\u8d70Bot<\/p>\n<p>\u6628\u5929\u6709\u4ecb\u7ecd\u7528 Docker \u90e8\u7f72\u6bd4\u8f83\u5feb\u6377\u7701\u5fc3\uff0c\u4f46\u5f88\u591a\u670b\u53cb\u5305\u62ec\u6211\u5bf9 Docker \u4e0d\u662f\u5f88\u719f\u6089\uff0c\u51fa\u4e86\u95ee\u9898\u5e38\u5e38\u627e\u4e0d\u5230\u89e3\u51b3\u7684\u601d\u8def\u3002\u56e0\u6b64\u8fd9\u7bc7\u6559\u7a0b\u4ecb\u7ecd\u4e86\u5728 Python \u4e0b\u90e8\u7f72<\/p>\n<p><i class=\"emoji\"><b>?<\/b><\/i> \u5927\u81f4\u6b65\u9aa4\uff1a<\/p>\n<p><i class=\"emoji\"><b>1\u20e3\ufe0f<\/b><\/i> \u4e0b\u62c9\u6e90\u7801\u5e76\u4fdd\u5b58\u81f3 <code>\/var\/lib<\/code><\/p>\n<p><i class=\"emoji\"><b>2\u20e3\ufe0f<\/b><\/i> \u5b89\u88c5\u4f9d\u8d56\uff1a<\/p>\n<p><code>pip3 install -r requirements.txt<\/p>\n<p>apt install neofetch zbar imagemagick tesseract -y<\/code><\/p>\n<p><i class=\"emoji\"><b>3\u20e3\ufe0f<\/b><\/i> \u7533\u8bf7 <code>api_id<\/code> \u548c <code>api_hash<\/code>\uff0c\u8fd0\u884c\u4e8c\u8fdb\u5236\u751f\u6210 <code>config.yml<\/code> \u5e76\u586b\u5165\u4e0a\u8ff0\u4fe1\u606f<\/p>\n<p><i class=\"emoji\"><b>4\u20e3\ufe0f<\/b><\/i> \u5c06 PegerMaid \u91cd\u65b0\u540e\u53f0\u8fd0\u884c<\/p>\n<p><i class=\"emoji\"><b>?<\/b><\/i> \u5f88\u591a\u670b\u53cb\u8fd8\u4e0d\u6e05\u695a\u8fd9\u4e2a\u9879\u76ee\u53ef\u4ee5\u7528\u6765\u505a\u4ec0\u4e48\uff0c\u8fd9\u91cc\u4e5f\u4e3e\u51e0\u4e2a\u4f8b\u5b50\uff1a\u53ef\u4ee5\u7528 <code>-sticker<\/code> \u5077\u53d6\u522b\u4eba\u7684\u8868\u60c5\u5305\uff0c\u53ef\u4ee5\u67e5\u770b\u90e8\u7f72\u7684\u670d\u52a1\u5668\u914d\u7f6e\u548c\u8fd0\u884c\u60c5\u51b5\u7b49\u7b49\u3002\u73a9\u6cd5\u6bd4\u8f83\u591a\u6837\u9700\u8981\u5927\u5bb6\u6162\u6162\u63a2\u7d22<\/p>\n<p>=====================================================<\/p>\n<h1>\u90e8\u7f72\u8fc7\u7a0b<\/h1>\n<blockquote><p>\u6211\u662f\u76f4\u63a5\u5728\u4e2a\u4eba\u7684VPS\u4e0a\u9762\u90e8\u7f72\u7684,\u7cfb\u7edf\u4e3aDebian10\uff0c \u5168\u7a0b\u7a81\u51fa\u4e00\u4e2a <strong>\u83bd<\/strong> \u5b57\uff0c \u865a\u62df\u73af\u5883\u4ec0\u4e48\u7684\u76f4\u63a5\u7565\u8fc7\uff0c \u76f4\u63a5\u5f00\u5e72, \u5982\u679c\u4e0d\u653e\u5fc3\u8bf7\u4e0d\u8981\u7ee7\u7eed\u9605\u8bfb<\/p><\/blockquote>\n<h2>\u7b2c\u4e00\u6b65<\/h2>\n<p><a title=\"\u5728\u8fd9\u4e2a\u9875\u9762\" href=\"https:\/\/git.stykers.moe\/users\/stykers\/repos\/pagermaid\/browse\">\u5728\u8fd9\u4e2a\u9875\u9762<\/a> \u4e0b\u8f7d\u6587\u4ef6\u7684\u538b\u7f29\u5305\u5230\u672c\u5730\uff0c \u89e3\u538b\u7f29\u7136\u540e\u4e0a\u4f20\u5230\u81ea\u5df1\u7684VPS \uff08\u5b98\u65b9\u6307\u5bfc\u91cc\u9762\u7684\u76ee\u5f55\u7ed9\u7684\u662f\/var\/lib, \u6211\u5c31\u7167\u505a\u4e86\uff0c \u4e0a\u4f20\u7684\u5de5\u5177\u662f\u4eba\u7c7b\u7684\u597d\u670b\u53cb FinalShell\uff0c \u6587\u4ef6\u4e0a\u4f20\u53ef\u89c6\u5316\u64cd\u4f5c\u771f\u7684\u592a\u68d2\u4e86\uff09<img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/02\/blog2-1-300x82.png\" alt=\"\" \/><\/p>\n<h2>\u7b2c\u4e8c\u6b65<\/h2>\n<p>\u5f85\u4e0a\u4f20\u5b8c\u6bd5\u4e4b\u540e\uff0c cd \u5230\u8fd9\u4e2a\u76ee\u5f55 <code>cd \/var\/lib<\/code><br \/>\n\u5982\u679c\u4e00\u5207\u987a\u5229\u7684\u8bdd\uff0c \u6b64\u65f6\u5e94\u8be5\u4f1a\u770b\u89c1\u4e00\u4e2a<strong>\u6587\u4ef6\u5939<\/strong>\uff0c \u6211\u4eca\u665a\u64cd\u4f5c\u7684\u65f6\u5019\u5b83\u7684\u540d\u5b57\u662f <strong>pagermaid-master@50cf8a3ca21<\/strong><\/p>\n<h2>\u7b2c\u4e09\u6b65<\/h2>\n<p>\u5b89\u88c5\u4f9d\u8d56<\/p>\n<p><code>cd pagermaid-master@50cf8a3ca21<\/code><br \/>\n<code>pip3 install -r requirements.txt<\/code><\/p>\n<blockquote><p>\u5982\u679c\u8fd9\u4e00\u6b65\u63d0\u793a\u6ca1\u6709pip3\u7684\u8bdd\uff0c \u6267\u884c <code>apt install python3-pip<\/code><\/p><\/blockquote>\n<p><code>apt install neofetch zbar imagemagick tesseract -y<\/code><\/p>\n<blockquote><p>\u5982\u679c\u63d0\u793a\u8bf4<br \/>\n<code>Unable to locate package zbar Unable to locate package tesseract<\/code> \u4e4b\u7c7b\u7684\uff0c \u5c31\u53bb\u628azbar\u548ctesseract\u88c5\u4e0a<br \/>\nzbar: <code>apt-get install libzbar-dev<\/code>\u7136\u540e<code>pip3 install zbar<\/code><br \/>\n<img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/02\/blog1-300x106.png\" alt=\"\" \/><br \/>\n(\u8fd9\u4e00\u6b65\u6700\u540e\u597d\u50cf\u4f1a\u62a5\u9519\uff0c \u4f46\u662f\u795e\u5947\u7684\u662f\u8fd9\u5bf9\u4e8e\u6211\u4eec\u8fbe\u6210\u6700\u7ec8\u76ee\u6807\u6ca1\u6709\u5f71\u54cd)<br \/>\ntesseract: <code>apt install tesseract-ocr<\/code><\/p><\/blockquote>\n<p>\u5f53\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0c \u5c31\u53ef\u4ee5\u8fdb\u884c\u6700\u540e\u7684\u51c6\u5907\u4e86<\/p>\n<h2>\u7b2c\u56db\u6b65<\/h2>\n<p>\u5728<a title=\"\u8fd9\u91cc\" href=\"https:\/\/my.telegram.org\/http:\/\/\">\u8fd9\u91cc<\/a> \u7533\u8bf7\u4e00\u4e2aAPI\uff0c <del>\u8fd9\u4e00\u6b65\u5177\u4f53\u600e\u4e48\u505a\u6211\u5fd8\u4e86\uff08\u5341\u5206\u62b1\u6b49\uff09<\/del>\uff0c \u6211\u8fd9\u91cc\u662f\u76f4\u63a5\u628a\u4e4b\u524d\u7533\u8bf7\u8fc7\u7684\u4e00\u4e2a\u62ff\u51fa\u6765\u7528\u4e86<br \/>\n\u5f53\u7533\u8bf7\u6210\u529f\u4e4b\u540e\u5e94\u8be5\u4f1a\u770b\u89c1\u4e00\u4e2a\u8fd9\u6837\u7684\u754c\u9762<br \/>\n<img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/02\/blog3-300x97.png\" alt=\"\" \/><br \/>\n\u8fd9\u91cc\u9762\u7684<strong>Api_ID<\/strong>\u548c<strong>Api_Hash<\/strong>\u5c31\u662f\u6211\u4eec\u6240\u9700\u7684\u4e1c\u897f\u4e86<\/p>\n<h2>\u7b2c\u4e94\u6b65<\/h2>\n<p>\u5728\u673a\u5668\u4e0a\u6267\u884c<code>python3 -m pagermaid<\/code>\uff0c \u5982\u679c\u662f\u7b2c\u4e00\u6b21\u542f\u52a8\u7684\u8bdd\uff0c \u5e94\u8be5\u4f1a\u63d0\u793a<br \/>\n<code>[pagermaid] Configuration file does not exist, generating new configuration file.<\/code><br \/>\n\u597d\u6211\u4eec\u4e0d\u7528\u7ba1\u4ed6\uff0c \u5728\u8fd9\u91cc\u7528<code>ls<\/code>\u547d\u4ee4\u770b\u770b\u8fd9\u4e2a\u6587\u4ef6\u5939\u4e0b\u9762\u662f\u4e0d\u662f\u591a\u4e86\u70b9\u4e1c\u897f\uff0c \u5e94\u8be5\u4f1a\u591a\u51fa\u4e00\u4e2aconfig.yml<br \/>\n<img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/02\/blog4-300x63.png\" alt=\"\" \/><br \/>\n\u7528\u81ea\u5df1\u559c\u6b22\u7684\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00\u8fd9\u4e2a<strong>config.yml<\/strong>, \u6211\u8fd9\u91cc\u7528\u7684\u662fvim<br \/>\n<img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/02\/blog5-300x119.png\" alt=\"\" \/><br \/>\n\u628a<strong>&#8220;KEY_HERE&#8221;<\/strong>\u66ff\u6362\u6210\u81ea\u5df1\u7684<strong>Api_id<\/strong>, <strong>&#8220;HASH_HERE&#8221;<\/strong>\u66ff\u6362\u6210<strong>API_hash<\/strong>, \u4fdd\u5b58\u5e76\u9000\u51fa<\/p>\n<h2>\u7b2c\u516d\u6b65<\/h2>\n<p>\u518d\u6b21\u6267\u884c<code>python3 -m pagermaid<\/code>, \u7136\u540e\u8f93\u5165\u81ea\u5df1\u7684Tg\u8d26\u6237\uff08\u8bb0\u5f97\u8981\u9644\u5e26\u533a\u53f7\uff0c \u533a\u53f7\u548c\u53f7\u7801\u4e4b\u524d\u4e0d\u7528\u5206\u5f00\uff09\uff0c \u7136\u540e\u8ddf\u7740\u63d0\u793a\u4e00\u76f4\u8d70\uff0c \u5c31\u53ef\u4ee5\u4e86<br \/>\n\u4e0d\u8fc7\u8fd9\u91cc\u6709\u4e00\u4e2a\u95ee\u9898\uff0c \u8fd9\u4e2a\u65f6\u5019\u4f60\u662f\u5728ssh\u91cc\u9762\u6267\u884c\u7684\uff0c \u4e00\u65e6\u4f60\u9000\u51fa\uff0c \u90a3\u4e48\u8fd9\u4e2a\u8fdb\u7a0b\u5c31\u7ed3\u675f\u4e86\uff0c \u4f60\u5c31\u6ca1\u6cd5\u6109\u5feb\u7684\u5f53\u4e00\u4e2abot\u4e86\uff0c \u90a3\u4e48\u8fd9\u65f6\u5019\uff0c \u4e0d\u59a8\u5148\u7ed3\u675f\u76ee\u524d\u7684\u8fd9\u4e2a\u8fdb\u7a0b\uff08ctrl + c), \u7136\u540e\u6267\u884c<br \/>\n<code>nohup python3 -m pagermaid &amp;<\/code><br \/>\n\u7136\u540e\u5c31\u5927\u529f\u544a\u6210\uff0c \u5f00\u59cb\u6162\u6162\u63a2\u7d22\u5427\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; \u5206\u4eab\u90e8\u7f72\u6628\u5929\u4ecb\u7ecd\u7684\u9879&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/34716"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=34716"}],"version-history":[{"count":1,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/34716\/revisions"}],"predecessor-version":[{"id":34782,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/34716\/revisions\/34782"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=34716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=34716"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=34716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}