Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Youtube Video Downloader/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# YouTube Video Downloader with yt-dlp Integration

## Project Overview

This project is a command-line based YouTube Video Downloader that integrates with `yt-dlp` to allow users to download videos from YouTube. It enables downloading in various formats and resolutions, giving users flexibility in managing their video downloads.

## Features

- **Download YouTube Videos**: Download videos in various resolutions (360p, 720p, 1080p, etc.).
- **Audio Extraction**: Extract and download only the audio from a YouTube video.
- **Multiple Formats**: Support for multiple video formats like MP4, WebM, and audio formats like MP3, M4A.
- **Batch Downloading**: Download multiple videos at once by providing a list of URLs.
- **Simple Command-Line Interface**: Easy-to-use command-line input for seamless user experience.

## Technologies Used

- **Python**: The core programming language.
- **yt-dlp**: The powerful Python package used for downloading videos and audio from YouTube and other platforms.

## Installation

To get started with this project, follow these steps:

1. **Clone the Repository**:
```bash
git clone https://github.com/yourusername/YouTube-Video-Downloader.git
23 changes: 23 additions & 0 deletions Youtube Video Downloader/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import yt_dlp

def download_video(url, resolution='highest'):
try:
# Set yt-dlp options for video download
ydl_opts = {
'format': f'bestvideo[height<={resolution}]+bestaudio/best[height<={resolution}]' if resolution != 'highest' else 'best',
'outtmpl': '%(title)s.%(ext)s', # Output file name template
}

# Download video with yt-dlp
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
ydl.download([url])
print("Download completed!")
except Exception as e:
print(f"Error: {e}")

if __name__ == "__main__":
video_url = input("Enter YouTube URL: ")
video_resolution = input("Enter resolution (e.g., 720p or leave blank for highest): ").strip()

# Download the video with specified resolution
download_video(video_url, video_resolution or 'highest')
2 changes: 2 additions & 0 deletions Youtube Video Downloader/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yt-dlp

1 change: 1 addition & 0 deletions Youtube Video Downloader/runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.10.12