update
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import subprocess
|
||||
import threading
|
||||
from pathlib import Path
|
||||
|
||||
from database.database import SessionLocal
|
||||
@@ -8,6 +9,10 @@ VIDEOS_DIR = "/videos"
|
||||
MIN_VALID_SIZE = 1024 * 100 # 100 KB
|
||||
|
||||
|
||||
def downloadAsync(videoId: int, youtubeUrl: str):
|
||||
threading.Thread(target=downloadVideo, args=(videoId, youtubeUrl)).start()
|
||||
|
||||
|
||||
def downloadVideo(videoId: int, youtubeUrl: str):
|
||||
outputPath = f"{VIDEOS_DIR}/{videoId}.mp4"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user