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(""" """, unsafe_allow_html=True) st.markdown('
System Architect: Ramiz Uddin | AI Copyright Shield v5.0
', 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('', unsafe_allow_html=True)