Remove old kraken requests

This commit is contained in:
Ivan Habunek 2021-09-16 08:01:31 +02:00
parent 9c3cf11635
commit caabe3138c
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -42,15 +42,6 @@ def authenticated_post(url, data=None, json=None, headers={}):
return response
def kraken_get(url, params={}, headers={}):
"""
Add accept header required by kraken API v5.
see: https://discuss.dev.twitch.tv/t/change-in-access-to-deprecated-kraken-twitch-apis/22241
"""
headers["Accept"] = "application/vnd.twitchtv.v5+json"
return authenticated_get(url, params, headers)
def gql_post(query):
url = "https://gql.twitch.tv/gql"
response = authenticated_post(url, data=query).json()
@ -71,15 +62,6 @@ def gql_query(query):
return response
def get_video_legacy(video_id):
"""
https://dev.twitch.tv/docs/v5/reference/videos#get-video
"""
url = "https://api.twitch.tv/kraken/videos/{}".format(video_id)
return kraken_get(url).json()
VIDEO_FIELDS = """
id
title