Я Я пробовал передать URL-адрес и пул в качестве параметров, но оба выдают синтаксическую ошибку. Вот мой код:
Код: Выделить всё
token = get_token()
client_id = "my id"
headers = {"Client-ID":client_id, "Authorization":"Bearer " + token['access_token'], "Content-Type":"application/x-www-form-urlencoded"}
# slug = url.split("/games/")[1]
# data = "fields *, cover.url, videos.video_id, release_dates.human; where slug = '"+slug+"';"
data = "fields *, cover.url, videos.video_id, release_dates.human; where url = '"+url+"';"
response = requests.post("https://api.igdb.com/v4/games", headers=headers, data=data)
game_info = json.loads(response.content.decode('utf-8'))
Код: Выделить всё
[{'title': 'Syntax Error', 'status': 400, 'cause': "Expecting a STRING as input, surround your input with quotes starting at 'https' expecting {'{', 'f', '(', '[', 'true', 't', 'false', 'null', 'n'"}]
Подробнее здесь: https://stackoverflow.com/questions/787 ... o-from-url
Мобильная версия