Youtube Downloader

Allows you to download videos off YouTube. (Yet another one...)

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Youtube Downloader
// @namespace    pxgamer
// @version      0.4.1
// @description  Allows you to download videos off YouTube. (Yet another one...)
// @author       pxgamer
// @include      *youtube.com/watch?v=*
// @require      https://code.jquery.com/jquery-1.12.3.min.js
// @grant        none
// ==/UserScript==
/*jshint multistr: true */

(function() {
    'use strict';

    $('#watch8-secondary-actions').prepend('<div class="yt-uix-menu dlmp3"><button class="yt-uix-button yt-uix-button-size-default yt-uix-button-opacity yt-uix-button-has-icon no-icon-markup pause-resume-autoplay yt-uix-menu-trigger yt-uix-tooltip" type="button" role="button" aria-pressed="false" title="Download as MP3" aria-haspopup="true" data-tooltip-text="Download as MP3" aria-labelledby="yt-uix-tooltip2707-arialabel"><span><img style="width: 20px; height: 20px;" src="https://pximg.xyz/images/a80307fb3e74a1c17694454617d1560d.png"></span><span class="yt-uix-button-content">Download as MP3</span></button></div>');

    $('.dlmp3').on('click', function() {
        let url = 'https://www.youtubeinmp3.com/fetch/?format=JSON&video=' + location.href;
        $.ajax({
            method: "GET",
            url: url,
            dataType: "json",
            success: function(data) {
                location.href = data.link;
            }
        });
    });

})();