Outline for basic YouTube API wrapper
This commit is contained in:
parent
4d256d6aa4
commit
be3a4240d0
10
youtube_api.py
Normal file
10
youtube_api.py
Normal 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
|
@ -1,6 +1,10 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from youtube_api import YouTubeAPI
|
||||||
|
|
||||||
# Read YouTube API Key
|
# Read YouTube API Key
|
||||||
def getYouTubeAPIKey():
|
def getYouTubeAPIKey():
|
||||||
return open('youtube.key', 'r').read()
|
return open('youtube.key', 'r').read()
|
||||||
|
|
||||||
|
api = YouTubeAPI(getYouTubeAPIKey())
|
||||||
print(getYouTubeAPIKey())
|
print(getYouTubeAPIKey())
|
||||||
exit(0)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user