Greasy Fork

Greasy Fork is available in English.

YouTube SS İndirici (CTRL+SHIFT = MP4, CTRL+ALT = MP3)

YouTube'da CTRL+SHIFT ile MP4, CTRL+ALT ile MP3 indirme. Açılan sekmede otomatik indir tuşuna basar 🚀

当前为 2025-06-11 提交的版本,查看 最新版本

// ==UserScript==
// @name         YouTube SS İndirici (CTRL+SHIFT = MP4, CTRL+ALT = MP3)
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  YouTube'da CTRL+SHIFT ile MP4, CTRL+ALT ile MP3 indirme. Açılan sekmede otomatik indir tuşuna basar 🚀
// @author       aliosman
// @match        https://www.youtube.com/watch*
// @match        https://www.ssyoutube.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // 1. YouTube tarafı
    if (window.location.hostname.includes("youtube.com")) {
        window.addEventListener('keydown', function (e) {
            // CTRL + SHIFT → MP4
            if (e.ctrlKey && e.shiftKey) {
                const videoURL = new URL(window.location.href);
                videoURL.hostname = "www.ssyoutube.com";
                videoURL.searchParams.set("type", "mp4");
                window.open(videoURL.href, '_blank');
            }

            // CTRL + ALT → MP3
            if (e.ctrlKey && e.altKey) {
                const videoURL = new URL(window.location.href);
                videoURL.hostname = "www.ssyoutube.com";
                videoURL.searchParams.set("type", "mp3");
                window.open(videoURL.href, '_blank');
            }
        });
    }

    // 2. SSYouTube tarafı
    if (window.location.hostname.includes("ssyoutube.com")) {
        const params = new URLSearchParams(window.location.search);
        const type = params.get("type");

        const waitAndClick = () => {
            let btns = document.querySelectorAll('a, button');

            btns.forEach(btn => {
                const text = btn.innerText.toLowerCase();
                if (
                    (type === "mp3" && text.includes("mp3")) ||
                    (type === "mp4" && text.includes("mp4"))
                ) {
                    btn.click();
                }
            });
        };

        // Sayfa yüklenince biraz bekleyip indir tuşuna bas
        window.addEventListener('load', () => {
            setTimeout(waitAndClick, 3000);
        });
    }
})();