From 00e59fe51a5f358f3ce4893e4908ee0d6615e7a7 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 16 Aug 2020 17:08:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=E2=9E=95=20=E5=A2=9E=E5=8A=A0=20ce?= =?UTF-8?q?rtifi=20=E5=A4=84=E7=90=86=20sticker=20=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E7=BD=91=E9=A1=B5=20ssl=20=E8=AF=81=E4=B9=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagermaid/modules/sticker.py | 4 +++- requirements.txt | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pagermaid/modules/sticker.py b/pagermaid/modules/sticker.py index 39f36b4..296f63b 100644 --- a/pagermaid/modules/sticker.py +++ b/pagermaid/modules/sticker.py @@ -1,5 +1,7 @@ """ PagerMaid module to handle sticker collection. """ +import certifi +import ssl from asyncio import sleep from os import remove from urllib import request @@ -88,7 +90,7 @@ async def sticker(context): command = '/newanimated' response = request.urlopen( - request.Request(f'http://t.me/addstickers/{pack_name}')) + request.Request(f'http://t.me/addstickers/{pack_name}'), context=ssl.create_default_context(cafile=certifi.where())) if not response.status == 200: await context.edit("连接到 Telegram 服务器失败 . . .") return diff --git a/requirements.txt b/requirements.txt index 830042c..39a9a42 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,4 +31,5 @@ flask_bcrypt flask_wtf wtforms cheroot -PySocks \ No newline at end of file +PySocks +certifi \ No newline at end of file