Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

docs(language): fix grammar and wording #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions 28 README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Python YouTube

A Python wrapper around for YouTube Data API V3.
A Python wrapper for the YouTube Data API V3.

.. image:: https://github.com/sns-sdks/python-youtube/workflows/Test/badge.svg
:target: https://github.com/sns-sdks/python-youtube/actions
Expand All @@ -21,17 +21,17 @@ THANKS

Inspired by `Python-Twitter <https://github.com/bear/python-twitter>`_.

Thanks a lot for Python-Twitter Developers.
Thanks a lot to Python-Twitter Developers.

============
Introduction
============

Library provides an easy way to use YouTube Data API V3.
This library provides an easy way to use the YouTube Data API V3.

..

Recently, we are working on the new structure for the library. `Read docs <docs/docs/introduce-new-structure.md>`_ to get more detail.
We have recently been working on the new structure for the library. `Read docs <docs/docs/introduce-new-structure.md>`_ to get more detail.

=============
Documentation
Expand All @@ -56,21 +56,21 @@ You can install this lib from PyPI:
Using
=====

Now, the library covers all resource methods, including ``insert``,``update`` and so on.
The library covers all resource methods, including ``insert``,``update``, and so on.

Currently, we recommend using ``pyyoutube.Client`` to operate DATA API. It has more features.
We recommend using the ``pyyoutube.Client`` to operate DATA API. It is more modern and feature rich than ``pyyoutube.Api``.

Work with Client
----------------

You can just initialize with an api key:
You can initialize with an api key:

.. code-block:: python

>>> from pyyoutube import Client
>>> client = Client(api_key="your api key")

If you want to get some authorization data. you need to initialize with an access token:
To access additional data that requires authorization, you need to initialize with an access token:

.. code-block:: python

Expand All @@ -79,7 +79,7 @@ If you want to get some authorization data. you need to initialize with an acces

You can read the docs to see how to get an access token.

Or you can ask for user to do oauth flow:
Or you can ask for user to do OAuth:

.. code-block:: python

Expand All @@ -104,14 +104,14 @@ Get channel detail:
...
}

To get more usage to see our `client docs <docs/docs/usage/work-with-client.md>`_, or `client examples <examples/clients>`_
See the `client docs <docs/docs/usage/work-with-client.md>`_, or `client examples <examples/clients>`_, for additional usage

Work with API
----------------

..

We still support the old way for the sake of compatibility with older users.
For compatibility with older code, we continue to support the old way.

You can just initialize with an api key:

Expand All @@ -120,7 +120,7 @@ You can just initialize with an api key:
>>> from pyyoutube import Api
>>> api = Api(api_key="your api key")

If you want to get some authorization data. you need to initialize with an access token:
To access additional data that requires authorization, you need to initialize with an access token:

.. code-block:: python

Expand All @@ -129,7 +129,7 @@ If you want to get some authorization data. you need to initialize with an acces

You can read the docs to see how to get an access token.

Or you can ask for user to do oauth flow:
Or you can ask for user to do OAuth flow:

.. code-block:: python

Expand Down Expand Up @@ -184,4 +184,4 @@ Get channel detail:
...
}

To get more usage to see our `api docs <docs/docs/usage/work-with-api.md>`_, or `api examples <examples/apis>`_
See the `api docs <docs/docs/usage/work-with-api.md>`_, or `api examples <examples/apis>`_, for additional usage.
45 changes: 23 additions & 22 deletions 45 docs/docs/authorization.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
If you want to get some more data for your channel. You need provide the authorization first.
If you want to get more data for your channel, You need provide the authorization.

So, this doc show how to do authorize.
This doc shows how to authorize a client.

## Prerequisite

At the beginning. You must know what is authorization.
To begin with, you must know what authorization is.

