fix personmeta

This commit is contained in:
jxxghp
2023-10-01 11:52:25 +08:00
parent 2f069afc77
commit fcbfb63645
7 changed files with 251 additions and 69 deletions

View File

@ -880,7 +880,7 @@ class Emby(metaclass=Singleton):
logger.error(f"连接Emby出错" + str(e))
return None
def post_data(self, url: str, data: str = None):
def post_data(self, url: str, data: str = None) -> Optional[Response]:
"""
自定义URL从媒体服务器获取数据其中[HOST]、[APIKEY]、[USER]会被替换成实际的值
:param url: 请求地址
@ -892,7 +892,11 @@ class Emby(metaclass=Singleton):
.replace("[APIKEY]", self._apikey) \
.replace("[USER]", self.user)
try:
return RequestUtils(content_type="application/json").post_res(url=url, data=data)
return RequestUtils(
headers={
"Content-Type": "application/json"
}
).post_res(url=url, data=data)
except Exception as e:
logger.error(f"连接Emby出错" + str(e))
return None