
15.11.2008, 17:20
|
|
Познавший АНТИЧАТ
Регистрация: 30.04.2007
Сообщений: 1,206
Провел на форуме: 4778940
Репутация:
1257
|
|
юзаю UserJS для оперы. всё качает. переписывайте в php и будет вам щастье:
// ==UserScript==
// @name Download audio from http://vkontakte.ru/
// @version 1.01
// @date 2008-03-18
// @include http://vkontakte.ru/*
// @include http://*.vkontakte.ru/*
// ==/UserScript==
(function(){
function isOpera9()
{
if(typeof(window.opera.version) == 'function' && window.opera.version() >= 9)
{
return true;
}
return false;
}
function onLoad()
{
var img = document.getElementsByTagName('img');
for(var i = 0; i < img.length; i++)
{
if(img[i].className && img[i].className == 'playimg')
{
var a = img[i].getAttribute('onclick', false);
if(a && a.search(/operate/i) >= 0)
{
var r = a.match(/operate\s*\x28\s*\d+\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s *[\x22\x27](\w+)[\x22\x27]/i);
if(r && r.length > 3)
{
var link = document.createElement('a');
link.href = 'http://cs' + r[1] + '.vkontakte.ru/u' + r[2] + '/audio/' + r[3] + '.mp3';
link.innerHTML = '\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u00bb';
link.setAttribute('target', '_blank', false);
link.setAttribute('style', 'display: block !important; float: none !important; font-weight: bold !important; margin: 15px 0 0 0 !important; padding: 0 !important; text-align: left !important;', false);
var p = img[i].parentNode;
if(p.nextSibling)
p.nextSibling.appendChild(link);
else
p.appendChild(link);
}
}
}
}
}
if(isOpera9())
document.addEventListener('DOMContentLoaded', onLoad, false);
else
document.addEventListener('load', onLoad, false);
})();
только-что проверил - работает.
|
|
|