Update main.py
Browse files
main.py
CHANGED
@@ -273,19 +273,16 @@ async def webchat(question:str):
|
|
273 |
@app.get("/youtube")
|
274 |
async def ytranscript(url : str):
|
275 |
global transcript
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
print("hi")
|
281 |
response=model.generate_content([prompt6,transcript_text])
|
282 |
print(response.text)
|
283 |
return response.text
|
284 |
-
|
285 |
-
|
286 |
-
return {"unable to retrieve data"}
|
287 |
-
except:
|
288 |
-
raise HTTPException(status_code=500, detail="Internal Server Error")
|
289 |
|
290 |
|
291 |
@app.post("/ytqanda")
|
|
|
273 |
@app.get("/youtube")
|
274 |
async def ytranscript(url : str):
|
275 |
global transcript
|
276 |
+
transcript_text=extract_transcript(url)
|
277 |
+
print(transcript_text)
|
278 |
+
if transcript_text:
|
279 |
+
try:
|
280 |
print("hi")
|
281 |
response=model.generate_content([prompt6,transcript_text])
|
282 |
print(response.text)
|
283 |
return response.text
|
284 |
+
except:
|
285 |
+
raise HTTPException(status_code=500, detail="Internal Server Error")
|
|
|
|
|
|
|
286 |
|
287 |
|
288 |
@app.post("/ytqanda")
|