K
K
Kevin Mitnick2016-04-10 22:19:53
JavaScript
Kevin Mitnick, 2016-04-10 22:19:53

VK API audio.search why does it come with an empty url?

I use client_id + secret_id from the official VK application for IOS. I get, using direct authorization ( https://oauth.vk.com/token?grant_type=password ) and specifying client_id + secret_id + login + password, an eternal token, through which I make all requests to the API on JQ.

I am making the following API request:

$.ajax({
            url: "https://api.vk.com/method/audio.search?q=megamix&count=2&v=5.50&access_token=" + token,
            type: "GET",
            dataType: "jsonp",
            crossDomain: true,
            success: function(data){
myFunc(data);
}
});


And this is the object I get as output from the VK API:
e01de1897c8849698ade8abe6093c4fb.png

Why does the object come without audio links? Of course, I can assume that there are no links due to the fact that audio recordings were cut in the off-line application on IOS, but in private messages they work fine and are fully reproduced. If I try to get the url of one audio recording using the audio.get method, I get exactly the same object with an empty URL. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zakhar Storozhuk, 2016-04-10
@volfing

Audio recordings in APIdog are obtained via the API, the audio.get method. One fine day, in turn, each application (Android, iPhone, iPad, Windows Phone, then Blackberry, Snapster, Kate, Lynt ...) stopped returning audio links. After about 10 hours of being dumb about this, Eduard Bezmenov (from the VK Coffee project) came up with an idea that turned out to be correct. VK began to check the User-Agent header when requesting the audio.get method. It only meant that in our situation, APIdog is in a complete ass, because there were two solutions, and both of them did not fit. First, you need to change the User-Agent header on the client, that is, replace the header in the current code. But this is not possible, because the site communicates with the API through a GET request using the tag
Quote from ApiDog website. More details: https://apidog.ru/6.5/blog.php?postId=5

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question