YT-Grab is a Node.js application powered by Express.js and MongoDB that allows users to effortlessly fetch and download YouTube thumbnails and community posts. Its responsive design and seamless functionality make it a handy tool for content creators.
- Thumbnail Fetching: Retrieve high-quality thumbnails from YouTube videos.
- Community Post Fetching: Access and view recent YouTube community posts by channel.
- Download Functionality: Download thumbnails for offline use.
- Error Handling: Custom 404 and internal error pages.
- Responsive Design: Optimized for mobile and desktop users.
- Node.js: For server-side programming.
- Express.js: For building RESTful APIs and managing routes.
- MongoDB: Database for storing application data (optional).
- EJS: Template engine for rendering dynamic views.
- CSS: For styling and responsive design.
- JavaScript: Enhancing interactivity on the client side.
yt-grab/
โโโ config/ # Configuration files
โ โโโ emailConfig.js # Email service configuration
โโโ controllers/ # Controllers for handling routes
โ โโโ indexControllers.js # Main application logic
โโโ middlewares/ # Middleware functions
โ โโโ validateContentAccess.js # Middleware for content validation
โโโ public/ # Static assets (CSS, JS, images)
โ โโโ css/ # CSS files for styling
โ โโโ js/ # JavaScript files for client-side features
โโโ routes/ # Route handlers
โ โโโ indexRoutes.js # Main route handler
โโโ utils/ # Utility functions
โ โโโ communityPostUtils.js # Logic for fetching community posts
โ โโโ emailUtils.js # Helper functions for sending emails
โ โโโ httpStatusCodes.js # HTTP status code constants
โ โโโ messageUtils.js # Utility functions for messages
โโโ views/ # EJS templates for rendering pages
โ โโโ layouts/ # Layout templates
โ โโโ partials/ # Reusable components (header, footer, etc.)
โ โโโ 404.ejs # 404 error page
โ โโโ about.ejs # About page
โ โโโ communityResult.ejs # Community post result page
โ โโโ contact.ejs # Contact page
โ โโโ home.ejs # Home page
โ โโโ internalError.ejs # Internal server error page
โ โโโ shortsResult.ejs # YouTube Shorts result page
โ โโโ thumbnailResult.ejs # Thumbnail result page
โ โโโ videoResult.ejs # Video result page
โโโ .gitignore # Ignored files and folders for Git
โโโ app.js # Main application entry point
โโโ package.json # Project metadata and dependencies
โโโ package-lock.json # Lock file for dependencies
- Node.js (v16+ recommended)
- MongoDB (local or cloud instance)
- npm (Node Package Manager)
-
Clone the repository:
git clone https://github.com/your-username/yt-grab.git cd yt-grab
-
Install dependencies:
npm install
-
Set up environment variables:
Create a.env
file in the root directory and add the following:PORT=3000 DB_URI=mongodb://localhost:27017/your_database_name SESSION_SECRET=your_session_secret [email protected] SEND_EMAIL_PASS=your_email_password
-
Run the application:
npm start
-
Open your browser and go to:
http://localhost:3000
-
Fetch Thumbnails
- Enter the YouTube video URL to retrieve and download its thumbnail.
-
Fetch Community Posts
- Enter the YouTube channel ID to view recent community posts.
-
Error Handling
- Enjoy customized error pages for a better user experience.
- Building RESTful APIs with Express.js.
- Rendering dynamic views with EJS.
- Using MongoDB for data storage and retrieval.
- Implementing middleware for security and validation.
This project is licensed under the MIT License. Feel free to use, modify, and distribute it as needed.
- YouTube API for inspiration and open-source data.
- Thanks to the open-source community for tools and resources.
Happy Fetching with YT-Grab! ๐