added usage example
This commit is contained in:
parent
467c3dcdcc
commit
cd94ea0973
24
README.md
24
README.md
@ -12,3 +12,27 @@ However the script needs the channel id. You can get the id from here when you o
|
||||
|
||||
|
||||
Requires '_requests_' to work.
|
||||
|
||||
## Usage example
|
||||
````python
|
||||
from GetLatestVideo import API
|
||||
|
||||
# Add your Youtube Data API V3 Key here
|
||||
API_KEY = ''
|
||||
|
||||
# Add the Channel IDs here
|
||||
# When you only know the channel name you can get the ID from here https://commentpicker.com/youtube-channel-id.php
|
||||
CHANNEL_ID = [
|
||||
'ID1',
|
||||
'ID2'
|
||||
]
|
||||
|
||||
videos = []
|
||||
|
||||
yt = API(API_KEY)
|
||||
|
||||
for channel in CHANNEL_ID:
|
||||
videos.append(yt.get_latest_video(channel))
|
||||
|
||||
print(videos)
|
||||
````
|
Loading…
Reference in New Issue
Block a user