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.
- 📥 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.
Install GÖRENDİRİK directly from GitHub using pip:
pip install git+https://github.com/MammadTavakoli/GorEndirik.git
-
Clone the repository:
git clone https://github.com/MammadTavakoli/GorEndirik.git
-
Navigate to the project directory:
cd GorEndirik
-
Install the dependencies:
pip install -r requirements.txt
# 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()
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)
The YouTubeDownloader
class is the core interface for downloading YouTube videos and subtitles.
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 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 ifvideo_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 all .srt
subtitle files in the save directory to plain text.
- Parameters:
append_text
(str, optional): Text to append between subtitle lines (default:'*******'
).
We welcome contributions! Please read our Contributing Guidelines for more information on how to get started.
This project is under active development. Please report any issues or suggest improvements by opening an issue on GitHub.