Skip to content

feat: Add initial support for YouTube clip links - #9532

Open
radmorecameron wants to merge 7 commits into
FreeTubeApp:developmentfrom
radmorecameron:add-initial-support-for-clip-links
Open

feat: Add initial support for YouTube clip links#9532
radmorecameron wants to merge 7 commits into
FreeTubeApp:developmentfrom
radmorecameron:add-initial-support-for-clip-links

Conversation

@radmorecameron

@radmorecameron radmorecameron commented Jul 29, 2026

Copy link
Copy Markdown
Member

Pull Request Type

  • Feature Implementation

Related issue

#4323

Description

This PR adds initial support for clip links.

Testing

Desktop

  • OS: Fedora Linux
  • OS Version: 42
  • FreeTube version: latest nightly

@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jul 29, 2026
@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) July 29, 2026 23:41
Comment thread src/renderer/helpers/api/local.js Outdated
@radmorecameron
radmorecameron marked this pull request as draft July 29, 2026 23:43
auto-merge was automatically disabled July 29, 2026 23:43

Pull request was converted to draft

@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jul 29, 2026
@radmorecameron
radmorecameron force-pushed the add-initial-support-for-clip-links branch from 613257f to 1644ed0 Compare August 2, 2026 20:03
@radmorecameron
radmorecameron marked this pull request as ready for review August 2, 2026 20:35
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 2, 2026
@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) August 2, 2026 20:35
@radmorecameron
radmorecameron marked this pull request as draft August 2, 2026 22:43
auto-merge was automatically disabled August 2, 2026 22:43

Pull request was converted to draft

@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 2, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@radmorecameron
radmorecameron force-pushed the add-initial-support-for-clip-links branch from 2dba6f2 to 9d63ca8 Compare August 24, 2026 22:00
@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@efb4f5ff-1298-471a-8973-3d47447115dc

Copy link
Copy Markdown
Member

Can be undrafted :)

@radmorecameron
radmorecameron force-pushed the add-initial-support-for-clip-links branch from 9d63ca8 to 9f06cb5 Compare August 26, 2026 22:49
@radmorecameron
radmorecameron marked this pull request as ready for review August 26, 2026 22:51
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 26, 2026
@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) August 26, 2026 22:52

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

navigating to the url throws an error

Image

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Aug 28, 2026
@radmorecameron radmorecameron added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Aug 28, 2026
@Shadorc

Shadorc commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Navigating to the URL with Invidious API throws too
image

Comment thread src/renderer/helpers/api/invidious.js Outdated
Comment thread src/renderer/helpers/api/invidious.js Outdated
Comment thread src/renderer/helpers/api/invidious.js Outdated
Comment thread src/renderer/helpers/api/invidious.js Outdated
Co-authored-by: Cameron Radmore <radmorecameron@gmail.com>
@radmorecameron

Copy link
Copy Markdown
Member Author

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.

Comment thread src/renderer/helpers/api/local.js Outdated
Comment on lines +2498 to +2506
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
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/renderer/helpers/api/invidious.js Outdated
@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Sep 1, 2026
@radmorecameron radmorecameron added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: waiting for review For PRs that are complete, tested, and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants