maaz21 commited on
Commit
f7d4277
·
verified ·
1 Parent(s): 76b59ce

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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 temporary directory
18
  with tempfile.TemporaryDirectory() as tmp_dir:
19
  ydl_opts = {
20
  'outtmpl': os.path.join(tmp_dir, '%(title)s.%(ext)s'),
21
- 'format': 'bestvideo+bestaudio/best',
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': {