You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to get some more data for your channel. You need provide the authorization first.
1
+
If you want to get more data for your channel, You need provide the authorization.
2
2
3
-
So, this doc show how to do authorize.
3
+
This doc shows how to authorize a client.
4
4
5
5
## Prerequisite
6
6
7
-
At the beginning. You must know what is authorization.
7
+
To begin with, you must know what authorization is.
8
8
9
9
You can see some information at the [Official Documentation](https://developers.google.com/youtube/v3/guides/authentication).
10
10
11
-
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.
11
+
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.
12
12
13
-
If everything goes well. Now let do a simple authorize with `Python-Youtube` library.
13
+
Once complete, you will be able to do a simple authorize with `Python-Youtube` library.
14
14
15
15
## Get authorization url
16
16
17
-
Suppose now we want to get user's permission to manage his youtube account.
17
+
Suppose now we want to get user's permission to manage their YouTube account.
18
18
19
19
For the `Python-YouTube` library, the default scopes are:
20
20
@@ -23,11 +23,11 @@ For the `Python-YouTube` library, the default scopes are:
23
23
24
24
You can get more scope information at [Access scopes](https://developers.google.com/youtube/v3/guides/auth/server-side-web-apps#identify-access-scopes).
25
25
26
-
And We set the default redirect url is `https://localhost/`.
26
+
(The defailt redirect URI used in PyYoutube is `https://localhost/`)
27
27
28
-
Now we can begin do the follows step.
28
+
We can now perform the following steps:
29
29
30
-
Initialize the api instance with you app credentials
30
+
Initialize the api instance with your app credentials
31
31
32
32
```
33
33
In [1]: from pyyoutube import Client
@@ -40,46 +40,47 @@ Out[3]:
40
40
'PyYouTube')
41
41
```
42
42
43
-
Now you get the authorization url, you just need copy the link, and open browser to paste the link, click the enter bar.
43
+
Open your broswer of choice and copy the link returned by `get_authorize_url()` into the searchbar.
Now you need to chose or enter you google account with youtube.
51
+
Select the account to authorize your app to read data from.
52
52
53
-
If your app have not got the approval from youtube. You will get an warning from youtube. If you have been approved, you will
54
-
see the next image show directly.
53
+
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.
click the blue button`allow` to give the permission.
66
+
Click`allow` to give the permission.
67
67
68
-
Then you will get a Connection Error, don't worry. This just because we set the redirect link to `localhost`.
68
+
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!
69
69
70
70
## Retrieve access token
71
71
72
-
Now you need to copy the full url in the browser address bar. Then back to you console.
72
+
Copy the full redicted URL from the browser address bar, and return to your original console.
73
73
74
74
```
75
-
In [4]: token = cli.generate_access_token(authorization_response="the whole url")
75
+
In [4]: token = cli.generate_access_token(authorization_response="$redirect_url")
Copy file name to clipboardExpand all lines: docs/docs/introduce-new-structure.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@ This doc will show you the new api structure for this library.
2
2
3
3
## Brief
4
4
5
-
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.
5
+
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.
6
6
7
7

8
8
9
9
10
-
In this structure, every resource will have self class. And to operate with YouTube API.
10
+
In this structure, every resource has a self class.
0 commit comments