Skip to content

fix: make clip api less expensive - #5871

Closed
radmorecameron wants to merge 1 commit into
iv-org:masterfrom
radmorecameron:make-clip-api-less-expensive
Closed

fix: make clip api less expensive#5871
radmorecameron wants to merge 1 commit into
iv-org:masterfrom
radmorecameron:make-clip-api-less-expensive

Conversation

@radmorecameron

@radmorecameron radmorecameron commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the AI Policy and understand the disclosure requirements

AI Disclosure

  • AI was not used to create this pull request

Pull request description

I added the clip api endpoint to Invidious for FreeTube to use and am now finally getting around to adding support in FreeTube.

The endpoint is unnecessarily expensive for no good reason with the get_video call so this PR replaces it with just the video_id instead. I haven't been able to find a client that uses this endpoint but would like to use it in FreeTube as part of: FreeTubeApp/FreeTube#9532

Testing

{INVIDIOUS API}/api/v1/clips/UgkxxPM3BRphCAPLP88YoUGuj79KXPfpNNO_

@Fijxu

Fijxu commented Aug 2, 2026

Copy link
Copy Markdown
Member

Sorry but I don't think we are going to accept this PR as the whole point of the video key in the clips API is to show the video information from where the clip was created. I sadly have no clip URL to test but that is what the code does. This is a breaking change that could break some third party applications that make use of that endpoint.

In the other hand seems like the clips feature has been removed from Youtube, but since I don't have any clip ID to test that, I can't really verify that.

@radmorecameron

Copy link
Copy Markdown
Contributor Author

Hi @Fijxu I added an example url to the description.

I'm not aware of any third party apps using this endpoint.

I am the person that added the endpoint (in this PR: #4264 ). With the API endpoint as is, FreeTube would likely be making two get_video requests instead of one

@Fijxu

Fijxu commented Aug 2, 2026

Copy link
Copy Markdown
Member

I see, thank you for providing a test clip link, I'm still against removing the video information from the clips API because that would involve a breaking change. If you want to make the API less expensive, a query parameter like fetch_video= [false | true] would be better, being true the default value of the query parameter, and then you can send false to make it less expensive for your use case.

What do you think @unixfox ?

@unixfox

unixfox commented Aug 2, 2026

Copy link
Copy Markdown
Member

I think removing it is probably a bad idea, people might depend on it.

From a quick search on https://github.com/search?q=%2Fapi%2Fv1%2Fclips+invidious&type=code. I found playlet using that API endpoint: https://github.com/iBicha/playlet/blob/48b10e8618924cadfe2e96beac95061b97586bb9/playlet-web/src/lib/Api/InvidiousApi.ts#L84

@radmorecameron

Copy link
Copy Markdown
Contributor Author

Ahh, I think I must have had a typo in my original GitHub search; I wasn't aware playlet was using this. I'll close this PR and opt for using the resolveurl api endpoint (and parsing the params in FreeTube instead). Sorry about that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants