Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save BehindTheMath/b46ee34ce988ebb54382e40d48c0a2cc to your computer and use it in GitHub Desktop.

Select an option

Save BehindTheMath/b46ee34ce988ebb54382e40d48c0a2cc to your computer and use it in GitHub Desktop.
Download Youtube playlist as MP3s
// ==UserScript==
// @name Download Youtube playlist as MP3s
// @namespace behindthemath.io
// @include http://www.youtubecomtomp3.com/YouTube-Playlist-Downloader.php
// @version 1
// @grant none
// ==/UserScript==
(function () {
console.log("Running...");
var runButton = document.createElement('button');
runButton.id = "runButton";
runButton.className = "StartDownloadButton Button greenButton";
runButton.appendChild(document.createTextNode('Really download all...'));
var parent = document.getElementById('DownloadButtonsLine'); parent.appendChild(runButton);
var w = parseInt(window.getComputedStyle(parent).width, 10) +
parseInt(window.getComputedStyle(runButton)["margin-left"], 10) + runButton.offsetWidth;
parent.style.width = w + "px";
runButton.addEventListener("click", function () {
var nodeList = document.querySelectorAll('.DownloadButton');
for (node of nodeList) {
node.onclick();
}
})
})()
@BehindTheMath
Copy link
Author

Instructions:

  1. Install the Greasemonkey extension.
  2. Click the Raw button above and install the script.
  3. go to http://www.youtubecomtomp3.com/YouTube-Playlist-Downloader.php
  4. Enter the URL of the playlist in the box and click Download MP3. The site will show a list of all the videos in the playlist.
  5. Click the Really download all... button. All the MP3s will download at once.
  6. Profit. (Well, almost. The site gets stuck on some of the files; nothing to do with the script. When the script is done, you will need to find those and manually download using a different site).

How it works:

The script injects the Really download all... button onto the page. After the page lists all the files, clicking the button just automates clicking the Download button for each file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment