Advertisement
Guest User

Untitled

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