Chrunos commited on
Commit
fef9cb4
·
verified ·
1 Parent(s): 49b9ab8

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -6
main.py CHANGED
@@ -230,17 +230,15 @@ async def download_video_max_quality(request: Request, payload: MaxDownloadReque
230
  if max_dim <= 1080:
231
  # Prefer H.264 (avc1) for 1080 or lower max dimension
232
  logger.info(f"Attempting H.264 codec for requested quality (max dimension): {max_dim}")
233
- format_selector = (
234
- f'bestvideo[height<={long_edge}][vcodec^=avc1]/bestvideo[width<={long_edge}][vcodec^=avc1]+bestaudio/'
235
- f'bestvideo[height<={long_edge}]/bestvideo[width<={long_edge}]+bestaudio/'
236
- f'best[height<={long_edge}]/best[width<={long_edge}]'
237
- )
238
  else:
239
  # For > 1080 max dimension, prioritize best available codec
240
  logger.info(f"Attempting best available codec for requested quality (max dimension): {max_dim}")
241
  format_selector = (
242
  f'bestvideo[height<={max_dim}]/bestvideo[width<={max_dim}]+bestaudio/'
243
- f'best[height<={max_dim}]/best[width<={max_dim}]'
244
  )
245
 
246
 
 
230
  if max_dim <= 1080:
231
  # Prefer H.264 (avc1) for 1080 or lower max dimension
232
  logger.info(f"Attempting H.264 codec for requested quality (max dimension): {max_dim}")
233
+ format_selector = f'bestvideo[height<={long_edge}][vcodec^=avc1]/bestvideo[width<={long_edge}][vcodec^=avc1]+bestaudio/'
234
+ #f'bestvideo[height<={long_edge}]/bestvideo[width<={long_edge}]+bestaudio/'
235
+ #f'best[height<={long_edge}]/best[width<={long_edge}]'
 
 
236
  else:
237
  # For > 1080 max dimension, prioritize best available codec
238
  logger.info(f"Attempting best available codec for requested quality (max dimension): {max_dim}")
239
  format_selector = (
240
  f'bestvideo[height<={max_dim}]/bestvideo[width<={max_dim}]+bestaudio/'
241
+ f'best[height<={max_dim}]/best[width<={max_dim}]+bestaudio/'
242
  )
243
 
244