Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,6 +13,9 @@ DOWNLOAD_DIR = Path("downloads/")
|
|
13 |
if not DOWNLOAD_DIR.exists():
|
14 |
DOWNLOAD_DIR.mkdir(parents=True)
|
15 |
|
|
|
|
|
|
|
16 |
@app.get("/")
|
17 |
def greet_json():
|
18 |
return {"Hello": "World!"}
|
@@ -26,6 +29,7 @@ def download_video(url: str):
|
|
26 |
'outtmpl': str(DOWNLOAD_DIR / '%(id)s.%(ext)s'), # Output path template
|
27 |
'noplaylist': True, # Avoid downloading playlists, if it's a playlist URL
|
28 |
'quiet': True, # Suppress unnecessary output
|
|
|
29 |
}
|
30 |
|
31 |
# Create a temporary filename for the video
|
|
|
13 |
if not DOWNLOAD_DIR.exists():
|
14 |
DOWNLOAD_DIR.mkdir(parents=True)
|
15 |
|
16 |
+
# Path to the cookies.txt file
|
17 |
+
COOKIES_FILE = Path("cookies.txt")
|
18 |
+
|
19 |
@app.get("/")
|
20 |
def greet_json():
|
21 |
return {"Hello": "World!"}
|
|
|
29 |
'outtmpl': str(DOWNLOAD_DIR / '%(id)s.%(ext)s'), # Output path template
|
30 |
'noplaylist': True, # Avoid downloading playlists, if it's a playlist URL
|
31 |
'quiet': True, # Suppress unnecessary output
|
32 |
+
'cookies': str(COOKIES_FILE), # Use cookies from the specified file
|
33 |
}
|
34 |
|
35 |
# Create a temporary filename for the video
|