From 317f4d7fbaf7f7921e9cf3a7b425ebae9d26303a Mon Sep 17 00:00:00 2001 From: Max Nuding Date: Tue, 1 Jul 2025 20:22:57 +0200 Subject: [PATCH] add documentation for youtube playlist integration --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index af82c72..509eaba 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ and set your `User`, `Group`, `ExecStart` and `WorkingDirectory` accordingly. Copy `.env.EXAMPLE` to `.env` and add your `YOUTUBE_API_KEY` and `ODESLI_API_KEY`. To obtain one follow [YouTube's guide](https://developers.google.com/youtube/registering_an_application) to create an _API key_. -If `YOUTUBE_API_KEY` is unset, no playlist will be updated. Also, _all_ YouTube links will be treated as music videos, +If `YOUTUBE_API_KEY` is unset _all_ YouTube links will be treated as music videos, because the API is the only way to check if a YouTube link leads to music or something else. If `ODESLI_API_KEY` is unset, your rate limit to the song.link API will be lower. @@ -106,10 +106,15 @@ If `ODESLI_API_KEY` is unset, your rate limit to the song.link API will be lower Add `MASTODON_ACCESS_TOKEN` as well, see [Creating our application ](https://docs.joinmastodon.org/client/token/#app) in the Mastodon documentation. -`read:statuses` is the only required scope. An access token will be displayed in your settings. Use that! +`read:statuses` and `read:search` the only required scope. An access token will be displayed in your settings. Use that! There are currently no plans to implement an actual authentication flow. +If you want the app to save the songs it encounters into a playlist, YouTube requires OAuth 2.0 credentials. +Once again, follow [YouTube's guide](https://developers.google.com/youtube/registering_an_application) and the OAuth 2.0 described there +to obtain a clientId and clientSecret. Add the values as `YOUTUBE_CLIENT_ID` and `YOUTUBE_CLIENT_SECRET`. +Create a playlist and configure its ID as `YOUTUBE_PLAYLIST_ID`. + Run `npm run build` and copy the output folder, usually `build` to `$APP_DIR` on your server. #### On your server again @@ -125,6 +130,9 @@ Verify that everything is okay with `service moshing-mammut status`. The app should now be reachable on http://localhost:3000 or whatever you configured your domain to be! +If you want to add the songs available on YouTube to a playlist and have configured the environment variables to do so, +you now need to visit `/ytauth`, e.g. `http://localhost:3000/ytauth`. This will obtain the necessary access tokens from Google. + # Icons Favicon is a combination of [speaker-line by remix icon](https://remixicon.com/icon/speaker-line)