Answer the question
In order to leave comments, you need to log in
Why don't links to download music on Vkontakte vk.com always work, received both during parsing and when requesting api?
There is a VPS, it has 3proxy. On php, using curl, I get download links in two ways:
1. via api
2. By direct parsing of the contact
In both cases, the download url often does not work for some reason when downloading via php.
And what’s interesting, if you take, for example, firefox, and register the ip of the vps server in it in the proxy, and try to insert the url obtained from the php script on the VPS server, then this url never works (although it should, because there is a binding in VKontakte mp3 url to ip address).
And if through the same firefox, for example, you get a link to mp3 both through api and by parsing vk, then the link works in firefox. And also this link works in the php script on the server. How does it work? Does anyone have similar problems? Maybe the contact has some kind of protection that it issues such non-working links? Or did I miss something? Thanks in advance.
Update:
Using php on the VPS, I got the address " cs9-15v6.vk.me/p17/508c2a0395d968.mp3?extra=AEPUWH... "
Moreover, the cs9-15v6.vk.me domain does not resolve at all, here www.host -tracker.com/InstantCheck/ResultComplete/a... sometimes it doesn't resolve, sometimes it's a 302 error from different servers. How so? Any pros out there who know this? By the way, using this url, using php and VPS, we managed to upload the song, if not strange...
Solution:
Wow, it worked! It turned out that cs9-15v6.vk.me is an ipv6 address, the vps had an ipv6 address, and, apparently, he connected to the contact through this address, and the contact also returned ipv6 in response. Disabled ipv6 on my vps - and everything started working fine. Hooray! And how everything worked much faster! Conclusion - ipv6 is evil. At least in my situation.
ipv6 disabled like this:
nano /etc/sysctl.conf
At the end of these lines:
# IPv6 disabled
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Then
sysctl -p
And check
ifconfig
There should be no lines with ipv6. Hooray!)
Answer the question
In order to leave comments, you need to log in
Maybe this is due to "disabling the public API for audio" https://vk.com/dev/audio_api
All this rubbish with music is tied to the user agent. The music was made in such a way that it cannot be received / listened to in the browser (API). It is necessary to overwrite the user agent of the fox. My music generally works every other time from the browser from the site.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question