Answer the question
In order to leave comments, you need to log in
How to get track name from VK status?
Good afternoon! Today I started writing a bot for twitch. Messages are sent successfully, the only thing left is to get the track name from the status. In principle, the name itself is obtained, but the output occurs as a complete json. Is it possible to somehow extract the track name separately from this answer?
{'text': 'Track Title + Artist', 'audio': {'artist': 'Artist', 'id': 456240254, 'owner_id': 19607100, 'title': 'Title', 'duration': 25 , 'is_explicit': False, 'url': ' https://vk.com/mp3/audio_api_unavailable.mp3 ', 'date': 1627090666, 'is_hq': True, 'main_artists': [{'name': ' Liza Evans', 'domain': '9129861303334899376', 'id': '
session = vk.Session(access_token=token_user)
api = vk.API(session ,v='5.92', lang='ru')
status = api.status.get(user_id=19607100)
Answer the question
In order to leave comments, you need to log in
Both title and author
Title and author separately
audio = status["text"]
artist = status["audio"]["artist"]
title = status["audio"]["title"]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question