Skip to content

Commit 3c146b4

Browse files
author
SM_SAYEED
committed
more rendering fixes!
1 parent e8ed132 commit 3c146b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,13 @@ def public_clips():
436436
file.save(filepath)
437437
db_filename = 'clips/' + filename
438438
elif link:
439+
media_type = request.form.get('media_type', 'audio') # get file type from form (mp3 or mp4)
439440
try:
440441
file_id = extract_drive_id(link)
441-
db_filename = f"https://drive.google.com/uc?export=download&id={file_id}"
442+
if media_type == 'video':
443+
db_filename = f"https://drive.google.com/uc?export=download&id={file_id}.mp4"
444+
else:
445+
db_filename = f"https://drive.google.com/uc?export=download&id={file_id}.mp3"
442446
except:
443447
message = "Invalid Google Drive link."
444448
else:

0 commit comments

Comments
 (0)