Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +2 -3
src/streamlit_app.py
CHANGED
|
@@ -14,12 +14,11 @@ if st.button("Download"):
|
|
| 14 |
else:
|
| 15 |
with st.spinner("Downloading video..."):
|
| 16 |
try:
|
| 17 |
-
# Use a
|
| 18 |
with tempfile.TemporaryDirectory() as tmp_dir:
|
| 19 |
ydl_opts = {
|
| 20 |
'outtmpl': os.path.join(tmp_dir, '%(title)s.%(ext)s'),
|
| 21 |
-
'format': '
|
| 22 |
-
'merge_output_format': 'mp4',
|
| 23 |
'noplaylist': True,
|
| 24 |
'quiet': True,
|
| 25 |
'http_headers': {
|
|
|
|
| 14 |
else:
|
| 15 |
with st.spinner("Downloading video..."):
|
| 16 |
try:
|
| 17 |
+
# Use a temp folder
|
| 18 |
with tempfile.TemporaryDirectory() as tmp_dir:
|
| 19 |
ydl_opts = {
|
| 20 |
'outtmpl': os.path.join(tmp_dir, '%(title)s.%(ext)s'),
|
| 21 |
+
'format': 'mp4/best[ext=mp4]/best', # avoid separate audio/video streams
|
|
|
|
| 22 |
'noplaylist': True,
|
| 23 |
'quiet': True,
|
| 24 |
'http_headers': {
|