TEXT   486   0
   215 2.18 KB    76

TamperMonkey Cytube Script

By SmilesIsPasting
Created: 2021-01-23 21:31:33
Updated: 2021-01-30 17:10:25
Expiry: Never

  1. 1.
    // ==UserScript==
  2. 2.
    // @name Cytube playlist tool
  3. 3.
    // @namespace playlisttool
  4. 4.
    // @description Cytube playlist tool
  5. 5.
    // @grant GM_addStyle
  6. 6.
    // @include https://cytu.be/r/*
  7. 7.
  8. 8.
    // @run-at document-end
  9. 9.
    // @version 0.0.1
  10. 10.
    // ==/UserScript==
  11. 11.
     
  12. 12.
    GM_addStyle ( `
  13. 13.
    #rightpane {
  14. 14.
    white-space:nowrap;
  15. 15.
    overflow-x:auto;
  16. 16.
    }
  17. 17.
    #rightpane-inner {
  18. 18.
    display:inline-block;
  19. 19.
    float:left;
  20. 20.
    width:100%;
  21. 21.
    overflow:hidden;
  22. 22.
    }
  23. 23.
    #playlist_area {
  24. 24.
    width:0px;
  25. 25.
    height:520px;
  26. 26.
    border-width:2px;
  27. 27.
    background-color:#2e3338;
  28. 28.
    color:#fff;
  29. 29.
    font-weight:400;
  30. 30.
    padding:5px;
  31. 31.
    display:inline-block;
  32. 32.
    margin-left:30px;
  33. 33.
    }
  34. 34.
    ` );
  35. 35.
     
  36. 36.
    document.getElementById("rightpane").innerHTML += "<Textarea id='playlist_area'></Textarea>";
  37. 37.
    document.getElementById("videocontrols").innerHTML += "<button class='btn btn-sm btn-default' id='toggle_button'>Get playlist links</button>";
  38. 38.
    document.getElementById("toggle_button").onclick = function(){toggle();};
  39. 39.
     
  40. 40.
    var list = [];
  41. 41.
    var d = document.getElementById("playlist_area");
  42. 42.
    var r = document.getElementById("rightpane-inner");
  43. 43.
    var b = document.getElementById("toggle_button");
  44. 44.
     
  45. 45.
    d.style.visibility="hidden";
  46. 46.
    d.onclick = function(){d.style.borderColor=null;};
  47. 47.
     
  48. 48.
    function check(){
  49. 49.
    var matches = document.querySelectorAll(".qe_title");
  50. 50.
    for(var i = 0; i < matches.length; i++){
  51. 51.
    if(!list.includes(matches[i])){
  52. 52.
    list.push(matches[i]);
  53. 53.
    d.value += (matches[i].innerHTML + "\n" + matches[i].getAttribute("href") + "\n\n");
  54. 54.
    d.style.borderColor="#42b142";
  55. 55.
    }
  56. 56.
    }
  57. 57.
    }
  58. 58.
     
  59. 59.
    function toggle(){
  60. 60.
    if(d.style.visibility == "hidden"){
  61. 61.
    if(list == ""){
  62. 62.
    check();
  63. 63.
    window.setInterval(check, 30000);
  64. 64.
    }
  65. 65.
    d.style.visibility = "visible";
  66. 66.
    d.style.width="50%";
  67. 67.
    r.style.width = "50%";
  68. 68.
    b.innerHTML = "Hide playlist links";
  69. 69.
    }
  70. 70.
    else if(d.style.visibility == "visible"){
  71. 71.
    d.style.visibility = "hidden";
  72. 72.
    d.style.width = "0px"
  73. 73.
    r.style.width = "100%";
  74. 74.
    b.innerHTML = "Show playlist links";
  75. 75.
    }
  76. 76.
    }

/mlp/ Rewatch Stream S1E01+02

by SmilesIsPasting

/mlp/ Rewatch Stream S1E05+06

by SmilesIsPasting

/mlp/ Rewatch Stream S1E07+08

by SmilesIsPasting

/mlp/ Rewatch Stream S1E09+10

by SmilesIsPasting

/mlp/ Rewatch Stream S1E11+12

by SmilesIsPasting