More descriptive /api/json response #320

Closed
opened 2025-11-09 09:46:10 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @im-trisha on GitHub (Jun 17, 2024).

describe the feature you'd like to see

  1. I was thinkering with the api, and i had to do an ugly workaround to get the filename, while as far as I'm able to see it could simply be provided in the /api/json request?

  2. In the same way, while thinkering with the api, i found (somewhat) difficult to understand if the downloaded media is a video, or an audio file. Couldn't it be as easy as putting a boolean?

describe alternatives you've considered

  1. Obviously the alternative is to strip it from the content-disposition header got after the GET request to /api/stream
  2. I mean, the alternative i see is just getting the file extension and elaborate from that? I'm not sure though

I hope this is not a stupid request nor has it already been asked.
Many thanks!

Originally created by @im-trisha on GitHub (Jun 17, 2024). **describe the feature you'd like to see** 1. I was thinkering with the api, and i had to do an ugly workaround to get the filename, while as far as I'm able to see it could simply be provided in the /api/json request? 2. In the same way, while thinkering with the api, i found (somewhat) difficult to understand if the downloaded media is a video, or an audio file. Couldn't it be as easy as putting a boolean? **describe alternatives you've considered** 1. Obviously the alternative is to strip it from the content-disposition header got after the GET request to /api/stream 2. I mean, the alternative i see is just getting the file extension and elaborate from that? I'm not sure though I hope this is not a stupid request nor has it already been asked. Many thanks!
GiteaMirror added the feature requestnext major labels 2025-11-09 09:46:11 -06:00
Author
Owner

@lostdusty commented on GitHub (Jun 17, 2024):

I have asked cobalt devs, they told me to get the file name on the http request (you can http HEAD to get the file name without needing to download the media)

@lostdusty commented on GitHub (Jun 17, 2024): I have asked cobalt devs, they told me to get the file name on the http request (you can http HEAD to get the file name without needing to download the media)
Author
Owner

@lostdusty commented on GitHub (Jun 17, 2024):

some code i did to get the filename: eb43cdb54e/main.go (L264-L269)

@lostdusty commented on GitHub (Jun 17, 2024): some code i did to get the filename: https://github.com/lostdusty/gualto/blob/eb43cdb54e59fd3acb46c499d39aedb7081f11b8/main.go#L264-L269
Author
Owner

@wukko commented on GitHub (Jun 17, 2024):

we could totally add the filename to stream response, i see how it can be useful

@wukko commented on GitHub (Jun 17, 2024): we could totally add the filename to stream response, i see how it can be useful
Author
Owner

@im-trisha commented on GitHub (Jun 17, 2024):

@wukko and what about the api/json response? The endpoint are not as descriptive as they could get, so I'm not sure if its the correct endpoint, but I'd expect from this endpoint every info except the actual file.

And what about the file type?

@im-trisha commented on GitHub (Jun 17, 2024): @wukko and what about the api/json response? The endpoint are not as descriptive as they could get, so I'm not sure if its the correct endpoint, but I'd expect from this endpoint every info except the actual file. And what about the file type?
Author
Owner

@im-trisha commented on GitHub (Jun 17, 2024):

@lostdusty seems wonderful! I'll use exactly that for the time being :)

@im-trisha commented on GitHub (Jun 17, 2024): @lostdusty seems wonderful! I'll use exactly that for the time being :)
Sign in to join this conversation.