Streamcloud Downloader

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

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