composer require yuru-yuri/vaud
<?php
use YuruYuri\Vaud\Decoder;
$uid = 1; // You vk uid
$url = 'https://m.vk.com/mp3/audio_api_unavailable.mp3?extra=CeHXAgfYufnZDhy3twvZEvfIuZy4Cu0...#ASS...';
$decoder = new Decoder($uid);
$decodedUrl = $decoder->decode($url);
$decodedUrl === 'https://cs1-23v1.vkuseraudio.net/p1/ae1240a98cf.mp3?extra=XZ...';
<?php
use YuruYuri\Vaud\AlAudio;
$my_vk = new MyVkClass(); # Own class for vk.com
$cookies = $my_vk->cookies; # Get site cookies. dict()
$uid = $my_vk->uid; # User id
$audio_parser = new AlAudio($uid /* Your or another user */, $cookies);
$all_urls = $audio_parser->main();
// result:
[
[
'url' => 'Encoded url',
'track' => 'Track name',
'author' => 'Author',
'id' => 'VK track id',
0 => 'Encoded url',
1 => 'Track name',
2 => 'Author',
3 => 'VK track id'
],
[
'url' => 'Encoded url',
'track' => 'Track name',
'author' => 'Author',
'id' => 'VK track id',
0 => 'Encoded url',
1 => 'Track name',
2 => 'Author',
3 => 'VK track id'
],
];
$decoded_urls = []; # Look before examples