feat: Add initial support for YouTube clip links - #9532
Conversation
Pull request was converted to draft
613257f to
1644ed0
Compare
Pull request was converted to draft
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
2dba6f2 to
9d63ca8
Compare
|
Conflicts have been resolved. A maintainer will review the pull request shortly. |
|
Can be undrafted :) |
9d63ca8 to
9f06cb5
Compare
Co-authored-by: Cameron Radmore <radmorecameron@gmail.com>
|
Both the Invidious and local api should be working now. Issue was a mix of typo + updating the name of a param in my YouTube.js PR and forgetting to reflect that change here. |
| const parsedParams = ClipParams.decode(Utils.base64ToU8(decodeURIComponent(clipResponse.payload.params))) | ||
|
|
||
| return { | ||
| videoId, | ||
| startTime: parsedParams.clipParamData.startTime / 1000, // convert to seconds | ||
| endTime: parsedParams.clipParamData.endTime / 1000, // convert to seconds | ||
| clipTitle: parsedParams.clipParamData.clipTitle, | ||
| clipMetadata: parsedParams.clipParamData.clipMetadata | ||
| } |
There was a problem hiding this comment.
As this section of the code is the same for the local and Invidious APIs apart from where the video ID and params string is read from, could you please extract it into a shared function that takes the video ID and params text as the input, decodes it and returns the object.
There was a problem hiding this comment.
I created a new shared.js file in the api folder. I felt like the current utils.js wasn't a great fit for this shared code since it wouldn't have much use outside of the local.js and invidious.js files.


Pull Request Type
Related issue
#4323
Description
This PR adds initial support for clip links.
Testing
Desktop