vshield-pro / app.py
Ramiz404's picture
Upload 3 files
a1c942f verified
Raw History Blame Contribute Delete
3.55 kB
import streamlit as st
import subprocess
import os
import uuid
from yt_dlp import YoutubeDL
# Page Branding
st.set_page_config(page_title="V-SHIELD AI | Ramiz Uddin", page_icon="πŸ›‘οΈ", layout="wide")
# Custom CSS for Premium UI
st.markdown("""
<style>
.main { background-color: #020617; color: #f8fafc; }
.stButton>button { width: 100%; border-radius: 20px; background: linear-gradient(135deg, #6366f1, #a855f7); color: white; font-weight: 900; height: 60px; border: none; font-size: 18px; }
.title { font-size: 60px; font-weight: 900; background: -webkit-linear-gradient(#818cf8, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-align: center; margin-bottom: 0px; }
.subtitle { text-align: center; color: #64748b; font-size: 14px; margin-bottom: 50px; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; }
.footer { text-align: center; padding: 20px; font-size: 12px; color: #475569; border-top: 1px solid #1e293b; margin-top: 50px; font-weight: bold; }
</style>
""", unsafe_allow_html=True)
st.markdown('<h1 class="title">V-SHIELD PRO</h1>', unsafe_allow_html=True)
st.markdown('<p class="subtitle">System Architect: Ramiz Uddin | AI Copyright Shield v5.0</p>', unsafe_allow_html=True)
# Main Processing Logic (NO MIRRORING)
def shield_video(input_path):
output_path = f"Shielded_{uuid.uuid4().hex}.mp4"
# Logic: Subtle color tweak, speed 1.01x, and metadata wipe.
# NO hflip used here.
cmd = [
"ffmpeg", "-i", input_path,
"-vf", "setpts=1.0/1.01*PTS,eq=brightness=0.01:contrast=1.02:saturation=1.03,unsharp=3:3:1.2",
"-af", "atempo=1.01,aresample=44100",
"-map_metadata", "-1",
"-c:v", "libx264", "-preset", "ultrafast", "-crf", "22",
"-c:a", "aac", "-b:a", "128k",
output_path, "-y"
]
subprocess.run(cmd, capture_output=True)
return output_path
tab1, tab2 = st.tabs(["πŸš€ LOCAL UPLOAD", "πŸ”— CLOUD SCAN"])
with tab1:
file = st.file_uploader("Select Video", type=["mp4", "mov", "avi"])
if file:
st.video(file)
if st.button("ACTIVATE DEEP SHIELD (LOCAL)"):
with st.spinner("πŸ›‘οΈ AI Guard is modifying content signatures..."):
with open("temp.mp4", "wb") as f: f.write(file.getbuffer())
out = shield_video("temp.mp4")
st.success("βœ… Video Shielded Successfully! Mirroring: Disabled.")
with open(out, "rb") as f:
st.download_button("πŸ“₯ DOWNLOAD SHIELDED VIDEO", f, file_name="Shielded_by_Ramiz.mp4")
with tab2:
url = st.text_input("Paste Video URL")
if url:
if st.button("SCAN & SHIELD (CLOUD)"):
with st.spinner("πŸ” Extracting from Cloud..."):
try:
ydl_opts = {'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]', 'outtmpl': 'cloud_temp.mp4'}
with YoutubeDL(ydl_opts) as ydl: ydl.download([url])
st.video("cloud_temp.mp4")
out = shield_video("cloud_temp.mp4")
st.success("βœ… Cloud Content Shielded!")
with open(out, "rb") as f:
st.download_button("πŸ“₯ DOWNLOAD SECURE FILE", f, file_name="Cloud_Shielded_by_Ramiz.mp4")
except Exception as e:
st.error(f"Error: {str(e)}")
st.markdown('<div class="footer">CREATED BY RAMIZ UDDIN | V-SHIELD AI &copy; 2026 | 24/7 CLOUD ACTIVE</div>', unsafe_allow_html=True)