SampleFocus Downloader Hack

Download samples from SampleFocus without needing a subscription.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         SampleFocus Downloader Hack
// @namespace    http://tampermonkey.net/
// @version      v1.0.0
// @description  Download samples from SampleFocus without needing a subscription.
// @author       You
// @match        https://samplefocus.com/samples/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=samplefocus.com
// @grant        none
// @license      MIT
// ==/UserScript==

// This script lets you download the audio file from the preview so you don't need any credits.
// The main downside to this is that the result is an MP3 file rather than a WAV file.

const downloadForFree = async () => {
    const elem = document.createElement('a');

    const sampleUrl = JSON.parse(document.querySelector('[data-component-name="SampleHero"]').innerText).sample.sample_mp3_url;
    const resp = await fetch(sampleUrl);
    const blob = await resp.blob();

    elem.href = URL.createObjectURL(blob);

    elem.download = sampleUrl.split('/')[8].split('?')[0]; // download file name
    elem.click();
};

const freeDownloadBtn = document.createElement('button');
freeDownloadBtn.innerText = 'CLICK TO GET MP3 WITH NO CREDITS';
freeDownloadBtn.style = 'color: white; background-color: black; border: 1px solid white; border-radius: 50px; font-size: 15px; padding: 10px; cursor: pointer';
freeDownloadBtn.addEventListener('click', downloadForFree);
document.getElementsByClassName('MuiGrid-root MuiGrid-container MuiGrid-spacing-xs-2 css-1eikg3m')[0].append(freeDownloadBtn);