(requests, python, VK API) status.set error:29

import requests
 import datetime
 import time

from auth import tokenMy

token = tokenMy
timeKD = 3800

def startStatus():
    getCountry = requests.get(f"https://api.vk.com/method/account.getProfileInfo?v=5.95&access_token={token}").json()
    print(getCountry) 
    city = getCountry["response"]["city"]["title"]


    data = requests.get("http://api.openweathermap.org/data/2.5/weather",
                        params={"q": city,
                                "appid": "778d98cf94b6609bec655b872f24b907",
                                "units": "metric",
                                "lang": "ru"}).json()

    try:
        getLikes = requests.get(
            f"https://api.vk.com/method/photos.get?album_id=profile&rev=1&extended=1&count=1&v=5.95&access_token={token}").json()
        getLikes = getLikes["response"]["items"][0]["likes"]["count"]
        print(getLikes)
    except IndexError:
        print("У профиля отсутсвует аватар или лайки.")
        getLikes = 0

    today = datetime.datetime.today()
    nowTime = today.strftime("%H:%M")
    nowDate = today.strftime("%d.%m.%Y")

    statusSave = f"Время: {nowTime} | Дата: {nowDate} | Погода в {data['name']}: {data['main']['temp']}℃ | Лайков на аве: {getLikes} "
    print(statusSave)
    statusOut = requests.post(
        f"https://api.vk.com/method/status.set",
        data={'text': {statusSave}, 'v': '5.21', 'access_token': {token}})
    print(statusOut.json())


while True:
        startStatus()
        time.sleep(timeKD)

Не может обновить статус в вк. Может это requests.put запрос.


Ответы (0 шт):