Streamcloud Downloader

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

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

  1. // ==UserScript==
  2. // @name Streamcloud Downloader
  3. // @version 1.0.1.1
  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. // @namespace https://greasyfork.org/users/10905
  12. // ==/UserScript==
  13. // Global Vars
  14. var jwplayer_innerHTML = "";
  15. var url = "";
  16.  
  17. var as = document.getElementsByTagName("a");
  18. var scripts = document.getElementsByTagName("script");
  19.  
  20. // Mainloop
  21. for(var i=0;i<scripts.length;i++)
  22. {
  23. // Filestring Isolating
  24. if(scripts[i].innerHTML.indexOf("jwplayer(\"mediaplayer\").setup({") != -1){
  25. jwplayer_innerHTML = scripts[i].innerHTML;
  26. jwplayer_innerHTML = jwplayer_innerHTML.replace("jwplayer(\"mediaplayer\").setup({","").split(",")
  27. // Filestring Isolated
  28. url = jwplayer_innerHTML[2].replace("file: \"","").replace("\"","")
  29. for(var i=0;i<as.length;i++) // Search for StreamTab
  30. {
  31. if(as[i].innerHTML == "Stream"){
  32. // Replace with Download and link.
  33. as[i].innerHTML = "Download";
  34. as[i].href=url;
  35. }
  36. }
  37. break;
  38. }
  39. }