added usage example

This commit is contained in:
Kim Oliver Drechsel 2020-12-02 11:29:29 +01:00
parent 467c3dcdcc
commit cd94ea0973

View File

@ -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)
````