本地调试导致API返回403的注释代码

This commit is contained in:
呆瓜云 2023-08-17 15:29:56 +08:00
parent 223a1077bf
commit cd8fb2ad83

View File

@ -71,13 +71,12 @@ class GMEEK():
return user.get_repo(repo)
def markdown2html(self,mdstr):
return mdstr
# payload = {"text": mdstr, "mode": "markdown"}
# ret=requests.post("https://api.github.com/markdown", json=payload,headers={"Authorzation":"token {}".format(self.options.github_token)})
# if ret.status_code==200:
# return ret.text
# else:
# raise Exception("markdown2html error status_code=%d"%(ret.status_code))
payload = {"text": mdstr, "mode": "markdown"}
ret=requests.post("https://api.github.com/markdown", json=payload,headers={"Authorzation":"token {}".format(self.options.github_token)})
if ret.status_code==200:
return ret.text
else:
raise Exception("markdown2html error status_code=%d"%(ret.status_code))
def renderHtml(self,template,blogBase,postListJson,htmlDir):
file_loader = FileSystemLoader('templates')