Greasy Fork is available in English.

YouTube, Load More Videos

Load more videos onto a YouTube channel's videos page without having to scroll. Click the "LOAD MORE" button next to "PLAY ALL" at the top of the video list to be prompted for the number of additional pages of videos to load. If you don't see the button, reload the page.

  1. // ==UserScript==
  2. // @name YouTube, Load More Videos
  3. // @namespace driver8.net
  4. // @version 0.1.1
  5. // @description Load more videos onto a YouTube channel's videos page without having to scroll. Click the "LOAD MORE" button next to "PLAY ALL" at the top of the video list to be prompted for the number of additional pages of videos to load. If you don't see the button, reload the page.
  6. // @author driver8
  7. // @match *://*.youtube.com/user/*/videos*
  8. // @match *://*.youtube.com/channel/*/videos*
  9. // @match *://*.youtube.com/c/*/videos*
  10. // @grant none
  11. // ==/UserScript==
  12. (function() {
  13. 'use strict';
  14.  
  15. console.log('hi, load more');
  16.  
  17. var PAUSE_TIME = 10;
  18. var DEFAULT_PAGES = 5;
  19.  
  20. var button_html = `<div id="load-more" class="style-scope ytd-channel-sub-menu-renderer">
  21. <ytd-button-renderer button-renderer="" class="style-scope ytd-channel-sub-menu-renderer style-text" is-paper-button="">
  22. <a class="yt-simple-endpoint style-scope ytd-button-renderer" tabindex="-1">
  23. <paper-button role="button" tabindex="0" animated="" aria-disabled="false" elevation="0" id="button" class="style-scope ytd-button-renderer style-text">
  24. Load more
  25. </paper-button>
  26. </a>
  27. </ytd-button-renderer>
  28. </div>`
  29. var new_div = document.createElement('div');
  30. new_div.innerHTML = button_html.trim();
  31. new_div = new_div.firstElementChild;
  32. var temp1 = new_div.firstElementChild.innerHTML;
  33. document.querySelector('#primary-items').appendChild(new_div);
  34. window.setTimeout(function test1() {
  35. new_div.firstElementChild.innerHTML = temp1;
  36. }, 20);
  37. new_div.onclick = function() {
  38. var desired_pages = parseInt(prompt('Load how many pages', DEFAULT_PAGES));
  39. if (desired_pages > 0) {
  40. start_load(desired_pages);
  41. }
  42. };
  43.  
  44. function start_load(num) {
  45. var i = 0,
  46. cont = document.getElementsByTagName('yt-next-continuation')[0],
  47. spin = document.getElementsByTagName('paper-spinner')[0];
  48. (function load_page() {
  49. if (spin.attributes['aria-hidden']) {
  50. cont.onShow();
  51. i++;
  52. }
  53. if (i < num) {
  54. window.setTimeout(load_page, PAUSE_TIME);
  55. }
  56. })();
  57. }
  58. })();