SafeUpload is an application that allows users to securely upload and store videos while ensuring they do not contain any Not Safe for Work (NSFW) content. It integrates with Livepeer for video uploading and Web3 Storage for decentralized and secure storage of the uploaded content.
- For video with no NSFW content Web UI
- For video with NSFW content Web UI
const axios = require("axios");
const videoPath = "deep.mp4";
axios
.post("http://localhost:3000/nsfwcheck", { videoPath })
.then((response) => {
console.log(response.data);
const { nsfwContent } = response.data;
console.log(nsfwContent);
if (nsfwContent?.length === 1) {
axios
.post("http://localhost:3000/uploadtolivepeer", {
name: videoPath.slice(0, -4),
description: "Test for NSFW content",
videoUrl: videoPath,
})
.then((response) => {
console.log("Asset uploaded to Livepeer");
console.log(response.data.asset);
axios
.post("http://localhost:3000/uploadtow3", { videoPath })
.then((response) => {
console.log("Root CID uploaded to W3 Storage");
console.log(response.data.rootCid);
})
.catch((error) => {
console.error(error);
});
})
.catch((error) => {
console.error(error);
});
}
})
.catch((error) => {
console.error(error);
});
- For video with no NSFW content response
- For video with NSFW content response
- NSFW Content Detection: The app utilizes NSFW detection algorithms to analyze videos and determine if they contain explicit or inappropriate content.
- Livepeer Integration: SafeUpload seamlessly integrates with Livepeer to facilitate secure and reliable video uploading.
- Web3 Storage Integration: Uploaded videos are stored on Web3 Storage, ensuring decentralized and immutable storage for increased data security.
- Automated NSFW Check: Videos undergo an automated NSFW check before being uploaded, preventing the upload of explicit or inappropriate content.
- Server Architecture: The app follows a client-server architecture, where the server handles the NSFW detection, video uploading to Livepeer, and storage to Web3 Storage.
The SafeUpload app follows a client-server architecture, with the following components:
The client-side of the app consists of the following:
Frontend UI: The user interface where users can initiate video uploads, view upload progress, and receive notifications. built using vite react
The server-side of the app consists of the following:
- Express.js Server: The backend server built using Express.js that handles incoming requests and responses.
- ffmpeg: Converts the videos into snapshopts and sends for NSFWcheck
- NSFW Detection: Utilizes the NSFW detection library to analyze generated snapshots and determine if they contain explicit or inappropriate content.
- Livepeer Integration: Interacts with the Livepeer API to facilitate secure video uploading and processing.
- Web3 Storage Integration: Uses the Web3 Storage client library to store the uploaded videos in a decentralized and secure manner.
To get started with SafeUpload, follow these steps:
Clone the repository: git clone https://github.com/AvinashNayak27/hackfs23
cd backend
Install dependencies: yarn
node app.js
cd frontend
Install dependencies: yarn
yarn dev
Monitor the console output for NSFW checks, Livepeer uploads, and Web3 Storage uploads.
Access the frontend UI to view the upload progress and notifications.