You can see some information at the [Official Documentation](https://developers.google.com/youtube/v3/guides/authentication).

Then you need have an app with the [Access scopes](https://developers.google.com/youtube/v3/guides/auth/server-side-web-apps#identify-access-scopes) approval by YouTube.
You will need to create an app with [Access scope](https://developers.google.com/youtube/v3/guides/auth/server-side-web-apps#identify-access-scopes) approval by YouTube.

If everything goes well. Now let do a simple authorize with `Python-Youtube` library.
Once complete, you will be able to do a simple authorize with `Python-Youtube` library.

## Get authorization url

Suppose now we want to get user's permission to manage his youtube account.
Suppose now we want to get user's permission to manage their YouTube account.

For the `Python-YouTube` library, the default scopes are:

Expand All @@ -23,11 +23,11 @@ For the `Python-YouTube` library, the default scopes are:

You can get more scope information at [Access scopes](https://developers.google.com/youtube/v3/guides/auth/server-side-web-apps#identify-access-scopes).

And We set the default redirect url is `https://localhost/`.
(The defailt redirect URI used in PyYoutube is `https://localhost/`)

Now we can begin do the follows step.
We can now perform the following steps:

Initialize the api instance with you app credentials
Initialize the api instance with your app credentials

```
In [1]: from pyyoutube import Client
Expand All @@ -40,46 +40,47 @@ Out[3]:
'PyYouTube')
```

Now you get the authorization url, you just need copy the link, and open browser to paste the link, click the enter bar.
Open your broswer of choice and copy the link returned by `get_authorize_url()` into the searchbar.

## Do authorization

If you enter the url. you will see this.
On entering the URL, you will see the following:

![auth-1-chose-account](images/auth-1-chose-account.png)

Now you need to chose or enter you google account with youtube.
Select the account to authorize your app to read data from.

If your app have not got the approval from youtube. You will get an warning from youtube. If you have been approved, you will
see the next image show directly.
If your app is not approved for use, you will recieve a warning. You can prevent this by adding your chosen Google account as a test member on your created OAuth application.
Otherwise, you will see the following:

![auth-2-not-approval](images/auth-2-not-approval.png)

For now, you need to click the button ``Advanced``, then click the ``Go to Python-YouTube (unsafe)``.
You will need to click ``Advanced``, then click the ``Go to Python-YouTube (unsafe)``.

![auth-3-advanced](images/auth-3-advanced.png)

Now you can get a window to give permissions.
You should now see a window to select permissions granted to the application.

![auth-4-allow-permission](images/auth-4-allow-permission.png)

click the blue button `allow` to give the permission.
Click `allow` to give the permission.

Then you will get a Connection Error, don't worry. This just because we set the redirect link to `localhost`.
You will see a Connection Error, as the link is redirecting to `localhost`. This is standard behaviour, so don't close the window or return to a previous page!

## Retrieve access token

Now you need to copy the full url in the browser address bar. Then back to you console.
Copy the full redicted URL from the browser address bar, and return to your original console.

```
In [4]: token = cli.generate_access_token(authorization_response="the whole url")
In [4]: token = cli.generate_access_token(authorization_response="$redirect_url")

In [5]: token
Out[5]: AccessToken(access_token='access token', expires_in=3600, token_type='Bearer')
```

(Replace `$redirect_url` with the URL you copied)

now you have got your access token to visit your self data.
You now have an access token to view your account data.


## Get your data
Expand All @@ -97,4 +98,4 @@ Out[7]:

!!! note "Tips"

If you have some confuse. you need to read the [Authorize Requests](https://developers.google.com/youtube/v3/guides/authentication) first.
If you are confused, it is beneficial to read the [Authorize Requests](https://developers.google.com/youtube/v3/guides/authentication) guide first.
38 changes: 19 additions & 19 deletions 38 docs/docs/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
This doc is a simple tutorial to show how to use this library to get data from YouTube DATA API.
This document is a simple tutorial to show how to use this library to get data from YouTube data API.

You can get the whole description for YouTube API at [YouTube API Reference](https://developers.google.com/youtube/v3/docs/).
You can get the whole description for the YouTube API at [YouTube API Reference](https://developers.google.com/youtube/v3/docs/).

## Prerequisite

At the beginning. You need to create a [Google Project](https://console.cloud.google.com) by your google account.
To begin, you need to create a [Google Project](https://console.cloud.google.com) with your google account.

Every new account has 12 project to cost.
Every new account has a free quota of 12 projects.

## Create your project

Click the `Select a project-> NEW PROJECT` to create a new project to use our library.
Click `Select a project-> NEW PROJECT` to create a new project to use our library.

Fill the basic info to finish created.
Fill in the basic info and create the project.

![gt-create-app-1](images/gt-create-app-1.png)

## Enable YouTube DATA API service

Once the project created, the browser will redirect project home page.
Once the project created, the browser will redirect you to the project home page.

Then click the `≡≡` symbol on the left top. Chose the `APIs & Services` tab.
Click the `≡≡` symbol on the top left and select the `APIs & Services` tab.

You will see follow info.
You will see following info:

![gt-create-app-2](images/gt-create-app-2.png)

Click the `+ ENABLE APIS AND SERVICES` symbol. And input `YouTube DATA API` to search.
Click the `+ ENABLE APIS AND SERVICES` symbol, and input `YouTube DATA API` to search.

![gt-create-app-3](images/gt-create-app-3.png)

Then chose the ``YouTube DATA API`` item.
Chose the ``YouTube DATA API`` item.

![gt-create-app-4](images/gt-create-app-4.png)

Then click the `ENABLE` blue button. Now the service has been activated.
Then click the `ENABLE` blue button. After a short period where the API is added to your project, the service will be activated.

## Create credentials

To use this API, you may need credentials. Click 'Create credentials' to get started.
To use this API, you need credentials. Click `Create credentials` to get started.

![gt-create-app-5](images/gt-create-app-5.png)

Expand All @@ -50,20 +50,20 @@ Then click the blue button `What credentials do I need?` to create.

![gt-create-app-6](images/gt-create-app-6.png)

Now you have generated one api key.
You have now generated an api key.

Use this key. You can retrieve public data for YouTube data by our library
Using this key, you can retrieve public YouTube data with our library

```python
from pyyoutube import Client

cli = Client(api_key="your api key")
```

If you want to get some examples to see, check out the [examples](https://github.com/sns-sdks/python-youtube/tree/master/examples).
Check out the [examples](https://github.com/sns-sdks/python-youtube/tree/master/examples) directory for some examples of using the library.

If you have an opens source application using python-youtube, send me a link, and I am very happy to add a link to it here.
If you have an open source application using python-youtube, send me a link. I am very happy to add a link to it here.

But if you want to get user data by OAuth. You need create the credential for ``OAuth client ID``.
If you want to get user data by OAuth. You need create the credential for ``OAuth client ID``.

And get more info at next page for [Authorization](authorization.md).
You will find more information on OAth at the [Authorization](authorization.md) page.
2 changes: 1 addition & 1 deletion 2 docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Use the API to upload videos, manage playlists and subscriptions, update channel

This library provides a Python interface for the [YouTube DATA API](https://developers.google.com/youtube/v3).

Library could work on Python 3.6+.
This library has works on all Python versions 3.6 and newer.

!!! tip "Tips"

Expand Down
6 changes: 3 additions & 3 deletions 6 docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $ pip install --upgrade python-youtube
```


Also, you can build this library from source code
You can also build this library from source

```shell
$ git clone https://github.com/sns-sdks/python-youtube.git
Expand All @@ -28,8 +28,8 @@ $ make build

## Testing

If you have been installing the requirements use ``make env``.
You can use following command to test the code
Run `make env` after you have installed the project requirements.
Once completed, you can run code tests with

```shell
$ make tests-html
Expand Down
4 changes: 2 additions & 2 deletions 4 docs/docs/introduce-new-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ This doc will show you the new api structure for this library.

## Brief

To make the package easier to maintain and easy to use. We are shifted to using classes for different YouTube resources in an easier, higher-level programming experience.
To make the package easier to maintain and easy to use. We have shifted to using classes for different YouTube resources in an easier, higher-level, programming experience.

![structure-uml](images/structure-uml.png)


In this structure, every resource will have self class. And to operate with YouTube API.
In this structure, every resource has a self class.

## Simple usage

Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.