ROBLOX Soundloader

Download songs from ROBLOX!

当前为 2015-06-07 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name ROBLOX Soundloader
  3. // @namespace RBLXSNDLDR
  4. // @version 1.1
  5. // @description Download songs from ROBLOX!
  6. // @author SFOH
  7. // @match http://www.roblox.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. function createDownloadBtn(pElement,type,uri){ //where pElement is the frame to add the button to
  12. if(type==="audio"){
  13. var b = document.createElement("input");
  14. console.log(pElement);
  15. b.setAttribute("class","downloadButton");
  16. b.setAttribute("type","image");
  17. b.setAttribute("style","background:url(http://vavvi.com/images/2015/06/ncrr1l5xcu0qbyvwwzye.png) 0px 0px;border:0;margin:0;padding:0;cursor:pointer;color:transparent;position:relative;background-repeat:no-repeat;width:25px;height:25px;left:-25px;top:-25px;z-index:9");
  18. b.setAttribute("href",uri);
  19. b.onmouseenter=function(){
  20. b.setAttribute("style","background:url(http://vavvi.com/images/2015/06/ncrr1l5xcu0qbyvwwzye.png) -25px 0px;border:0;margin:0;padding:0;cursor:pointer;color:transparent;position:relative;background-repeat:no-repeat;width:25px;height:25px;left:-25px;top:-25px;z-index:9")
  21. }
  22. b.onmouseleave=function(){
  23. b.setAttribute("style","background:url(http://vavvi.com/images/2015/06/ncrr1l5xcu0qbyvwwzye.png) 0px 0px;border:0;margin:0;padding:0;cursor:pointer;color:transparent;position:relative;background-repeat:no-repeat;width:25px;height:25px;left:-25px;top:-25px;z-index:9")
  24. }
  25. pElement.appendChild(b);
  26. }
  27. }
  28.  
  29. function assetPuller(){
  30. if(this.document.title.indexOf("by")){ //if the url specifies an asset
  31. if(this.document.title.indexOf("Audio") != -1){ //if the asset is a sound then
  32. var objects = document.getElementsByClassName("MediaPlayerIcon Play");
  33. for (var i = 0;i < objects.length;i++){
  34. var playbutton = objects[i];
  35. var parent = playbutton.parentElement;
  36. var asseturi = playbutton.getAttribute("data-mediathumb-url");
  37. createDownloadBtn(parent,"audio",asseturi);
  38. }
  39. }
  40. }
  41. }
  42.  
  43. assetPuller()