Spaces:
Sleeping
Sleeping
video fix
Browse files- video_parser.py +4 -3
video_parser.py
CHANGED
|
@@ -12,11 +12,12 @@ class VideoParser:
|
|
| 12 |
def download_youtube_video(self, url: str) -> str:
|
| 13 |
"""Download YouTube video and return local path"""
|
| 14 |
ydl_opts = {
|
| 15 |
-
'format': '
|
| 16 |
'outtmpl': os.path.join(self.temp_dir, '%(title)s.%(ext)s'),
|
| 17 |
'quiet': True,
|
| 18 |
-
'
|
| 19 |
-
'
|
|
|
|
| 20 |
}
|
| 21 |
|
| 22 |
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
|
|
|
| 12 |
def download_youtube_video(self, url: str) -> str:
|
| 13 |
"""Download YouTube video and return local path"""
|
| 14 |
ydl_opts = {
|
| 15 |
+
'format': 'worst[height<=480]/worst',
|
| 16 |
'outtmpl': os.path.join(self.temp_dir, '%(title)s.%(ext)s'),
|
| 17 |
'quiet': True,
|
| 18 |
+
'no_warnings': True,
|
| 19 |
+
'extract_flat': False,
|
| 20 |
+
'user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
|
| 21 |
}
|
| 22 |
|
| 23 |
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|