@@ -30,11 +30,11 @@ Now we can begin do the follows step.
3030Initialize the api instance with you app credentials
3131
3232```
33- In [1]: from pyyoutube import Api
33+ In [1]: from pyyoutube import Client
3434
35- In [2]: api = Api (client_id="you client id", client_secret="you client secret")
35+ In [2]: cli = Client (client_id="you client id", client_secret="you client secret")
3636
37- In [3]: api.get_authorization_url ()
37+ In [3]: cli.get_authorize_url ()
3838Out[3]:
3939('https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=client_id&redirect_uri=https%3A%2F%2Flocalhost%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&state=PyYouTube&access_type=offline&prompt=select_account',
4040 'PyYouTube')
@@ -72,7 +72,7 @@ Then you will get a Connection Error, don't worry. This just because we set the
7272Now you need to copy the full url in the browser address bar. Then back to you console.
7373
7474```
75- In [4]: token = api .generate_access_token(authorization_response="the whole url")
75+ In [4]: token = cli .generate_access_token(authorization_response="the whole url")
7676
7777In [5]: token
7878Out[5]: AccessToken(access_token='access token', expires_in=3600, token_type='Bearer')
@@ -87,23 +87,14 @@ now you have got your access token to visit your self data.
8787For example, you can get your playlists.
8888
8989```
90- In [6]: playlists = api.get_playlists (mine=True)
90+ In [6]: playlists = cli.playlists.list (mine=True)
9191
9292In [7]: playlists.items
9393Out[7]:
9494[Playlist(kind='youtube#playlist', id='PLBaidt0ilCManGDIKr8UVBFZwN_UvMKvS'),
9595 Playlist(kind='youtube#playlist', id='PLBaidt0ilCMbUdj0EppB710c_X5OuCP2g')]
9696```
9797
98- get your self profile.
99-
100- ```
101- In [8]: profile = api.get_profile()
102-
103- In [9]: profile
104- Out[9]: UserProfile(id='110109920178558006671', name='ikaros-life')
105- ```
106-
10798!!! note "Tips"
10899
109- If you have some confuse. you need to read the [Authorize Requests](https://developers.google.com/youtube/v3/guides/authentication) first.
100+ If you have some confuse. you need to read the [Authorize Requests](https://developers.google.com/youtube/v3/guides/authentication) first.
0 commit comments