Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
218 |
-
file_h_m_s =
|
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 |
-
|
223 |
-
if len(file_h_m_s) == 2:
|
224 |
-
|
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 |
-
|
229 |
-
|
230 |
-
|
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 |
|