README updated

This commit is contained in:
Jonas Depoix 2018-07-03 12:59:39 +02:00
parent 94ad9f0fdf
commit 62dcbd5226
1 changed files with 12 additions and 4 deletions

View File

@ -2,9 +2,15 @@
This is an python API which allows you to get the transcripts/subtitles for a given YouTube video. It also works for automatically generated subtitles and it does not require a headless browser, like other selenium based solutions do! This is an python API which allows you to get the transcripts/subtitles for a given YouTube video. It also works for automatically generated subtitles and it does not require a headless browser, like other selenium based solutions do!
## Requirements ## Install
It runs using python 2 and 3, with the only requirement being the [requests](http://docs.python-requests.org/en/master/) module. It is recommended installing it using pip: It is recommended to install this module by using pip:
```
pip install youtube_transcipt_api
```
If you want to use it from source, you'll have to install the dependencies manually:
``` ```
pip install -r requirements.txt pip install -r requirements.txt
@ -19,6 +25,8 @@ You could either integrate this module into an existing application, or just use
To get a transcript for a given video you can do: To get a transcript for a given video you can do:
```python ```python
from youtube_transcipt_api import YouTubeTranscriptApi
YouTubeTranscriptApi.get_transcript(video_id) YouTubeTranscriptApi.get_transcript(video_id)
``` ```
@ -51,13 +59,13 @@ YouTubeTranscriptApi.get_transcripts(video_ids)
Execute the CLI script using the video ids as parameters and the results will be printed out to the command line: Execute the CLI script using the video ids as parameters and the results will be printed out to the command line:
``` ```
./youtube_transcript_api.py <first_video_id> <second_video_id> ... youtube_transcript_api <first_video_id> <second_video_id> ...
``` ```
If you would prefer to write it into a file or pipe it into another application, you can also output the results as json using the following line: If you would prefer to write it into a file or pipe it into another application, you can also output the results as json using the following line:
``` ```
./youtube_transcript_api.py --json <first_video_id> <second_video_id> ... > transcripts.json youtube_transcript_api --json <first_video_id> <second_video_id> ... > transcripts.json
``` ```
## Warning ## Warning