Skip to content

Commit 6907b8b

Browse files
committed
Updated Readme, added setup
1 parent 5453fd6 commit 6907b8b

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,40 @@
11
# youtube-transcript-channel-api
2-
[![Build Status](https://travis-ci.org/danielcliu/youtube-channel-transcript-api.svg?branch=master)](https://travis-ci.com/github/danielcliu/youtube-channel-transcript-api) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](http://opensource.org/licenses/MIT)
2+
[![Build Status](https://travis-ci.org/danielcliu/youtube-channel-transcript-api.svg?branch=master)](https://travis-ci.com/github/danielcliu/youtube-channel-transcript-api) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](http://opensource.org/licenses/MIT)[![image](https://img.shields.io/pypi/v/youtube-channel-transcript-api.svg)](https://pypi.org/project/youtube-channel-transcript-api/)
33

44
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).
55

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+
616
## API
717

818
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.
919

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+
```
1129

1230
To initialize a YoutubeChannelTranscipts object, you would call like
31+
1332
```python
1433
YoutubeChannelTranscripts(<youtube channel name>, <youtube data api key>)
1534
```
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+
1638
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.
1739

1840
Here is an example where the package fetches all transcript data from a channel using `get_transcripts()`:

setup.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import setuptools
2+
3+
with open("README.md", "r") as fh:
4+
long_description = fh.read()
5+
6+
setuptools.setup(
7+
name="youtube-channel-transcript-api", # Replace with your own username
8+
version="0.0.1",
9+
author="Daniel Liu",
10+
author_email="dcliu@ucdavis.edu",
11+
description="A python package the utilizes the Youtube Data V3 API to get all transcripts from a given channel/playlist.",
12+
long_description=long_description,
13+
long_description_content_type="text/markdown",
14+
url="https://github.com/danielcliu/youtube-channel-transcript-api",
15+
packages=setuptools.find_packages(),
16+
classifiers=[
17+
"Programming Language :: Python :: 3",
18+
"License :: OSI Approved :: MIT License",
19+
"Operating System :: OS Independent",
20+
],
21+
python_requires='>=3.6',
22+
install_requires=[
23+
'requests',
24+
'google-api-python-client',
25+
'youtube-transcript-api',
26+
],
27+
)

0 commit comments

Comments
 (0)