Z
Z
zRrr2019-05-12 20:09:28
API
zRrr, 2019-05-12 20:09:28

How to get list of audio recordings using vk api?

You need to get a list of the user's audio recordings. As you know, in 2016 vk closed the open api for audio.
I tried to get a token pretending to be an android, substituting user-agent:

QNetworkRequest request;
    request.setRawHeader(
        QByteArray("User-Agent"),
        QByteArray("VKAndroidApp/4.38-816 (Android 6.0; SDK 23; x86; Google Nexus 5X; ru")
        );
    request.setUrl(QUrl ("
https://oauth.vk.com/authorize?client_id=2274003&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=audio&response_type=token&v=5.95&state=1337
"));
     ui->view = new QWebView;
     ui->view->load(request, QNetworkAccessManager::UnknownOperation);
     ui->view->show();

but the answer
{"error":"invalid_access","error_description":"Security issue"}

In the case of using a regular token, it throws a stub, using client_id kate mobile when receiving a token and using it, displays error 25 "Token confirmation required"
Request for audio recording:
https://api.vk.com/method/audio.get?uid=212306824&need_user=1&count=15&access_token=мойтокен&v=5.95

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zRrr, 2019-05-19
@zRrr

The fact is that I set the user agent for the request, and not for QWebView, so I had to create a QNetworkAccessManager and use manager->get (request) to get a response (I used the kate mobile token)

M
Mors Clamor, 2019-05-13
@66demon666

VK closed API access to audio

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question