From 40432a1164289f3c04ae78cf66eb1531491cebaf Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 25 Sep 2022 18:23:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20=E5=88=86=E7=A6=BB=20he?= =?UTF-8?q?aders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- defs/bilibili.py | 3 +-- headers.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 headers.py diff --git a/defs/bilibili.py b/defs/bilibili.py index 0bcf6a3..2637ce4 100644 --- a/defs/bilibili.py +++ b/defs/bilibili.py @@ -11,6 +11,7 @@ from io import BytesIO from PIL import Image, ImageDraw, ImageFont from defs.browser import get_browser +from headers import headers def cut_text(old_str, cut): @@ -188,8 +189,6 @@ def binfo_image_create(video_info: dict): # UP主 # 等级 0-4 \uE6CB-F 5-6\uE6D0-1 # UP \uE723 - headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'} - if "staff" in video_info["data"]: up_list = [] for up in video_info["data"]["staff"]: diff --git a/headers.py b/headers.py new file mode 100644 index 0000000..746f22e --- /dev/null +++ b/headers.py @@ -0,0 +1 @@ +headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'}