Add YouTube as a platform#52
Open
serrebidev wants to merge 2 commits into
Open
Conversation
Adds a YouTube backend alongside Mastodon and Bluesky: OAuth 2.0 login (Google installed-app loopback flow), identity/subscriptions/likes/ comments via the YouTube Data API v3, and search/recommendations via InnerTube. Includes a per-account Templates tab with a $description$ placeholder, platform-select wiring, and PyInstaller build support. The OAuth client secret is git-ignored (platforms/youtube/client_secret.json) so no credentials are committed; the bundled client constants are left empty for the maintainer to fill with a verified FastSM client. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Vendors the maintained youtube-search-python fork into platforms/youtube/vendor/youtubesearchpython so YouTube search, suggestions, and InnerTube metadata work without a PyPI dependency on the unmaintained upstream release. - A sys.path shim in platforms/youtube/__init__.py makes the vendored copy importable as the top-level `youtubesearchpython`, so existing imports work unchanged. - requirements.txt drops the youtube-search-python pin and adds its one runtime dependency, httpx. - build.py bundles the vendor tree (+ collect-all httpx) and adds the hidden imports PyInstaller can't trace through the runtime shim. - Upstream MIT LICENSE and a vendor README (attribution + rationale) are included. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
|
Follow-up: I vendored the search backend so this doesn't depend on the unmaintained
I verified the import resolves to the vendored copy (v1.6.2) and loads cleanly. Happy to drop the vendoring and go back to a plain PyPI dependency instead if you'd prefer that — whatever's easier for you to maintain. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! First off — I love FastSM. It's become my daily driver, and I really appreciate the work you put into it.
Since YouTube keeps drifting more and more toward being a social network (subscriptions, community posts, comments, likes), I thought I'd take a shot at adding it as a platform alongside Mastodon and Bluesky. Totally understand if it's not a direction you want to take the app — no hard feelings if you'd rather not merge it.
What this adds
$description$placeholder so YouTube posts render the way you want (default shows title + author; description is opt-in).Credentials / security
No secrets are committed. The OAuth client secret lives in
platforms/youtube/client_secret.json, which is git-ignored. The bundled client constants inoauth.pyare intentionally left empty for you to fill in with a verified FastSM Google client (or users can supply their own via prefs / a localclient_secret.json). The one hardcoded key ininnertube.pyis the public InnerTube key the YouTube web player ships to everyone, not a personal credential.Testing
I tested this end-to-end with a testing key (my own Google Cloud OAuth client) and it works — login, loading the account, subscriptions, search, and posting templates all function.
Happy to adjust anything or split it up if that's easier to review. Thanks for considering it!