Skip to content

Make YTM proxy optional in synced-lyrics-plugin#4448

Open
halleck1 wants to merge 2 commits into
pear-devs:masterfrom
halleck1:ytm-proxy-optional
Open

Make YTM proxy optional in synced-lyrics-plugin#4448
halleck1 wants to merge 2 commits into
pear-devs:masterfrom
halleck1:ytm-proxy-optional

Conversation

@halleck1

@halleck1 halleck1 commented May 7, 2026

Copy link
Copy Markdown

For the jurisdictions the YTM proxy is not needed there's now an option to go directly to the "/browse" API skipping the proxy. Also helps a recent downtime on the proxy.

Summary by CodeRabbit

  • New Features
    • Added a new toggle in the Synced Lyrics settings to fetch lyrics directly from YouTube Music (bypassing the external proxy). The option is off by default and includes a label and tooltip in the UI.

@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 114fd0d1-31c3-46be-9598-5ae7b4f4ea43

📥 Commits

Reviewing files that changed from the base of the PR and between f9d9205 and 5a1bc9d.

📒 Files selected for processing (1)
  • src/plugins/synced-lyrics/providers/YTMusic.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/plugins/synced-lyrics/providers/YTMusic.ts

📝 Walkthrough

Walkthrough

This PR adds a configuration option to the Synced Lyrics plugin enabling direct YouTube Music API calls via app authentication instead of routing through an external proxy. The feature includes a new boolean config field, menu checkbox toggle, conditional fetch logic in the provider, and localized UI strings.

Changes

YTM Direct Browse Fetch Feature

Layer / File(s) Summary
Configuration Type Definition
src/plugins/synced-lyrics/types.ts
SyncedLyricsPluginConfig type gains useYTMLyricsWithoutProxy: boolean field.
Plugin Default Configuration
src/plugins/synced-lyrics/index.ts
Default config initializes useYTMLyricsWithoutProxy to false.
Provider Conditional Fetch Logic
src/plugins/synced-lyrics/providers/YTMusic.ts
fetchBrowse() method now conditionally routes to direct app-authenticated fetchBrowseDirect() or external proxy based on config flag; provider imports config and search uses fetchBrowse(browseId) to obtain contents.
Menu UI Control
src/plugins/synced-lyrics/menu.ts
Checkbox menu item use-ytm-lyrics-without-proxy added with localized label/tooltip; toggling updates config via ctx.setConfig.
Localization Strings
src/i18n/resources/en.json
i18n keys for menu label and tooltip describing direct YouTube Music authentication behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A config switch, so clean and bright,
Direct to YouTube, no proxy in sight!
The lyrics flow with app's own grace,
Authenticated in the right place.
Hop along, the feature's done! 🎵

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Make YTM proxy optional in synced-lyrics-plugin' accurately describes the primary change: adding a configuration option to make the YouTube Music proxy optional in the synced-lyrics plugin.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/plugins/synced-lyrics/providers/YTMusic.ts`:
- Around line 146-156: The method fetchBrowseDirect currently throws if the
'ytmusic-app' element is missing; change it to mirror fetchNext by returning
null when document.querySelector<MusicPlayerAppElement>('ytmusic-app') is not
found and only call app.networkManager.fetch when app exists. Then update
search() to guard the awaited result from fetchBrowseDirect (check for null
before destructuring the BrowseData) so that when useYTMLyricsWithoutProxy is
enabled and the element is absent the provider returns null instead of throwing;
reference fetchBrowseDirect, fetchNext and search when making these changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b7236153-2dad-48ab-9917-3bc14f4a74d4

📥 Commits

Reviewing files that changed from the base of the PR and between 124ffb6 and f9d9205.

📒 Files selected for processing (5)
  • src/i18n/resources/en.json
  • src/plugins/synced-lyrics/index.ts
  • src/plugins/synced-lyrics/menu.ts
  • src/plugins/synced-lyrics/providers/YTMusic.ts
  • src/plugins/synced-lyrics/types.ts

Comment thread src/plugins/synced-lyrics/providers/YTMusic.ts Outdated
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.

1 participant