Spring Boot and Angular app to expose unlisted YouTube streams on your own terms on your own server.
in the src/main/angular directory run
npm installng buildthen run./gradlew buildin the root directory
(npm and angular-cli required)
run ./gradlew bootRun to try it out with dummy data
- enable the youtube API:
set
app.youtube.enabledtotruein the application.yaml - configure Google OAuth 2.0 credentials:
in the application.yaml, set the properties
app.youtube.client_idandapp.youtube.client_secret - configure a refresh token:
run the app with
./gradlew bootRunand visit http://localhost:8080/setup to get an Authentication Code.
With that Auth Code go to http://localhost:8080/setup?authCode=<auth_code> to get the refresh token.
Then set theapp.youtube.refresh_tokenproperty in the application.yaml accordingly.
From then on, you can run the app via ./gradlew bootRun -Pargs=--app.youtube.enabled=true,--app.youtube.refresh_token=<token>
which will disable the setup endpoint and enable the YouTube API to retrieve active and completed streams.
build and run the docker image as usual:
- to build execute
docker build -t streams . - run it with
docker run -d -P --name=streams streams
create a file named application-secrets.yaml with the following properties with the correct values:
# secret properties
app:
youtube:
enabled: true
client_id: GOOGLE_OAUTH_CLIENT_ID
client_secret: GOOGLE_OAUTH_CLIENT_SECRET
refresh_token: GOOGLE_OAUTH_REFRESH_TOKEN
to get the correct values, follow the steps from above.
run the docker container mounting the application-secrets.yaml into the /secrets folder inside the container:
docker run -d -P -v /absolute/path/to/application-secrets.yaml:/secrets/application-secrets.yaml --name=streams streams