Outline for basic YouTube API wrapper

This commit is contained in:
Christian Colglazier 2021-06-28 14:29:11 -04:00
parent 4d256d6aa4
commit be3a4240d0
2 changed files with 15 additions and 1 deletions

10
youtube_api.py Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env python3
# Python wrapper for REST API for some of the YouTube API.
from requests import get, post
import json
class YouTubeAPI(object):
def __init__(self, key):
self.url = 'https://www.googleapis.com/youtube/v3/'
self.key = key

View File

@ -1,6 +1,10 @@
#!/usr/bin/env python3
from youtube_api import YouTubeAPI
# Read YouTube API Key
def getYouTubeAPIKey():
return open('youtube.key', 'r').read()
api = YouTubeAPI(getYouTubeAPIKey())
print(getYouTubeAPIKey())
exit(0)