Skip to content

Commit d690889

Browse files
committed
add OAuthQuery to queries
1 parent 5060e28 commit d690889

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

resources/lib/twitch/queries.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
_usher_baseurl = 'https://usher.ttvnw.net/'
1515
_clips_baseurl = 'https://clips.twitch.tv/'
1616
_uploads_baseurl = 'https://uploads.twitch.tv/'
17+
_oauth_baseurl = 'https://api.twitch.tv/kraken/oauth2/'
1718

1819
_v5_headers = {'ACCEPT': 'application/vnd.twitchtv.v5+json'}
1920

@@ -161,6 +162,12 @@ def __init__(self, path, headers={}, data={}, method=methods.GET):
161162
self.add_path(path)
162163

163164

165+
class OAuthQuery(JsonQuery):
166+
def __init__(self, path, headers={}, data={}, method=methods.GET):
167+
super(JsonQuery, self).__init__(_oauth_baseurl, headers, data, method)
168+
self.add_path(path)
169+
170+
164171
class ClipsQuery(DownloadQuery):
165172
def __init__(self, path, headers={}, data={}, method=methods.GET):
166173
super(ClipsQuery, self).__init__(_clips_baseurl, headers, data, method)

0 commit comments

Comments
 (0)