Skip to content

Latest commit

 

History

History
428 lines (359 loc) · 75 KB

maz_youtube_channel_lists.md

File metadata and controls

428 lines (359 loc) · 75 KB

MAZ YouTube channel lists

Taken from my YouTube channel on 2024-06-02.

Count Channel list (click to scroll to the list)
46 → Entertainer (General List)
36 → Animations
22 → Mechanics
34 → Documentaries
8 → Backrooms / SCP
26 → Science
23 → Technology
14 → Maths
9 → Electronics
37 → Game dev

255 Total / 240 Unique

Create your own list (on your YouTube channel).

Code to get channel lists.

Click to hide 46 channels

Scroll UP | TOP

Click to hide 36 channels

Scroll UP | TOP

Click to hide 22 channels

Scroll UP | TOP

Click to hide 34 channels

Scroll UP | TOP

Click to hide 8 channels

Scroll UP | TOP

Click to hide 26 channels

Scroll UP | TOP

Click to hide 23 channels

Scroll UP | TOP

Click to hide 14 channels

Scroll UP | TOP

Click to hide 9 channels

Scroll UP | TOP

Click to hide 37 channels

Scroll UP | TOP

Create your own list

You can create your personal featured channel (or playlist) listings on your YouTube channel:

  • Open YouTube studio (https://studio.youtube.com) and log in
    • or click on your avatar on any YouTube page (top right) and click YouTube Studio
  • On the sidebar click Customization
  • choose tab Layout if it's not already
  • scroll down to Featured sections
  • add (up to 12) sections (channels/playlist(s)/videos) via the ADD SECTION button

Optionally, when you want to link to a section via the #:~:text= (URL Fragment Text Directives), as I did here, then it's best to choose a unique prefix, as I did with → <name>, so it doesn't accidentally match (and scroll to) some video title with that name in it on the page

Scroll TOP

Code to get channel lists

Open a channels-page like https://www.youtube.com/@MAZ01001/channels?view=49&flow=grid&shelf_id=3 and load the entire page by scrolling all the way down.

YouTube removed featured-channels pages, so now, you click on the title / "View all" on the channel list panel (e.g., https://www.youtube.com/@MAZ01001#:~:text=%E2%86%92%20Entertainer%20(General%20List)) and make sure the entire list is loaded by scrolling all the way down.

Then, open developer-console [F12] and copy-paste the following code:

(()=>{//~ copy featured channels panel list as markdown
    "use strict";
    const base=Array.prototype.filter.call(
        document.querySelectorAll("ytd-app ytd-popup-container>tp-yt-paper-dialog:has(ytd-engagement-panel-section-list-renderer)"),
        panel=>panel.checkVisibility()
    )[0];
    if(base==null)return"couldn't find channel panel";
    const list=Array.prototype.map.call(
        base.querySelectorAll("div#content>ytd-section-list-renderer ytd-grid-renderer div#items>ytd-grid-channel-renderer"),
        channel=>(link=>`- <img alt="Channel icon" title="Channel icon" height="32" src="${channel.querySelector("img#img").src}"> [${channel.querySelector("span#title").textContent.replace(/([\\[\]])/g,"\\$1")}](${link} "${link.substring(24).replace(/([\\"])/g,"\\$1")}")`)(channel.querySelector("a#channel-info").href)
    ),title=base.querySelector("ytd-engagement-panel-title-header-renderer #title>yt-formatted-string#title-text").textContent;
    console.log("found %i channels in list: %s",list.length,title);
    return(markdown=>window.copy?(window.copy(markdown),"markdown copied"):markdown)(`## [${title.replace(/([\\[\]])/g,"\\$1")}](${location.protocol}//${location.host+location.pathname.replace("/featured","")}#:~:text=${encodeURIComponent(title)} "View list on YouTube")\n\n<details open><summary>Click to hide ${list.length} channels</summary>\n\n${list.join("\n")}\n\n</details>`);
})();

It copies (or prints out) the entire list formatted as markdown, including the title and the number of channels (exactly like the lists here).

Alternatively, you can, instead of pasting the above code into the dev-console, create a new bookmark named something like YT featured channels to markdown with the following text as the URL and click on it whenever you need to copy the list (without opening dev-console).

javascript:(base=>base==null?alert("Couldn't find channel panel"):((list,title)=>navigator.clipboard.writeText(`## [${title.replace(/([\\[\]])/g,"\\$1")}](${location.protocol}//${location.host+location.pathname.replace("/featured","")}#:~:text=${encodeURIComponent(title)} "View list on YouTube")\n\n<details open><summary>Click to hide ${list.length} channels</summary>\n\n${list.join("\n")}\n\n</details>`).then(()=>alert(`Markdown list ${title} with ${list.length} channels copied`)).catch(reason=>alert("Couldn't copy markdown, reason: %O",reason)))(Array.prototype.map.call(base.querySelectorAll("div#content>ytd-section-list-renderer ytd-grid-renderer div#items>ytd-grid-channel-renderer"),channel=>(link=>`- <img alt="Channel icon" title="Channel icon" height="32" src="${channel.querySelector("img#img").src}"> [${channel.querySelector("span#title").textContent.replace(/([\\[\]])/g,"\\$1")}](${link} "${link.substring(24).replace(/([\\"])/g,"\\$1")}")`)(channel.querySelector("a#channel-info").href)),base.querySelector("ytd-engagement-panel-title-header-renderer #title>yt-formatted-string#title-text").textContent))(Array.prototype.filter.call(document.querySelectorAll("ytd-app ytd-popup-container>tp-yt-paper-dialog:has(ytd-engagement-panel-section-list-renderer)"),panel=>panel.checkVisibility())[0]);

Scroll TOP