Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unable to download a release from the Github API #6904

Closed
5 of 6 tasks
yorffuoj opened this issue Feb 23, 2025 · 2 comments
Closed
5 of 6 tasks

[Bug]: Unable to download a release from the Github API #6904

yorffuoj opened this issue Feb 23, 2025 · 2 comments

Comments

@yorffuoj
Copy link

Guidelines

Describe the bug

This bug is not directly related to the FreeTube app but to this GitHub repo. I apologize because I don't know how to label it.

I want to automate the download of the latest FreeTube version when available.
So I checked the GitHub API page and followed the steps.
When I run the command

curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/reeTubeApp/FreeTube/releases/latest

I only get a 404 error.
I tried other repos and it worked.
Note that I generated again a token to make sure it was not because of it.
I wonder what is wrong with this repo. Maybe some settings don't allow me to do so.

Expected Behavior

When I run the command

curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/reeTubeApp/FreeTube/releases/latest

I want to get hte list of all available assets for the latest release

Issue Labels

usability issue

FreeTube Version

all

Operating System Version

Linux

Installation Method

.deb

Primary API used

Local API

Last Known Working FreeTube Version (If Any)

No response

Additional Information

No response

Nightly Build

@yorffuoj yorffuoj added the bug Something isn't working label Feb 23, 2025
@github-project-automation github-project-automation bot moved this to To assign in Bug Reports Feb 23, 2025
@absidue
Copy link
Member

absidue commented Feb 23, 2025

The problem is not with this repo but with your API call, you likely didn't read the API docs correctly, specifically this part:

The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at attribute.

You are asking GitHub to return the most recent non-prerelease release but as FreeTube is in beta we only have pre-releases, so GitHub is correctly telling you that what you are asking for doesn't exist. Instead you should be calling the list releases endpoint and using the first item in the array e.g. https://api.github.com/repos/freetubeapp/freetube/releases?per_page=1 (adding per_page=1 instructs it to only return the first item in the array).

@absidue absidue closed this as completed Feb 23, 2025
@absidue absidue removed bug Something isn't working B: usability labels Feb 23, 2025
@yorffuoj
Copy link
Author

Indeed I did not pay attention to that. Thank you a lot for the information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To assign
Development

No branches or pull requests

2 participants