Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var response;
- async function DownAud() //Creates a function to Download the Audio
- { //Starts the function
- response = await fetch("https://radio1.hu/audioplayer.php?access_token=4%01%09%07%22%19%13XWT%5BTASRVZVT", { //Starts the fetch
- "headers": {
- "accept": "*/*",
- "accept-language": "en-US,en;q=0.9,pt-PT;q=0.8,pt-BR;q=0.7,pt;q=0.6",
- "range": "bytes=32768-",
- "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"98\", \"Microsoft Edge\";v=\"98\"",
- "sec-ch-ua-mobile": "?0",
- "sec-ch-ua-platform": "\"Windows\"",
- "sec-fetch-dest": "video",
- "sec-fetch-mode": "no-cors",
- "sec-fetch-site": "same-origin",
- "sec-gpc": "1"
- },
- "referrer": "https://radio1.hu/tracklista/metzker-viktoria-mix/",
- "referrerPolicy": "strict-origin-when-cross-origin",
- "body": null,
- "method": "GET",
- "mode": "cors",
- "credentials": "omit"
- }); //Finishes the Fetch
- const blob = await response.blob(); //Gets the fetch response //Store the file bytes
- const link = document.createElement("a"); //Creates a new link element
- link.href = URL.createObjectURL(blob); //Add the file bytes as a blob link in the link element
- link.download = 'Audio File'; //Add a file name and download to the link element
- link.click(); //Click on the link element
- } //Finishes the async FormatMoreInfoText function
- DownAud(); //Runs the DownAud function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement