YouTube offline subscription box 3 posts

OP Tue Nov 08, 2016 9:33 pm
User avatar
Legendary Family Member
  • Gender: Male
  • Posts: 6284
  • Joined: Jun, 2010
  • Advertisements: 45
  • Karma: 368
This is a GreaseMonkey script I am working on for displaying a subscription box on YT when not signed in. It's just something for me to use since I needed a quick and easy way to check when my favorite channels had new videos but I do not like signing into Google to use YoutTube.

It's basically the original subscription box but instead of populating with data from YouTube's server it populates with data you supply it.

Currently, it works but there is at least 1 bug, which is that it doesn't expand the sidebar or add a scroll bar so if you have too many channels on the list, you have to fullscreen your browser or it cuts them off.

I plan on cleaning up the code and originally I wanted to only supply the usernames and have the code automatically grab everything else but that seemed to be more effort than it was worth.

For FireFox users install Greasemonkey: ... asemonkey/

This script is subjective. You will not want the same channels as me. Therefore there is no install link, you must install it manually and edit it as you see fit.

// ==UserScript==
// @name        YT Subscription Offline Box
// @namespace   TIM-DM
// @include*
// @description
// @version     1
// @require
// @grant       GM_addStyle
// ==/UserScript==

//Hide everything in the sidebar
$(" >").hide();

var channels = [
   ["Numberphile2", "UCyp1gCHZJU_fGWFf2rtMkCg", "-AfT-CyBL4us/AAAAAAAAAAI/AAAAAAAAAAA/59e3G-iR-U0/s100-c-k-no-rj-c0xffffff/photo.jpg"],

function buildChannelListHtml() {
   //Set up YouTube styling HTML
   var channelListWrap = $("<div>", {class: "guide-section hover-action-menu-trigger vve-check", id: "guide-subscriptions-section"});
   $(channelListWrap).append($("<h3>", {text: "People I Watch"}));
   var div1 = $("<div>", {id: "guide-subs-footer-container"});
   var div2 = $("<div>", {id: "guide-subscriptions-container", class: "overflowable-list-root"});
   var div3 = $("<div>", {class: "guide-channels-content yt-scrollbar"});
   var channelList = $("<ul>", {class: "guide-channels-list guide-item-container parent-list guide-infinite-list yt-uix-scroller filter-has-matches yt-uix-tdl", id: "guide-channels", role: "menu"});

   for(var i = 0; i < channels.length; ++i) {
      var channel = channels[i];
      var channelName = channel[0];
      var channelID = channel[1];
      var channelIcon = channel[2];

      var channelListItem = $("<li>").append(
         $("<a>", {title: channelName, href: "" + channelID + "/videos", class: "guide-item yt-valign"}).append(
            $("<span>", {class: "yt-valign-container"}).append(
               $("<span>", {class: "thumb"}).append(
                  $("<span>", {class: "video-thumb  yt-thumb yt-thumb-20"}).append(
                     $("<span>", {class: "yt-thumb-square"}).append(
                        $("<span>", {class: "yt-thumb-clip"}).append(
                           $("<img>", {width: "20", height: "20", src: "" + channelIcon}),
                           $("<span>", {class: "vertical-align"})
               $("<span>", {class: "display-name no-count"}).append(
                  $("<span>", {text: channelName})




-- Sat Aug 08, 2015 8:17 am --

I've updated the script:

-Made the list scroll if you have more channels than your browser height can show
-Commented the code for readability
-Restructured the code into functions
-Renamed some variables
Tue Dec 27, 2016 8:12 am
User avatar
  • Posts: 14
  • Joined: Dec, 2016
  • Karma: 0
great job DM
OP Sat Jul 01, 2017 3:46 am
User avatar
Legendary Family Member
  • Gender: Male
  • Posts: 6284
  • Joined: Jun, 2010
  • Advertisements: 45
  • Karma: 368
I've completely rewritten the script. I managed to cut the number of lines down by about half using object-literals to create and populate the html.

I've also hidden everything else on the side bar so only the channels you choose to display will be visible. No more trending, or categories.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here


Create an account

Sign up for a new account in our community. It's easy!