Skip to content

Commit 19f36de

Browse files
committed
doc: updated readme
1 parent 846c77d commit 19f36de

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

readme.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# YouTube Transcript Generator
2-
[![Open in Collab](https://img.shields.io/badge/Open_in_Collab-555?style=for-the-badge&logo=googlecolab&labelColor=gray&color=purple)](https://colab.research.google.com/github/therohitdas/Youtube-Transcript-Generator/blob/main/main.ipynb)
2+
3+
[![Open in Colab](https://img.shields.io/badge/Open_in_Colab-555?style=for-the-badge&logo=googlecolab&labelColor=gray&color=purple)](https://colab.research.google.com/github/therohitdas/Youtube-Transcript-Generator/blob/main/main.ipynb)
34
![GitHub License](https://img.shields.io/github/license/therohitdas/Youtube-Transcript-Generator?style=for-the-badge&color=blue) ![GitHub Repo stars](https://img.shields.io/github/stars/therohitdas/Youtube-Transcript-Generator?style=for-the-badge&logo=github)
45
[![CodeFactor](https://www.codefactor.io/repository/github/therohitdas/youtube-transcript-generator/badge?style=for-the-badge)](https://www.codefactor.io/repository/github/therohitdas/youtube-transcript-generator)
56

@@ -10,6 +11,7 @@ The YouTube Transcript Generator is a powerful tool designed to streamline the p
1011
### How It Can Help 🚀
1112

1213
This tool is particularly useful for:
14+
1315
- **Note Taking:** Quickly convert YouTube videos into text format for easy note-taking.
1416
- **Content Analysis:** Analyze and derive insights from video content by converting it into text data.
1517
- **Chat Bot Training:** Use the generated transcripts to train chatbots, such as ChatGPT, for natural language understanding.
@@ -26,47 +28,57 @@ This tool is particularly useful for:
2628

2729
## Environment Variables 🌐
2830

29-
- `GOOGLE_API_KEY`: Set up your Google API key for video information retrieval. You will need to create a Project in the Google Cloud for this and enable the YouTube v3 API. This is optional, if you don't add it, the chapters will not be added.
31+
- `YOUTUBE_API_KEY`: Set up your Google API key for video information retrieval. You will need to create a Project in the Google Cloud for this and enable the YouTube v3 API. This is optional, if you don't add it, the chapters will not be added.
3032

3133
## Script Parameters 📜
34+
3235
When running the script locally, you can pass these parameters to the script:
3336

3437
### Positional Argument:
38+
3539
- `url`: YouTube video URL
3640

3741
### Optional Arguments:
42+
3843
- `-h, --help`: Show the help message and exit
3944
- `-l LANGUAGE, --language LANGUAGE`: Language for the transcript (default: en)
4045
- `-p, --punctuated`: Generate punctuated transcript (default: False)
41-
- `-o OUTPUT_DIR, --output_dir OUTPUT_DIR`: Output directory for saving the transcript (default: .)
46+
- `-o OUTPUT_DIR, --output_dir OUTPUT_DIR`: Output directory for saving the transcript (default: current directory)
4247
- `-f FILENAME, --filename FILENAME`: Filename for saving the transcript (default: Video Title or Video Id)
4348
- `-m PUNCTUATION_MODEL, --punctuation_model PUNCTUATION_MODEL`: Path to the punctuation model (default: None)
4449
- `-v, --verbose`: Print verbose output (default: False)
4550

46-
## Run in Google Collab 🚀
51+
## Run in Google Colab 🚀
52+
4753
To run this project in Google Colab, follow these steps:
48-
1. Open the [Google Colab notebook](https://colab.research.google.com/github/therohitdas/Youtube-Transcript-Generator/blob/main/main.ipynb).
49-
2. Add Google's Project API key to the secrets tab under this key: `GOOGLE_API_KEY` and toggle notebook access to on.
50-
3. Edit the variables in the second last cell.
51-
4. Go to Runtime > Change Runtime Type and select any GPU type. If you use CPU, the output for punctuated transcript will take some minutes to complete (around 1 minute per 10-minute video)
52-
5. Change the values in the third last cell to include your URL etc.
54+
55+
1. Open the [Google Colab Notebook](https://colab.research.google.com/github/therohitdas/Youtube-Transcript-Generator/blob/main/main.ipynb).
56+
2. Add Google's Project API key to the secrets tab under this key: `YOUTUBE_API_KEY` and toggle notebook access to on.
57+
3. Go to Runtime > Change Runtime Type and select T4 GPU type. If you use CPU, the output for punctuated transcript will take some minutes to complete (around 1 minute per 10-minute video)
58+
4. Change the values in the second cell to include your URL etc.
59+
5. Press CTRL+F9 or CMD+F9 to run the notebook.
5360

5461
## Run Locally 💻
5562

5663
I do not recommend running locally as it will download tensors and other stuff which are over 6gb. But if you want you can do this:
64+
5765
1. Clone the repository: `git clone https://github.com/therohitdas/Youtube-Transcript-Generator.git`
58-
2. Install dependencies: `pip install youtube-transcript-api deepmultilingualpunctuation nltk google-api-python-client google-auth-oauthlib`
59-
3. Set up the required environment variables: `GOOGLE_API_KEY` (optional).
60-
4. Run the script: `python index.py <YouTube_URL>` or `python index.py -h` for the help menu.
66+
2. Create a virtual environment: `python -m venv venv`
67+
3. Activate the virtual environment: `source venv/bin/activate` (Linux/MacOS) or `venv\Scripts\activate` (Windows)
68+
4. Install dependencies: `pip install -r requirements.txt`
69+
5. Set up the required environment variables: `YOUTUBE_API_KEY` (optional). You can either create a `.env` file or set them up in your system using.
70+
6. Run the script: `python index.py <YouTube_URL>` or `python index.py -h` for the help menu.
6171

6272
## Support 🤝
6373

6474
For any issues or feature requests, please [create an issue](https://github.com/therohitdas/Youtube-Transcript-Generator/issues).
6575

6676
## Example 📋
77+
6778
Here's an example of how to run the script with various options:
6879

6980
### Basic Usage
81+
7082
```bash
7183
python index.py https://www.youtube.com/watch?v=VIDEO_ID
7284
```
@@ -112,19 +124,23 @@ python index.py https://www.youtube.com/watch?v=VIDEO_ID -v
112124
```bash
113125
python index.py https://www.youtube.com/watch?v=VIDEO_ID -m author/model_name
114126
```
127+
115128
Punctuation model name can be taken from [here](https://huggingface.co/oliverguhr/fullstop-punctuation-multilang-large#languages).
116129

117130
Make sure to replace `https://www.youtube.com/watch?v=VIDEO_ID` with the actual URL of the YouTube video you want to process.
118131

119132
Feel free to copy and paste these examples into your terminal.
133+
120134
## Acknowledgments 🙌
121135

122136
This script utilizes the [youtube-transcript-api](https://github.com/jdepoix/youtube-transcript-api) and [fullstop-punctuation-multilang-large](https://huggingface.co/oliverguhr/fullstop-punctuation-multilang-large) libraries. Special thanks to their contributors.
123137

124138
Feel free to adapt and use the script based on your requirements. Enjoy the convenience of YouTube transcript processing!
125139

126140
## Connect with me 📧
141+
127142
The best way to connect is to email me [[email protected]](mailto:[email protected])
143+
128144
- [x/therohitdas](https://x.com/therohitdas)
129145
- [GitHub/therohitdas](https://github.com/therohitdas)
130146

0 commit comments

Comments
 (0)