Skip to content

Latest commit

 

History

History
466 lines (395 loc) · 78 KB

maz_youtube_channel_lists.md

File metadata and controls

466 lines (395 loc) · 78 KB

MAZ YouTube channel lists

Taken from my YouTube channel on 2024-08-29.

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

258 Total / 243 Unique

Create your own list (on your YouTube channel).

Code to get channel lists.

Click to hide 47 channels

Scroll UP | TOP

Click to hide 36 channels

Scroll UP | TOP

Click to hide 23 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 38 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]);

Also, if you want to have the channel icons available offline, use the following; a lot larger since it stores all images in base64 text (data URL):

await(async()=>{//~ copy featured channels panel list as markdown (100% offline version - async)
    "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 img=Object.assign(new Image(),{loading:"eager",crossOrigin:"anonymous"}),
        cnv=document.createElement("canvas"),
        cnx=cnv.getContext("2d"),
        loadIMG=async src=>{
            "use strict";
            const p=new Promise(L=>img.onload=L);
            img.src=src;
            await p;
            cnv.width=img.naturalWidth;
            cnv.height=img.naturalHeight;
            cnx.drawImage(img,0,0);
            return cnv.toDataURL();
        },
        list=[...base.querySelectorAll("div#content>ytd-section-list-renderer ytd-grid-renderer div#items>ytd-grid-channel-renderer")],
        title=base.querySelector("ytd-engagement-panel-title-header-renderer #title>yt-formatted-string#title-text").textContent;
    for(let i=0;i<list.length;++i){
        const channel=list[i],
            link=channel.querySelector("a#channel-info").href;
        list[i]=`- <img alt="Channel icon" title="Channel icon" height="32" src="${await loadIMG(channel.querySelector("img#img").src)}"> [${channel.querySelector("span#title").textContent.replace(/([\\[\]])/g,"\\$1")}](${link} "${link.substring(24).replace(/([\\"])/g,"\\$1")}")`;
    }
    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>`);
})();

Scroll TOP