Currently in order to use this for my needs, i need to have a direct url in order to download video/audio and i'd like the ability to not have to host my own relay to convert GET request (in my case with just a youtube video id) to a POST request, then redirect with the url provided.
Additional Context
For example, the Discord bot I use seems to work great when using a direct url to media rather to music now, so I have to run an API of my own that calls the Cobalt API purely to receive the URL and redirect the user to it.
Example Code
Here is how this currently looks like as a POST request vs a GET request.
// POST request get get a stream URL
await fetch("https://api.cobalt.tools/api/json", {
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
aFormat: "best",
filenamePattern: "nerdy",
isAudioOnly: "true",
url: "https://www.youtube.com/watch?v=wcT7zgL6gug"
}),
method: "POST",
})
.then(response => response.json())
.then(data => console.log(data.url))
// GET Request for YouTube Stream URL
await fetch("https://api.cobalt.tools/api/json?aFormat=best&filenamePattern=nerdy&isAudioOnly=true&url=https://youtu.be/wcT7zgL6gug").then(r=>{r.json();console.log(r.url)});
Allow GET requests to the API via query string
Currently in order to use this for my needs, i need to have a direct url in order to download video/audio and i'd like the ability to not have to host my own relay to convert GET request (in my case with just a youtube video id) to a POST request, then redirect with the url provided.
Additional Context
For example, the Discord bot I use seems to work great when using a direct url to media rather to music now, so I have to run an API of my own that calls the Cobalt API purely to receive the URL and redirect the user to it.
Example Code
Here is how this currently looks like as a POST request vs a GET request.