Download youtube videos as MP3

Adds a button to download the Youtube video you are watching

// ==UserScript==
// @name         Download youtube videos as MP3
// @version      0.1
// @description  Adds a button to download the Youtube video you are watching
// @author       Vingyard
// @include      /youtube.com/watch/
// @grant        none
// @namespace https://greasyfork.org/users/150647
// ==/UserScript==

(function() {
    'use strict';
    const interval = setInterval(() => {
        const container = document.getElementById("info-text");
        if (container === null)
            return;
        clearInterval(interval);

        const btn = document.createElement("button");
        const API_URI = "https://youtube7.download/mini.php?id=";
        const videoId = (new URL(document.location.href)).searchParams.get("v");
        btn.innerHTML = "Download";
        btn.addEventListener("click", () => {
            window.open(API_URI + videoId);
        });
        container.appendChild(btn);
    }, 100);
})();