Download app.py from mmty/VPsl: direct link, hf CLI and curl.
- Browser
- Download file 456 Bytes
-
https://huggingface.co/spaces/mmty/VPsl/resolve/main/app.py
- Command line
-
hf download hf://spaces/mmty/VPsl/app.py
-
curl -L -o app.py https://huggingface.co/spaces/mmty/VPsl/resolve/main/app.py
456 Bytes
| import streamlit as st | |
| from io import BytesIO | |
| import base64 | |
| st.title("Video Player") | |
| def allowed_file(filename): | |
| return '.' in filename and filename.rsplit('.', 1)[1].lower() in ['mp4'] | |
| uploaded_file = st.file_uploader("Select a video", type=None) | |
| if uploaded_file: | |
| if allowed_file(uploaded_file.name): | |
| video_bytes = uploaded_file.getvalue() | |
| st.video(video_bytes) | |
| else: | |
| st.write("Error: Only MP4 files are allowed.") |