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.envfile 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! 🎉