Skip to content

GörEndirik is a powerful and easy-to-use Python package for downloading YouTube videos and subtitles. Whether you're archiving videos, studying with subtitles, or just saving your favorite content, GörEndir makes it simple and efficient.

Notifications You must be signed in to change notification settings

MammadTavakoli/GorEndirik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

🎥 GÖRENDİRİK: YouTube Video and Subtitle Downloader

GÖRENDİRİK is a powerful and user-friendly Python package designed to simplify the process of downloading YouTube videos and subtitles. Whether you're archiving content, studying with subtitles, or conducting research, GÖRENDİRİK provides a seamless experience with a wide range of features.


✨ Key Features

  • 📥 Download YouTube Videos: Save videos in your preferred resolution, including up to 4K.
  • 📜 Download Subtitles: Automatically fetch subtitles in multiple languages.
  • 📝 Convert Subtitles to Text: Easily convert .srt subtitle files to plain text for convenient reading and analysis.
  • 💾 Flexible Storage Options: Save downloaded files to Google Drive or local storage.
  • 🌍 Multi-Language Support: Supports subtitles in Azerbaijani (az), English (en), Farsi (fa), Turkish (tr), and more.
  • 🖥️ User-Friendly Interface: Simple API and command-line interface for easy integration into your projects.
  • 🔧 Customizable Options: Control download resolution, subtitle languages, and more.

🛠️ Installation

Using pip

Install GÖRENDİRİK directly from GitHub using pip:

pip install git+https://github.com/MammadTavakoli/GorEndirik.git

Manual Installation

  1. Clone the repository:

    git clone https://github.com/MammadTavakoli/GorEndirik.git
  2. Navigate to the project directory:

    cd GorEndirik
  3. Install the dependencies:

    pip install -r requirements.txt

🚀 Quick Start

Using GörEndirik in Google Colab

# Change to root directory
import os
os.chdir("/")

# Install GörEndirik
!pip install --upgrade --force-reinstall git+https://github.com/MammadTavakoli/GorEndirik.git

# Mount Google Drive
from google.colab import drive
drive.mount('/content/drive')

# Import GörEndirik
from gorEndirik.downloader import YouTubeDownloader

# Define the save location (Google Drive or local Colab storage)
save_directory = "/content/drive/MyDrive/YouTube/Download_video"  # Change this to your desired path

# Initialize the YouTubeDownloader
downloader = YouTubeDownloader(save_directory=save_directory, subtitle_languages=["az", "fa", "en", "tr"])

# List of YouTube video URLs
video_urls = [
    # Corey Schafer's Python Tutorials
    "https://www.youtube.com/playlist?list=PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU",
    
    # Real Python Tutorials
    "https://www.youtube.com/playlist?list=PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU",
    
    # Tech With Tim - Python Programming (start downloading from the 3rd video)
    {"https://www.youtube.com/playlist?list=PLzMcBGfZo4-lSq2IDrA6vpZEV92AmQfJK": 3},
    
    # FreeCodeCamp Python Playlist
    "https://www.youtube.com/watch?v=rfscVS0vtbw",
    
    # Çok Güzel Hareketler
    "https://www.youtube.com/watch?v=E9rMSlMxqIk"
]

# Download each video with force_download set to True
for video_url in video_urls:
    print(f"\nDownloading: {video_url}")
    downloader.download_video(video_url, force_download=True)

# Convert the subtitles to text
downloader.convert_subtitles_to_text()

Download a Single Video

from gorEndirik.downloader import YouTubeDownloader

# Initialize downloader
downloader = YouTubeDownloader(save_directory="/path/to/save/videos", subtitle_languages=["fa", "ar"])

# Download a video
downloader.download_video("https://www.youtube.com/watch?v=example", force_download=True)

🛠️ Methods

YouTubeDownloader

The YouTubeDownloader class is the core interface for downloading YouTube videos and subtitles.

__init__

Initialize the YouTube downloader.

  • Parameters:
    • save_directory (str): Path to save downloaded files.
    • subtitle_languages (list, optional): List of subtitle languages to download (default: ["az", "en", "fa", "tr"]).
    • max_resolution (int, optional): Maximum resolution for video downloads (default: 1080).

download_video

Download a video or playlist from YouTube.

  • Parameters:
    • video_url (str or dict): URL of the video or playlist to download, or a dictionary with URL and starting index. Example: "https://www.youtube.com/watch?v=example" or {"https://www.youtube.com/playlist?list=PLzMcBGfZo4-lSq2IDrA6vpZEV92AmQfJK": 3}.
    • playlist_start (int, optional): Starting index for the playlist download (default: 1). This parameter is used only if video_url is a string.
    • skip_download (bool, optional): Flag to skip the download process (default: False).
    • force_download (bool, optional): Flag to force the download even if the URL has been saved before (default: False).

convert_subtitles_to_text

Convert all .srt subtitle files in the save directory to plain text.

  • Parameters:
    • append_text (str, optional): Text to append between subtitle lines (default: '*******').

🤝 Contributing

We welcome contributions! Please read our Contributing Guidelines for more information on how to get started.


🌟 Star History

Star History Chart


📊 Statistics

GitHub issues GitHub stars GitHub forks GitHub license


📖 Further Reading


📌 Note

This project is under active development. Please report any issues or suggest improvements by opening an issue on GitHub.


About

GörEndirik is a powerful and easy-to-use Python package for downloading YouTube videos and subtitles. Whether you're archiving videos, studying with subtitles, or just saving your favorite content, GörEndir makes it simple and efficient.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages