Thursday, January 23, 2025

"use client" import { useState } from "react" import { AlertCircle } from "lucide-react" import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert" export default function YouTubeDownloader() { const [url, setUrl] = useState("") const [error, setError] = useState("") const [loading, setLoading] = useState(false) const validateYouTubeUrl = (url: string) => { const pattern = /^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be)\/.+$/ return pattern.test(url) } const handleDownload = async () => { setError("") if (!url) { setError("Please enter a YouTube URL") return } if (!validateYouTubeUrl(url)) { setError("Please enter a valid YouTube URL") return } setLoading(true) try { // Here you would typically make an API call to your download service await new Promise((resolve) => setTimeout(resolve, 1500)) // Simulated delay // For demo purposes, we'll just show an alert alert("Download started! (Demo only)") } catch (err) { setError("An error occurred while processing your request") } finally { setLoading(false) } } return (
{/* Header Section */}

YouTube Video Downloader

Download your favorite YouTube videos in different formats

{/* Input Section */}
setUrl(e.target.value)} placeholder="Paste YouTube URL here..." className="w-full px-4 py-3 border-2 border-gray-200 rounded-lg focus:border-red-500 focus:outline-none" />
{/* Error Message */} {error && ( Error {error} )} {/* Instructions */}

How to Download:

  1. Copy the YouTube video URL
  2. Paste the URL in the input box above
  3. Click the Download button
  4. Select your preferred quality and format
  5. Click Download to save your video
{/* Features Section */}

Multiple Formats

Download in MP4, MP3, and more formats

High Quality

Support for HD and 4K quality videos

Fast Download

Quick and efficient downloading process

{/* Disclaimer */}

This tool is for personal use only. Please respect YouTube's terms of service and copyright laws.

) } "use client" import { useState } from "react" import { AlertCircle } from "lucide-react" import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" export default function YouTubeDownloader() { const [url, setUrl] = useState("") const [error, setError] = useState("") const [loading, setLoading] = useState(false) const validateYouTubeUrl = (url: string) => { const pattern = /^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be)\/.+$/ return pattern.test(url) } const handleDownload = async () => { setError("") if (!url) { setError("Please enter a YouTube URL") return } if (!validateYouTubeUrl(url)) { setError("Please enter a valid YouTube URL") return } setLoading(true) try { // Here you would typically make an API call to your download service await new Promise((resolve) => setTimeout(resolve, 1500)) // Simulated delay // For demo purposes, we'll just show an alert alert("Download started! (Demo only)") } catch (err) { setError("An error occurred while processing your request") } finally { setLoading(false) } } return (

YouTube Video Downloader

Download your favorite YouTube videos in different formats

setUrl(e.target.value)} placeholder="Paste YouTube URL here..." className="flex-grow" />
{error && ( Error {error} )}

How to Download:

  1. Copy the YouTube video URL
  2. Paste the URL in the input box above
  3. Click the Download button
  4. Select your preferred quality and format
  5. Click Download to save your video

Multiple Formats

Download in MP4, MP3, and more formats

High Quality

Support for HD and 4K quality videos

Fast Download

Quick and efficient downloading process

This tool is for personal use only. Please respect YouTube's terms of service and copyright laws.

) }

No comments:

Post a Comment

ताज़ा समाचार - आपकी हिंदी न्यूज़ वेबसाइट ताज़ा समाचार मुख्य समाचार व्याप...