Created
November 24, 2016 14:40
-
-
Save BehindTheMath/b46ee34ce988ebb54382e40d48c0a2cc to your computer and use it in GitHub Desktop.
Download Youtube playlist as MP3s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==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(); | |
| } | |
| }) | |
| })() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instructions:
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.