### Start Automated Video Creation (Bash) Source: https://context7.com/shivampansuriya/clipai/llms.txt Initiates the automated video generation bot using a cURL command. This endpoint starts a continuous content creation process. It requires the user ID, a chat type (e.g., HISTORY_SCHOKING), and the base URL. The response indicates if automation started successfully. ```bash curl -X POST http://localhost:8080/api/v2/youtube/12345/HISTORY_SCHOKING/automate # Response: true (automation started successfully) ``` -------------------------------- ### Start Automated Video Creation Source: https://context7.com/shivampansuriya/clipai/llms.txt Initiates the automated video generation bot for continuous content creation. This includes picking topics, generating scripts, images, and videos, and uploading them to YouTube. ```APIDOC ## POST /api/v2/youtube/{userId}/{chatType}/automate ### Description Starts the automated video generation bot. ### Method POST ### Endpoint `/api/v2/youtube/{userId}/{chatType}/automate` ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user. - **chatType** (string) - Required - The type of content to automate (e.g., HISTORY_SCHOKING, SCIENCE, MYSTERY, TECHNOLOGY). ### Request Body None ### Response #### Success Response (200) - **boolean** - `true` if automation started successfully. #### Response Example ```json true ``` ### Notes - Automation features include topic selection, script and video generation, YouTube upload, and scheduling. - The bot continues until manually stopped. ``` -------------------------------- ### Python Text-to-Speech Script Source: https://context7.com/shivampansuriya/clipai/llms.txt This Python script uses the 'edge-tts' library to convert input text into speech. It allows customization of voice and speech rate, saving the output as an MP3 file. Ensure 'edge-tts' is installed (`pip install edge-tts`). ```python import asyncio import argparse from edge_tts import Communicate async def quick_fast_tts(text: str): voice = "en-US-ChristopherNeural" speed = "+20%" # 20% faster for engaging narration communicate = Communicate(text, voice, rate=speed) await communicate.save("src/main/resources/static/narration.mp3") if __name__ == "__main__": parser = argparse.ArgumentParser(description="Text-to-Speech") parser.add_argument("text", help="Text to convert to speech") args = parser.parse_args() asyncio.run(quick_fast_tts(args.text)) ``` -------------------------------- ### Check Upload Delay Status (Bash) Source: https://context7.com/shivampansuriya/clipai/llms.txt Retrieves the current upload delay settings for a user. This GET request helps in monitoring the automation schedule and understanding the time interval between consecutive video uploads, which is crucial for preventing YouTube spam detection. The response indicates if delay information was printed to logs. ```bash curl -X GET http://localhost:8080/api/v2/youtube/12345/delay # Response: true (delay information printed to logs) ``` -------------------------------- ### Docker Deployment for ClipAI Source: https://context7.com/shivampansuriya/clipai/llms.txt Dockerfile and bash scripts for building and running the ClipAI application in a Docker container. Uses a multi-stage build for optimization and provides commands for building, running, viewing logs, and performing health checks. ```dockerfile # Multi-stage build for optimized image size # Stage 1: Build with Maven FROM maven:3.8.4-openjdk-17 AS build WORKDIR /app COPY pom.xml . RUN mvn dependency:go-offline COPY src ./src RUN mvn clean package -DskipTests # Stage 2: Runtime with minimal JRE FROM openjdk:17-jdk-slim WORKDIR /app COPY --from=build /app/target/ClipAI-0.0.1-SNAPSHOT.jar . EXPOSE 8080 ENTRYPOINT ["java","-jar","/app/ClipAI-0.0.1-SNAPSHOT.jar"] ``` ```bash # Build Docker image docker build -t clipai:latest . # Run with environment variables docker run -d \ -p 8080:8080 \ -e GEMINI_API_KEY=your_gemini_key \ -e HUGGINGFACE_API_KEY=your_hf_key \ -e YOUTUBE_CLIENT_ID=your_client_id \ -e YOUTUBE_CLIENT_SECRET=your_client_secret \ -v $(pwd)/output:/app/src/main/resources/static \ --name clipai-service \ clipai:latest # Check logs docker logs -f clipai-service # Health check curl http://localhost:8080/actuator/health ``` -------------------------------- ### Video Creation Service Core Logic (Java) Source: https://context7.com/shivampansuriya/clipai/llms.txt Demonstrates the core video assembly process within the `ContentCreationService`. It uses the `VideoCreator` and `AudioService` to generate short videos with synchronized subtitles, transitions, and custom fonts. The code outlines the steps for preparing paths and creating the video, along with its technical specifications. ```java // Example usage in service layer @Service public class ContentCreationService { @Autowired private VideoCreator videoCreator; @Autowired private AudioService audioService; public void createShortVideo(ClipAIRest request) throws Exception { // 1. Prepare paths String audioPath = "src/main/resources/static/narration.mp3"; String outputDir = "src/main/resources/static"; String videoOutput = "final_video.mp4"; // 2. Create video with synchronized subtitles videoCreator.createVideo(audioPath, outputDir, videoOutput, request); // Video specs: // - Resolution: 1080x1920 (9:16 aspect ratio) // - Frame rate: 30 FPS // - Codec: H.264 with CRF 18 (high quality) // - Audio: AAC 320kbps stereo // Automatic features: // - Word-level subtitle synchronization using Whisper // - 0.5s crossfade transitions between images // - Images match script keywords chronologically // - Custom font support (Bangers-Regular.ttf) // - High-quality bicubic image scaling // - Proper color space handling (BT.709) } // Adding background music to existing video public void addBackgroundMusic() throws Exception { // Automatically mixes background audio at 8% volume // Input: final_video.mp4 + background_audio.mp3 // Output: output_video.mp4 videoCreator.addBackground(); } } // Image timing and keyword matching // The system automatically matches generated images to script keywords: // Example script: "The ancient temple in the mist stood for centuries" // Matched image: "temple_in_the_mist.png" // Shows 0.2s before keyword is spoken for better visual flow ``` -------------------------------- ### Assemble Video from Images, Audio, and Script Source: https://context7.com/shivampansuriya/clipai/llms.txt Creates a final video by assembling provided images, a script, and audio file. Supports transitions, subtitles, and audio synchronization. Prerequisites include specific file paths for audio and images, and a configured Python TTS script. ```bash curl -X POST http://localhost:8080/api/v2/generate/videos \ -H "Content-Type: application/json" \ -d '{ \ "script": "The cosmos holds infinite mysteries. Black holes warp spacetime. Galaxies collide in spectacular fashion.", \ "images": [ \ { \ "key": "black_hole", \ "description": "...", \ "width": 1080, \ "height": 1920 \ }, \ { \ "key": "galaxy_collision", \ "description": "...", \ "width": 1080, \ "height": 1920 \ } \ ] \ }' ``` -------------------------------- ### Generate Images from Prompts using HuggingFace API Source: https://context7.com/shivampansuriya/clipai/llms.txt Generates images based on provided descriptions using the HuggingFace API. Requires API key configuration and saves images to a local path. Supports automatic retries for failed image generation. ```bash curl -X POST http://localhost:8080/api/v2/generate/images \ -H "Content-Type: application/json" \ -d '{ \ "images": [ \ { \ "key": "space_station", \ "description": "Cinematic shot of International Space Station orbiting Earth at golden hour", \ "width": 1080, \ "height": 1920 \ } \ ] \ }' ``` -------------------------------- ### Add Topics for Automation Source: https://context7.com/shivampansuriya/clipai/llms.txt Adds topics to the automation queue for scheduled video creation. Topics are used sequentially by the automation bot. ```APIDOC ## POST /api/v2/youtube/{userId}/topic ### Description Adds topics to the automation queue for video creation. ### Method POST ### Endpoint `/api/v2/youtube/{userId}/topic` ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user. #### Query Parameters None #### Request Body - **topic** (array of strings) - Required - A list of topics to add to the queue. ### Request Example ```json { "topic": [ "The Lost City of Atlantis", "Ancient Roman Engineering", "Mysterious Nazca Lines" ] } ``` ### Response #### Success Response (200) - **boolean** - `true` if topics were added successfully. #### Response Example ```json true ``` ### Notes - Topics are processed in the order they are added. - Each topic results in one complete video. - The automation bot selects the next topic after a video is successfully uploaded. ``` -------------------------------- ### VideoCreator Service - Core Video Assembly Source: https://context7.com/shivampansuriya/clipai/llms.txt Details the video creation process handled by the `VideoCreator` service, including specifications and automatic features. ```APIDOC ## Java Service: ContentCreationService ### Description Handles the creation of short videos using the `VideoCreator` service, including synchronization, transitions, and image matching. ### Method N/A (Java Service Method) ### Endpoint N/A ### Parameters #### Request Object (`ClipAIRest`) - **audioPath** (string) - Path to the narration audio file. - **outputDir** (string) - Directory for storing output files. - **videoOutput** (string) - Filename for the final video. ### Video Specifications - **Resolution**: 1080x1920 (9:16 aspect ratio) - **Frame rate**: 30 FPS - **Codec**: H.264 with CRF 18 - **Audio**: AAC 320kbps stereo ### Automatic Features - Word-level subtitle synchronization using Whisper. - 0.5s crossfade transitions between images. - Images chronologically match script keywords. - Custom font support (`Bangers-Regular.ttf`). - High-quality bicubic image scaling. - Proper color space handling (BT.709). ### Background Music - Automatically mixes background audio at 8% volume. - Input: `final_video.mp4` + `background_audio.mp3` - Output: `output_video.mp4` ### Image Timing - Images are displayed 0.2s before the corresponding keyword is spoken for better visual flow. ``` -------------------------------- ### POST /api/v2/generate/videos Source: https://context7.com/shivampansuriya/clipai/llms.txt Assembles a video from provided images and script, including transitions, subtitles, and audio synchronization. Assumes audio and image files are pre-existing. ```APIDOC ## POST /api/v2/generate/videos ### Description Creates a final video with transitions, subtitles, and audio synchronization. The video is output to `src/main/resources/static/final_video.mp4`. ### Method POST ### Endpoint /api/v2/generate/videos ### Parameters #### Request Body - **script** (string) - Required - The text script to be narrated in the video. - **images** (array) - Required - An array of image objects to be used in the video. - **key** (string) - Required - The key identifying the image file (e.g., `black_hole`). - **description** (string) - Optional - Description for the image (used for generation if not present). - **width** (integer) - Required - The width of the image. - **height** (integer) - Required - The height of the image. ### Request Example ```json { "script": "The cosmos holds infinite mysteries. Black holes warp spacetime. Galaxies collide in spectacular fashion.", "images": [ { "key": "black_hole", "description": "...", "width": 1080, "height": 1920 }, { "key": "galaxy_collision", "description": "...", "width": 1080, "height": 1920 } ] } ``` ### Response #### Success Response (200) - Typically returns a success status or the path to the generated video. ### Prerequisites - Audio file must exist at: `src/main/resources/static/narration.mp3`. - Image files must exist at: `src/main/resources/static/{key}.png`. - Python TTS script must be configured (`main.py`). ### Features - 1080x1920 vertical format (YouTube Shorts). - 30 FPS. - 0.5 second cross-fade transitions between images. - Word-by-word subtitles synchronized with audio. - H.264 codec with high quality settings. - Background music mixing support. ``` -------------------------------- ### Generate SEO-Optimized YouTube Video Metadata Source: https://context7.com/shivampansuriya/clipai/llms.txt Creates SEO-optimized title, description, and tags for YouTube videos based on a provided script. This helps in improving video discoverability on the platform. ```bash curl -X POST http://localhost:8080/api/v2/youtube/description \ -H "Content-Type: application/json" \ -d '{ \ "script": "The Titanic sank on April 15, 1912, after hitting an iceberg. Over 1500 people lost their lives in one of the deadliest maritime disasters. The ship was deemed unsinkable, yet it took only 2 hours and 40 minutes to sink completely." \ }' ``` -------------------------------- ### POST /api/v2/generate/image Source: https://context7.com/shivampansuriya/clipai/llms.txt Creates detailed image descriptions based on the script for AI image generation. ```APIDOC ## POST /api/v2/generate/image ### Description Creates detailed image descriptions based on the script for AI image generation. ### Method POST ### Endpoint /api/v2/generate/image ### Parameters #### Query Parameters - **type** (string) - Optional - The style of image prompts to generate. Use 'animation' for animation-style prompts. Defaults to 'regular'. #### Request Body - **topic** (string) - Required - The main subject for the image prompts. - **script** (string) - Required - The script content from which to derive image descriptions. ### Request Example ```json { "topic": "Deep Sea Creatures", "script": "The ocean depths hide creatures beyond imagination. Giant squid with eyes the size of dinner plates. Anglerfish with bioluminescent lures. The vampire squid with its cape-like webbing. These deep sea monsters survive in crushing pressure and total darkness." } ``` ### Response #### Success Response (200) - **topic** (string) - The input topic. - **script** (string) - The input script. - **images** (array) - An array of image objects, each containing key, description, width, and height. - **imageWidth** (integer) - The width of the generated image prompts. - **imageHeight** (integer) - The height of the generated image prompts. #### Response Example ```json { "topic": "Deep Sea Creatures", "script": "The ocean depths hide creatures beyond imagination...", "images": [ { "key": "giant_squid_eyes", "description": "Close-up shot of a giant squid eye, size of a dinner plate, bioluminescent blue glow, underwater depth at 2000 meters, pitch black background with particles floating, photorealistic detail, cinematic deep sea photography style", "width": 1080, "height": 1920 }, { "key": "anglerfish_lure", "description": "Eye-level shot of deep sea anglerfish with glowing bioluminescent lure dangling in pitch darkness, sharp teeth visible, eerie blue-green glow illuminating its face, underwater caustics, dramatic horror movie lighting, photorealistic creature design", "width": 1080, "height": 1920 }, { "key": "vampire_squid", "description": "High-angle shot of vampire squid with cape-like webbing spread wide, deep red coloration, bioluminescent spots along tentacles, swimming through dark ocean waters, cinematic underwater lighting, photorealistic marine life documentation style", "width": 1080, "height": 1920 } ], "imageWidth": 1080, "imageHeight": 1920 } ``` # Use type=animation for animation-style prompts ``` -------------------------------- ### Add Topics for Automation (Bash) Source: https://context7.com/shivampansuriya/clipai/llms.txt Adds a list of topics to the automation queue for scheduled video creation. This API endpoint takes a JSON payload containing an array of topics. The topics are then used sequentially by the automation bot to generate videos. The response indicates if topics were added successfully. ```bash curl -X POST http://localhost:8080/api/v2/youtube/12345/topic \ -H "Content-Type: application/json" \ -d '{ "topic": [ "The Lost City of Atlantis", "Ancient Roman Engineering", "Mysterious Nazca Lines", "Vikings in North America", "The Library of Alexandria" ] }' # Response: true (topics added successfully) ``` -------------------------------- ### Generate Image Prompts API (Bash) Source: https://context7.com/shivampansuriya/clipai/llms.txt This endpoint generates detailed image descriptions (prompts) based on a provided script and topic. These prompts are designed for AI image generation. The request specifies the topic and script, and the response contains a list of image descriptions with keys, detailed descriptions, width, and height. ```bash curl -X POST "http://localhost:8080/api/v2/generate/image?type=regular" \ -H "Content-Type: application/json" \ -d '{ "topic": "Deep Sea Creatures", "script": "The ocean depths hide creatures beyond imagination. Giant squid with eyes the size of dinner plates. Anglerfish with bioluminescent lures. The vampire squid with its cape-like webbing. These deep sea monsters survive in crushing pressure and total darkness." }' ``` -------------------------------- ### POST /api/v2/generate/video Source: https://context7.com/shivampansuriya/clipai/llms.txt Generates a complete video by creating a script, image prompts, and images based on a given topic. ```APIDOC ## POST /api/v2/generate/video ### Description Creates a video by generating script, image prompts, and images based on a given topic. ### Method POST ### Endpoint /api/v2/generate/video ### Parameters #### Query Parameters None #### Request Body - **topic** (string) - Required - The main subject for the video. - **imageWidth** (integer) - Required - The desired width for generated images. - **imageHeight** (integer) - Required - The desired height for generated images. ### Request Example ```json { "topic": "The Mystery of the Bermuda Triangle", "imageWidth": 1080, "imageHeight": 1920 } ``` ### Response #### Success Response (200) - **topic** (string) - The input topic. - **script** (string) - The AI-generated script. - **images** (array) - An array of image objects, each containing key, description, width, and height. - **imageWidth** (integer) - The width of the generated images. - **imageHeight** (integer) - The height of the generated images. #### Response Example ```json { "topic": "The Mystery of the Bermuda Triangle", "script": "The Bermuda Triangle has claimed over 1000 ships and planes...", "images": [ { "key": "bermuda_triangle_map", "description": "High-angle aerial shot of the Bermuda Triangle region...", "width": 1080, "height": 1920 }, { "key": "ship_disappearing", "description": "Cinematic underwater view of a ship sinking...", "width": 1080, "height": 1920 } ], "imageWidth": 1080, "imageHeight": 1920 } ``` ``` -------------------------------- ### POST /api/v2/youtube/description Source: https://context7.com/shivampansuriya/clipai/llms.txt Generates SEO-optimized metadata (title, description, tags) for YouTube videos based on a provided script. ```APIDOC ## POST /api/v2/youtube/description ### Description Creates SEO-optimized title, description, and tags for YouTube videos based on a provided script. ### Method POST ### Endpoint /api/v2/youtube/description ### Parameters #### Request Body - **script** (string) - Required - The text content or summary to generate metadata from. ### Request Example ```json { "script": "The Titanic sank on April 15, 1912, after hitting an iceberg. Over 1500 people lost their lives in one of the deadliest maritime disasters. The ship was deemed unsinkable, yet it took only 2 hours and 40 minutes to sink completely." } ``` ### Response #### Success Response (200) - Typically returns a JSON object containing generated `title`, `description`, and `tags` suitable for YouTube uploads. ``` -------------------------------- ### TTS Voice and Speed Options Source: https://context7.com/shivampansuriya/clipai/llms.txt Provides guidance on selecting different voices and adjusting speech speed for text-to-speech narration using the 'edge-tts' library. Options include various professional and conversational voices, with speed adjustments for pacing. ```bash # Available voices for different styles: # - en-US-ChristopherNeural (default, male, clear) # - en-US-JennyNeural (female, energetic) # - en-US-GuyNeural (male, professional) # - en-US-AriaNeural (female, conversational) # Speed options: # +20% = faster, good for shorts # +0% = normal # -20% = slower, good for education # Quality: 24kHz, 48kbps MP3 output ``` -------------------------------- ### Upload Video to YouTube with Metadata Source: https://context7.com/shivampansuriya/clipai/llms.txt Uploads a local video file to YouTube with specified metadata including title, description, tags, and privacy status. Supports scheduled uploads and requires YouTube OAuth2 credentials. The response includes details of the uploaded video. ```bash curl -X POST http://localhost:8080/api/v2/youtube/12345/upload \ -H "Content-Type: application/json" \ -d '{ \ "title": "The Mystery of Dark Matter #shorts", \ "description": "Explore the enigma of dark matter that makes up 85% of the universe...", \ "tags": ["science", "space", "darkmatter", "physics", "astronomy", "shorts"], \ "videoPath": "src/main/resources/static/final_video.mp4", \ "privacyStatus": "public" \ }' ``` -------------------------------- ### POST /api/v2/generate/images Source: https://context7.com/shivampansuriya/clipai/llms.txt Generates images from provided text descriptions using HuggingFace API. Images are saved to the local file system. ```APIDOC ## POST /api/v2/generate/images ### Description Generates actual images using HuggingFace API based on image descriptions. Images are saved to `src/main/resources/static/{key}.png`. ### Method POST ### Endpoint /api/v2/generate/images ### Parameters #### Request Body - **images** (array) - Required - An array of image objects to generate. - **key** (string) - Required - A unique key for the image. - **description** (string) - Required - The text description for image generation. - **width** (integer) - Required - The desired width of the image. - **height** (integer) - Required - The desired height of the image. ### Request Example ```json { "images": [ { "key": "space_station", "description": "Cinematic shot of International Space Station orbiting Earth at golden hour", "width": 1080, "height": 1920 } ] } ``` ### Response #### Success Response (200) - Returns the same object as the request after images are generated and saved. ### Notes - Requires HuggingFace API key configured in application properties. - Automatic retry mechanism: up to 5 attempts per failed image. ``` -------------------------------- ### HuggingFace Image Generation Service (Java) Source: https://context7.com/shivampansuriya/clipai/llms.txt Java service utilizing HuggingFace Stable Diffusion API to generate AI images based on provided topics and detailed descriptions. Requires Hugging Face API key and output directory configuration. Generates and saves images with automatic retries. ```java @Service public class ImageGenerationExample { @Autowired private HuggingFaceService huggingFaceService; public void generateContentImages() { ClipAIRest request = new ClipAIRest(); request.setTopic("Space Exploration"); // Add image prompts with detailed descriptions Image img1 = new Image(); img1.setKey("mars_rover"); img1.setDescription("High-angle aerial shot of Mars rover on rust-red terrain, " + "dramatic Martian sunset in background, dust particles floating, " + "photorealistic space photography, cinematic lighting, 4K quality"); img1.setWidth(1080); img1.setHeight(1920); request.addImage(img1); Image img2 = new Image(); img2.setKey("spacewalk_astronaut"); img2.setDescription("Close-up of astronaut during spacewalk, Earth visible " + "in helmet reflection, stars in background, dramatic lighting from sun, " + "photorealistic detail, NASA documentary style"); img2.setWidth(1080); img2.setHeight(1920); request.addImage(img2); // Generate all images with automatic retry // - Saves to: src/main/resources/static/{key}.png // - Retries failed images up to 5 times // - 4 second delay between failed attempts // - Uses guidance_scale: 5 for balanced quality/creativity huggingFaceService.generateAndSaveImage(request); } // Configuration requirements: // application.properties: // huggingface.api.key=hf_xxxxxxxxxxxxx // huggingface.api.url=https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-base-1.0 // app.output.directory=src/main/resources/static } ``` -------------------------------- ### Audio Transcription and Subtitle Generation (Java) Source: https://context7.com/shivampansuriya/clipai/llms.txt Java service for transcribing audio files and obtaining word-level timestamps for subtitle synchronization. Supports various audio formats and requires OpenAI Whisper. The output includes text and detailed timing for each word. ```java @Service public class SubtitleGenerationExample { @Autowired private AudioServiceImpl audioService; public void generateSynchronizedSubtitles(ClipAIRest scriptData) throws Exception { String audioPath = "src/main/resources/static/narration.mp3"; // Transcribe with word-level timing TranscriptionResult result = audioService.transcribeAudio( audioPath, AudioServiceImpl.WhisperModel.BASE, // or TINY, SMALL, MEDIUM, LARGE "en", // language code (optional, auto-detect if null) scriptData ); // Result contains word timing for subtitle sync System.out.println("Full transcript: " + result.getText()); for (TimedWord word : result.getSegments()) { System.out.printf("Word: %s (%.2fs - %.2fs, confidence: %.2f)\n", word.getWord(), word.getStartTime(), word.getEndTime(), word.getConfidence() ); } // Output example: // Word: The (0.00s - 0.15s, confidence: 0.98) // Word: ancient (0.17s - 0.45s, confidence: 0.95) // Word: pyramids (0.47s - 0.89s, confidence: 0.97) // This timing data is used by VideoCreator to show // each word as subtitle exactly when spoken } // Supported audio formats: // - WAV, MP3, M4A, FLAC, OGG // Requires Whisper installed: pip install openai-whisper } ``` -------------------------------- ### Generate Complete Video API (Bash) Source: https://context7.com/shivampansuriya/clipai/llms.txt This endpoint generates a complete video based on a given topic. It utilizes AI for script generation and creates corresponding image prompts and images. The request specifies the topic, image width, and height, and the response includes the generated script and image details. ```bash curl -X POST http://localhost:8080/api/v2/generate/video \ -H "Content-Type: application/json" \ -d '{ "topic": "The Mystery of the Bermuda Triangle", "imageWidth": 1080, "imageHeight": 1920 }' ``` -------------------------------- ### Transcribe Audio to Text using Whisper Source: https://context7.com/shivampansuriya/clipai/llms.txt Transcribes audio files into text, providing word-level timestamps for precise synchronization. Supports multiple audio formats and uses the Whisper BASE model by default. Transcribed content is saved to a specified directory. ```bash curl -X POST http://localhost:8080/api/v2/transcribe/audio \ -H "Content-Type: application/multipart/form-data" \ -F "audioFile=@/path/to/audio.mp3" ``` -------------------------------- ### POST /api/v2/youtube/{videoId}/upload Source: https://context7.com/shivampansuriya/clipai/llms.txt Uploads a generated video to YouTube, allowing specification of title, description, tags, and privacy status. Supports scheduled uploads. ```APIDOC ## POST /api/v2/youtube/{videoId}/upload ### Description Uploads a generated video to YouTube with metadata and scheduled publishing. Requires YouTube OAuth2 credentials. ### Method POST ### Endpoint /api/v2/youtube/{videoId}/upload ### Parameters #### Path Parameters - **videoId** (string) - Required - The ID of the video to upload (used for identification, not the YouTube video ID). #### Request Body - **title** (string) - Required - The title for the YouTube video. - **description** (string) - Required - The description for the YouTube video. - **tags** (array of strings) - Required - An array of tags for the video. - **videoPath** (string) - Required - The local file path to the video to be uploaded. - **privacyStatus** (string) - Required - The privacy status of the video. Options: `public`, `private`, `unlisted`. ### Request Example ```json { "title": "The Mystery of Dark Matter #shorts", "description": "Explore the enigma of dark matter that makes up 85% of the universe...", "tags": ["science", "space", "darkmatter", "physics", "astronomy", "shorts"], "videoPath": "src/main/resources/static/final_video.mp4", "privacyStatus": "public" } ``` ### Response #### Success Response (200) - **videoId** (string) - The YouTube video ID of the uploaded video. - **title** (string) - The title of the uploaded video. - **description** (string) - The description of the uploaded video. - **tags** (array of strings) - The tags of the uploaded video. - **videoPath** (string) - The path to the video file that was uploaded. - **privacyStatus** (string) - The privacy status of the uploaded video. - **uploadTime** (string) - The scheduled or actual upload time of the video (ISO 8601 format). ### Notes - Supports scheduled/delayed uploads. ``` -------------------------------- ### POST /api/v2/generate/script Source: https://context7.com/shivampansuriya/clipai/llms.txt Generates an AI-written script for a specific topic and content type. ```APIDOC ## POST /api/v2/generate/script ### Description Generates an AI-written script for a specific topic and content type. ### Method POST ### Endpoint /api/v2/generate/script ### Parameters #### Query Parameters - **chatType** (string) - Required - The type of content and tone for the script. Available values: HISTORY_SCHOKING, SCIENCE, MYSTERY, TECHNOLOGY. #### Request Body - **topic** (string) - Required - The main subject for the script. ### Request Example ```json { "topic": "Ancient Egyptian Pyramids" } ``` ### Response #### Success Response (200) - **topic** (string) - The input topic. - **script** (string) - The AI-generated script. - **images** (array) - May be null if only script is generated. - **imageWidth** (integer) - Will be 0 if only script is generated. - **imageHeight** (integer) - Will be 0 if only script is generated. #### Response Example ```json { "topic": "Ancient Egyptian Pyramids", "script": "The Great Pyramid of Giza stands 481 feet tall and was built over 4500 years ago. How did ancient Egyptians move 2.3 million stone blocks, each weighing up to 80 tons, without modern machinery? Recent discoveries reveal underground tunnels and water shafts that may have been used to transport these massive stones. The precision is astounding - the base is level to within 2 centimeters. Scientists now believe the pyramids served not just as tombs, but as astronomical observatories aligned perfectly with Orion's Belt. This engineering marvel continues to baffle experts worldwide.", "images": null, "imageWidth": 0, "imageHeight": 0 } ``` #### Available ChatType values: - HISTORY_SCHOKING: Historical content with dramatic tone - SCIENCE: Scientific explanations - MYSTERY: Mystery and paranormal topics - TECHNOLOGY: Tech-related content ``` -------------------------------- ### POST /api/v2/transcribe/audio Source: https://context7.com/shivampansuriya/clipai/llms.txt Transcribes an uploaded audio file into text, providing word-level timestamps for synchronization. Supports multiple audio formats. ```APIDOC ## POST /api/v2/transcribe/audio ### Description Transcribes uploaded audio files using Whisper with word-level timestamps. The transcription is saved to `src/main/resources/static/audioTranscribe/`. ### Method POST ### Endpoint /api/v2/transcribe/audio ### Parameters #### Request Body - **audioFile** (file) - Required - The audio file to transcribe. Supported formats: WAV, MP3, M4A, FLAC, OGG. ### Request Example ```bash curl -X POST http://localhost:8080/api/v2/transcribe/audio \ -H "Content-Type: multipart/form-data" \ -F "audioFile=@/path/to/audio.mp3" ``` ### Response #### Success Response (200) - **script** (string) - The transcribed text from the audio file. - **topic** (any) - Placeholder for topic information (currently null). - **images** (any) - Placeholder for image information (currently null). - **imageWidth** (integer) - Placeholder for image width (currently 0). - **imageHeight** (integer) - Placeholder for image height (currently 0). ### Notes - Uses Whisper BASE model by default. - Provides word-level timing for subtitle synchronization. ``` -------------------------------- ### Generate Script Only API (Bash) Source: https://context7.com/shivampansuriya/clipai/llms.txt This API endpoint generates an AI-written script for a given topic and content type. The request includes the topic and a chat type (e.g., HISTORY_SCHOKING, SCIENCE, MYSTERY, TECHNOLOGY) to influence the script's tone and content. The response provides the generated script. ```bash curl -X POST "http://localhost:8080/api/v2/generate/script?chatType=HISTORY_SCHOKING" \ -H "Content-Type: application/json" \ -d '{ "topic": "Ancient Egyptian Pyramids" }' ``` -------------------------------- ### POST /api/v2/generate/speech Source: https://context7.com/shivampansuriya/clipai/llms.txt Converts a given text script into speech audio using an external TTS engine. The output audio is saved as `narration.mp3`. ```APIDOC ## POST /api/v2/generate/speech ### Description Converts script text to speech using an external TTS engine. The generated audio is saved to `src/main/resources/static/narration.mp3`. ### Method POST ### Endpoint /api/v2/generate/speech ### Parameters #### Request Body - **script** (string) - Required - The text to be converted to speech. ### Request Example ```json { "script": "Welcome to the fascinating world of quantum physics. Where particles exist in multiple states simultaneously." } ``` ### Response #### Success Response (200) - **Boolean** (boolean) - `true` if the speech generation was successful, `false` otherwise. ### Notes - Uses Python edge-tts via subprocess. - Voice: en-US-ChristopherNeural. - Speed: +20% (faster narration). - Python command executed: `python main.py ""`. ``` -------------------------------- ### Generate Text-to-Speech Audio using Python TTS Source: https://context7.com/shivampansuriya/clipai/llms.txt Converts a given script text into speech using an external TTS engine, specifically the Python edge-tts library executed via subprocess. The output is saved as an MP3 file. Supports custom voice, speed, and output path. ```bash curl -X POST http://localhost:8080/api/v2/generate/speech \ -H "Content-Type: application/json" \ -d '{ \ "script": "Welcome to the fascinating world of quantum physics. Where particles exist in multiple states simultaneously." \ }' ``` -------------------------------- ### Check Upload Delay Status Source: https://context7.com/shivampansuriya/clipai/llms.txt Retrieves the current upload delay settings for a user. This is useful for monitoring the automation schedule and preventing YouTube spam detection. ```APIDOC ## GET /api/v2/youtube/{userId}/delay ### Description Retrieves the current upload delay settings for a user. ### Method GET ### Endpoint `/api/v2/youtube/{userId}/delay` ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user. ### Request Body None ### Response #### Success Response (200) - **boolean** - `true` if delay information was successfully retrieved and printed to logs. #### Response Example ```json true ``` ### Notes - The delay setting determines the time between consecutive video uploads. - This helps in avoiding YouTube's spam detection mechanisms. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.