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
awaitfetch("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
awaitfetch("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)});
Originally created by @SmilerRyan on GitHub (Sep 1, 2024).
Original GitHub issue: https://github.com/imputnet/cobalt/issues/707
### 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.
```js
// 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)});
```
for anyone reading before the comment gets deleted, DO NOT run this on your computer, its malware.
@wukko spam ^ @dumbmoron
<!-- gh-comment-id:2323526262 -->
@lostdusty commented on GitHub (Sep 1, 2024):
for anyone reading before the comment gets deleted, DO NOT run this on your computer, its malware.
@wukko spam ^ @dumbmoron
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @SmilerRyan on GitHub (Sep 1, 2024).
Original GitHub issue: https://github.com/imputnet/cobalt/issues/707
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.
@lostdusty commented on GitHub (Sep 1, 2024):
for anyone reading before the comment gets deleted, DO NOT run this on your computer, its malware.
@wukko spam ^ @dumbmoron
@wukko commented on GitHub (Sep 2, 2024):
we will not implement GET requests for main processing endpoint.