How do I create a playlist from multiple video IDs on youtube?

Viewed 2664

I have a multitude of video IDs (200+) and I would like to create a youtube playlist using all of the video IDs. I tried solutions from here: https://webapps.stackexchange.com/questions/120451/how-to-create-a-playlist-form-a-list-of-links-not-from-bookmarks

None of those solutions worked, and most of them had a 50 video limit. The python code given only had the first video in it, and none of the other videos. The first method didn't work either, and the excel sheet, when copied, completely broke for me.

Is there any way for me to add these videos to a playlist, which is not manual? EG. Using a playlist creator or a program / api? Thanks.

2 Answers

Source / Credits: Create a YouTube Playlist Without an Account With This URL Trick


By following this structure, you can create an untitled playlist:

http://www.youtube.com/watch_videos?video_ids=ID1,ID2,ID3,ID4

This is an example I created:

http://www.youtube.com/watch_videos?video_ids=nWyetldx4PU,gvubjVKOMuc,M3emJNkMmnA,QL2ohdMRck0,irTjCnHmU-E

After pasting the previous URL in the browser, the URL changed to: https://www.youtube.com/watch?v=nWyetldx4PU&list=TLGGyc5oTGfqXdswNjEwMjAyMA

  1. if you have the URLs of videos, get the ids of the videos with Regular expression.

  2. then, create a playlist with the help of @Mauricio Arias Olave's answer. or you can follow my video too https://youtu.be/_gaVUYfWb6g

  3. then with this below Js code you can convert the playlist to a permanent playlist in your youtube account. It simply adds those videos to the first available playlist. els2[1].click(); you can change the number in this line to select a different playlist. you will have to run this code in the browser console.

this will work until youtube changes their HTML lol.

(function myLoop(i) {
  setTimeout(function() {
    console.log(i);
    letters[i].click();
    var els = document.querySelectorAll(".style-scope.ytd-menu-service-item-renderer");
    console.log(els);
    if(els.length){
        els[6].click();
        var els2 =  document.querySelectorAll(".checkbox-height.style-scope.ytd-playlist-add-to-option-renderer");
        if(els2.length){
            els2[1].click();
             console.log("saved in playlist");
        }
    }

    document.getElementsByTagName("body")[0].click();
    if (--i) myLoop(i);   //  decrement i and call myLoop again if i > 0
  }, 3000)
})(letters.length-1);
Related