|
1 | 1 | # youtube-transcript-channel-api |
2 | | -[](https://travis-ci.com/github/danielcliu/youtube-channel-transcript-api) [](http://opensource.org/licenses/MIT) |
| 2 | +[](https://travis-ci.com/github/danielcliu/youtube-channel-transcript-api) [](http://opensource.org/licenses/MIT)[](https://pypi.org/project/youtube-channel-transcript-api/) |
3 | 3 |
|
4 | 4 | Expand upon the [youtube-transcript-api](https://github.com/jdepoix/youtube-transcript-api) and allow users to easily request all of a channel's (or a playlist's) video caption data. This will require use of [Youtube Data API v3](https://developers.google.com/youtube/v3). |
5 | 5 |
|
| 6 | +## Install |
| 7 | + |
| 8 | +It is recommended to install this with `pip` |
| 9 | + |
| 10 | +``` |
| 11 | +pip install youtube_channel_transcript_api |
| 12 | +``` |
| 13 | +If you install from source, you will have to install the dependencies from the Pipfile with `pipenv install` |
| 14 | +For more information on pipenv see [here](https://pipenv.pypa.io/en/latest/) |
| 15 | + |
6 | 16 | ## API |
7 | 17 |
|
8 | 18 | Integrate this package into your python 3.6+ application. It is built as a sort of expansion [youtube-transcript-api](https://github.com/jdepoix/youtube-transcript-api). For that reason, that package's warnings/use cases mostly apply to this project as well. |
9 | 19 |
|
10 | | -The package revolves around creating YoutubeChannelTranscript objects, and then using them to obtain all of the caption data from that channel's videos. This package also is built on the YouTube Data API v3, which means to use this you will need to setup your own account and use your own API Key. See [here](https://developers.google.com/youtube/v3/getting-started) for directions how to setup your account if you don't have one. |
| 20 | +The package revolves around creating YoutubeTranscripts objects, and then using them to obtain all of the caption data from that channel/playlist's videos. This package also is built on the YouTube Data API v3, which means to use this you will need to setup your own account and use your own API Key. See [here](https://developers.google.com/youtube/v3/getting-started) for directions how to setup your account if you don't have one. |
| 21 | + |
| 22 | +There are two types of YoutubeTranscripts objects, YoutubeChannelTranscripts and YoutubePlaylistTranscripts |
| 23 | + |
| 24 | +To iniitialze a YoutubePlaylistTranscripts object, you would call like |
| 25 | + |
| 26 | +```python |
| 27 | +YoutubePlaylistTranscripts(<playlist name>, <playlist id>, <youtube data api key>) |
| 28 | +``` |
11 | 29 |
|
12 | 30 | To initialize a YoutubeChannelTranscipts object, you would call like |
| 31 | + |
13 | 32 | ```python |
14 | 33 | YoutubeChannelTranscripts(<youtube channel name>, <youtube data api key>) |
15 | 34 | ``` |
| 35 | + |
| 36 | +Note: A YoutubeChannelTranscripts object basically searches youtube for the top 5 channels closest to the given name and uses the top match. It creates a YoutubePlaylistTranscripts object with the data it gets back, so the rest of the two classes' functionality are identical. |
| 37 | + |
16 | 38 | You can then either call `get_transcripts()` to return a dictionary of all transcripts and a list of videos that errored, or you can call `write_transcripts()` to write out all of the transcripts to json files at the filepath location. |
17 | 39 |
|
18 | 40 | Here is an example where the package fetches all transcript data from a channel using `get_transcripts()`: |
|
0 commit comments