razhan commited on
Commit
3eeb914
·
verified ·
1 Parent(s): 16c671e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -214,20 +214,19 @@ def download_yt_audio(yt_url, filename):
214
  # raise gr.Error(str(err))
215
 
216
  # file_length = info["duration_string"]
217
- file_length = 60 * 10
218
- file_h_m_s = file_length.split(":")
219
- file_h_m_s = [int(sub_length) for sub_length in file_h_m_s]
220
 
221
- if len(file_h_m_s) == 1:
222
- file_h_m_s.insert(0, 0)
223
- if len(file_h_m_s) == 2:
224
- file_h_m_s.insert(0, 0)
225
- file_length_s = file_h_m_s[0] * 3600 + file_h_m_s[1] * 60 + file_h_m_s[2]
226
 
227
- if file_length_s > YT_LENGTH_LIMIT_S:
228
- yt_length_limit_hms = time.strftime("%HH:%MM:%SS", time.gmtime(YT_LENGTH_LIMIT_S))
229
- file_length_hms = time.strftime("%HH:%MM:%SS", time.gmtime(file_length_s))
230
- raise gr.Error(f"Maximum YouTube length is {yt_length_limit_hms}, got {file_length_hms} YouTube video.")
231
 
232
  ydl_opts = {"outtmpl": filename, "format": "worstvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best"}
233
 
 
214
  # raise gr.Error(str(err))
215
 
216
  # file_length = info["duration_string"]
217
+ # file_h_m_s = file_length.split(":")
218
+ # file_h_m_s = [int(sub_length) for sub_length in file_h_m_s]
 
219
 
220
+ # if len(file_h_m_s) == 1:
221
+ # file_h_m_s.insert(0, 0)
222
+ # if len(file_h_m_s) == 2:
223
+ # file_h_m_s.insert(0, 0)
224
+ # file_length_s = file_h_m_s[0] * 3600 + file_h_m_s[1] * 60 + file_h_m_s[2]
225
 
226
+ # if file_length_s > YT_LENGTH_LIMIT_S:
227
+ # yt_length_limit_hms = time.strftime("%HH:%MM:%SS", time.gmtime(YT_LENGTH_LIMIT_S))
228
+ # file_length_hms = time.strftime("%HH:%MM:%SS", time.gmtime(file_length_s))
229
+ # raise gr.Error(f"Maximum YouTube length is {yt_length_limit_hms}, got {file_length_hms} YouTube video.")
230
 
231
  ydl_opts = {"outtmpl": filename, "format": "worstvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best"}
232