🏠 Home 

音乐下载助手

音乐下载助手是方便下载的时候重命名


安装此脚本?
  1. // ==UserScript==
  2. // @name 音乐下载助手
  3. // @version 0.0.3
  4. // @include *://music.liuli.lol/music/*
  5. // @include *://music.liuli.lol/kugou/*
  6. // @include *://music.liuli.lol/xiami/*
  7. // @description 音乐下载助手是方便下载的时候重命名
  8. // @grant none
  9. // @run-at document-end
  10. // @namespace https://greasyfork.org/users/157626
  11. // ==/UserScript==
  12. var href = document.getElementById('dow').getAttribute('href');
  13. var title = $('.container h2').text();
  14. var author = $('.container h2').next().text();
  15. var isMusicPath = window.location.pathname.indexOf('music') > -1;
  16. if (href.indexOf('==/0') > -1) {
  17. title = '无法下载!无法下载!无法下载!无法下载!无法下载!无法下载!';
  18. }
  19. if (!isMusicPath) {
  20. author = $('.container h2').next().next().text();
  21. }
  22. var filename = author + ' - ' + title + '.mp3';
  23. var html = [
  24. '<div>',
  25. '<p><input id="i1" type="text" value="'+ href +'" style="width:600px"></p>',
  26. '<p><input id="i2" type="text" value="'+ filename +'" style="width:600px"></p>',
  27. '<p><a href="'+ href +'" download="'+ filename +'">下载</a></p>',
  28. '</div>'
  29. ];
  30. $('body').append(html.join(''));
  31. function select() {
  32. $('#i1, #i2').on('click', function() {
  33. $(this).select();
  34. });
  35. }
  36. select();