vk music downloader

Очень простой скрипт, добавляющий ссылки для скачивания к аудиозаписям на vk.com. Если ссылки не появились автоматически, используйте горячую клавишу F9.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        vk music downloader
// @version     1.3
// @description Очень простой скрипт, добавляющий ссылки для скачивания к аудиозаписям на vk.com. Если ссылки не появились автоматически, используйте горячую клавишу F9.
// This simple script adds a download links to audios at vk.com. If links did not appear automatically use F9 hot key.
// @match       https://vk.com/*
// @copyright   nyaa
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// 2015
// @namespace https://greasyfork.org/users/6507
// ==/UserScript==

function add_download_links() {
    $('.audio').each(function(){
        if( !$(this).hasClass('proccessed') ) {
            var mp3 = $(this).find('input').val();
            var track_name = $(this).find('.title_wrap').text();
            $(this).find('.title_wrap').prepend('<span style="padding-right: 5px;">[<a class="download-link" title="Скачать" target="_blank" data-track_name="' + track_name + '" href="' + mp3 + '">Save</a>]</span>');
            $(this).addClass('proccessed');
        }
    });
}

$(document).ready(function() {    

    $('body').keydown(function(e){
        if (e.which == 120) {
            add_download_links();
        }
    });
});