Streamcloud Downloader

Allows you to download videos from Streamcloud via the Download button at the upper right corner of the player

当前为 2015-05-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Streamcloud Downloader
  3. // @version 1.0.1.2
  4. // @description Allows you to download videos from Streamcloud via the Download button at the upper right corner of the player
  5. // @match http://streamcloud.eu/*/*.mp4
  6. // @match http://streamcloud.eu/*/*.htm
  7. // @match http://streamcloud.eu/*/*.html
  8. // @match http://streamcloud.eu/*/*.avi
  9. // @copyright 2015 comfix
  10. // @icon http://i.imgur.com/MTTvgbC.png
  11. // @grant none
  12. // @namespace https://greasyfork.org/users/10905
  13. // ==/UserScript==
  14. // Global Vars
  15. var jwplayer_innerHTML = "";
  16. var url = "";
  17.  
  18. var as = document.getElementsByTagName("a");
  19. var scripts = document.getElementsByTagName("script");
  20.  
  21. // Mainloop
  22. for(var i=0;i<scripts.length;i++)
  23. {
  24. // Filestring Isolating
  25. if(scripts[i].innerHTML.indexOf("jwplayer(\"mediaplayer\").setup({") != -1){
  26. jwplayer_innerHTML = scripts[i].innerHTML;
  27. jwplayer_innerHTML = jwplayer_innerHTML.replace("jwplayer(\"mediaplayer\").setup({","").split(",")
  28. // Filestring Isolated
  29. url = jwplayer_innerHTML[2].replace("file: \"","").replace("\"","")
  30. for(var i=0;i<as.length;i++) // Search for StreamTab
  31. {
  32. if(as[i].innerHTML == "Stream"){
  33. // Replace with Download and link.
  34. as[i].innerHTML = "Download";
  35. as[i].href=url;
  36. }
  37. }
  38. break;
  39. }
  40. }