Saqib
commited on
Commit
•
e8a3016
1
Parent(s):
b894380
Update modules/app.py
Browse files- modules/app.py +2 -0
modules/app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from fastapi import FastAPI, HTTPException, Request, Depends
|
2 |
from fastapi.staticfiles import StaticFiles
|
3 |
from pytube import YouTube
|
|
|
4 |
import uuid
|
5 |
import logging
|
6 |
import aiohttp
|
@@ -48,6 +49,7 @@ async def get_audio(url: str):
|
|
48 |
raise HTTPException(status_code=400, detail="URL is required")
|
49 |
|
50 |
try:
|
|
|
51 |
yt = YouTube(url)
|
52 |
video = yt.streams.filter(only_audio=True).first()
|
53 |
|
|
|
1 |
from fastapi import FastAPI, HTTPException, Request, Depends
|
2 |
from fastapi.staticfiles import StaticFiles
|
3 |
from pytube import YouTube
|
4 |
+
import time
|
5 |
import uuid
|
6 |
import logging
|
7 |
import aiohttp
|
|
|
49 |
raise HTTPException(status_code=400, detail="URL is required")
|
50 |
|
51 |
try:
|
52 |
+
time.sleep(2)
|
53 |
yt = YouTube(url)
|
54 |
video = yt.streams.filter(only_audio=True).first()
|
55 |
|