xulh commited on
Commit
db9362b
·
1 Parent(s): d402a6b

代码初始化

Browse files
Files changed (1) hide show
  1. video/shortVedio.py +21 -0
video/shortVedio.py CHANGED
@@ -126,3 +126,24 @@ async def episode_search(
126
  except requests.exceptions.RequestException as e:
127
  # 处理请求错误
128
  raise HTTPException(status_code=500, detail=f"请求第三方API出错: {str(e)}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  except requests.exceptions.RequestException as e:
127
  # 处理请求错误
128
  raise HTTPException(status_code=500, detail=f"请求第三方API出错: {str(e)}")
129
+
130
+
131
+ @shortVideo.get("/video/playlet/auth")
132
+ async def episode_auth(
133
+ eid: int = Query(1, description="剧集id"),
134
+ zlsj: str = Query("zlsj", description="跳过加解密")
135
+ ):
136
+ """
137
+ 视频搜索接口 - 封装第三方 API。
138
+ """
139
+ try:
140
+ # 发送请求到第三方API
141
+ response = requests.post(EXTERNAL_API_URL + "/api/playlet/auth?eid=" + str(eid) + '&zlsj=' + zlsj)
142
+ response.raise_for_status() # 确保HTTP请求成功
143
+
144
+ # 返回第三方API的结果
145
+ return response.json()
146
+
147
+ except requests.exceptions.RequestException as e:
148
+ # 处理请求错误
149
+ raise HTTPException(status_code=500, detail=f"请求第三方API出错: {str(e)}")