From 3ff39183a97c54b6714119bdb640d1e100dfdb2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=86=E7=93=9C=E4=BA=91?= Date: Mon, 31 Jul 2023 16:34:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=87=E9=A2=98=E5=90=AB?= =?UTF-8?q?=E6=9C=89=E7=A9=BA=E6=A0=BC=E5=AF=BC=E8=87=B4URL=E5=87=BA?= =?UTF-8?q?=E9=94=99=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用urllib库进行转义,把空格转义为%20 --- Gmeek.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gmeek.py b/Gmeek.py index e1a7ac2..88e489e 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -4,6 +4,7 @@ import json import time import datetime import shutil +import urllib import requests import argparse from github import Github @@ -99,7 +100,7 @@ class GMEEK(): self.blogBase["postListJson"][postNum]["label"]=issue.labels[0].name self.blogBase["postListJson"][postNum]["labelColor"]=self.labelColorDict[issue.labels[0].name] self.blogBase["postListJson"][postNum]["postTitle"]=issue.title - self.blogBase["postListJson"][postNum]["postUrl"]=self.post_folder+'{}.html'.format(Pinyin().get_pinyin(issue.title)) + self.blogBase["postListJson"][postNum]["postUrl"]=urllib.parse.quote(self.post_folder+'{}.html'.format(Pinyin().get_pinyin(issue.title))) self.blogBase["postListJson"][postNum]["postSourceUrl"]="https://github.com/"+options.repo_name+"/issues/"+str(issue.number) self.blogBase["postListJson"][postNum]["commentNum"]=issue.get_comments().totalCount