Skip to content

Commit 93a0464

Browse files
author
SM_SAYEED
committed
preview url from drive utilized
1 parent 893e2d8 commit 93a0464

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,9 @@ def public_clips():
444444
try:
445445
file_id = extract_drive_id(link)
446446
# Manually add extension to help with player detection
447-
ext = '.mp4' if media_type == 'video' else '.mp3'
448-
db_filename = f"https://drive.google.com/uc?export=download&id={file_id}{ext}"
447+
#ext = '.mp4' if media_type == 'video' else '.mp3'
448+
db_filename = f"https://drive.google.com/file/d/{file_id}/preview"
449+
449450
except Exception as e:
450451
message = f"Invalid Google Drive link. ({e})"
451452

templates/clips.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ <h3>Add a Clip from Google Drive</h3>
108108
<b>{{ title }}</b><br>
109109
<small>{{ description }}</small><br>
110110

111-
{% if is_drive and 'mp4' in filename %}
112-
<video controls width="380" style="margin-top:0.7em;">
111+
{% if is_drive %}
112+
<iframe src="{{ filename }}" width="380" height="240" allow="autoplay" allowfullscreen style="margin-top:0.7em;"></iframe>
113113
<source src="{{ filename }}">
114114
Your browser does not support the video tag.
115115
</video>

0 commit comments

Comments
 (0)