🐛➕ 增加 certifi 处理 sticker 请求网页 ssl 证书问题
This commit is contained in:
parent
a73f289bde
commit
00e59fe51a
@ -1,5 +1,7 @@
|
|||||||
""" PagerMaid module to handle sticker collection. """
|
""" PagerMaid module to handle sticker collection. """
|
||||||
|
|
||||||
|
import certifi
|
||||||
|
import ssl
|
||||||
from asyncio import sleep
|
from asyncio import sleep
|
||||||
from os import remove
|
from os import remove
|
||||||
from urllib import request
|
from urllib import request
|
||||||
@ -88,7 +90,7 @@ async def sticker(context):
|
|||||||
command = '/newanimated'
|
command = '/newanimated'
|
||||||
|
|
||||||
response = request.urlopen(
|
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:
|
if not response.status == 200:
|
||||||
await context.edit("连接到 Telegram 服务器失败 . . .")
|
await context.edit("连接到 Telegram 服务器失败 . . .")
|
||||||
return
|
return
|
||||||
|
@ -32,3 +32,4 @@ flask_wtf
|
|||||||
wtforms
|
wtforms
|
||||||
cheroot
|
cheroot
|
||||||
PySocks
|
PySocks
|
||||||
|
certifi
|
Loading…
Reference in New Issue
Block a user