dx / app.py
COLTO50's picture
Create app.py
11b3431 verified
raw
history blame contribute delete
784 Bytes
import streamlit as st
import os
def save_uploaded_file(uploaded_file):
try:
with open(os.path.join("uploads", uploaded_file.name), "wb") as f:
f.write(uploaded_file.getbuffer())
return True
except:
return False
st.set_page_config(page_title="Video Uploader for Hugging Face Spaces")
st.title("Video Uploader for Hugging Face Spaces")
uploaded_file = st.file_uploader("Choose a video file", type=['mp4', 'mkv', 'avi', 'mov'])
if uploaded_file is not None:
if save_uploaded_file(uploaded_file):
st.success("File successfully uploaded")
else:
st.error("Error uploading file")
# Display the HTML content
with open("index.html", "r") as f:
html_content = f.read()
st.components.v1.html(html_content, height=600)