Skip to content

Commit 523a7ba

Browse files
committed
Renamed project
1 parent 7b48c89 commit 523a7ba

6 files changed

Lines changed: 28 additions & 28 deletions

File tree

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# To use this file, copy it to `.env` and update and/or add your own values.
22
# Be sure to read the `Environment Variables` section in the README.
3-
# Website to capture and stream
4-
WEBSITE_URL=https://example.com
3+
# Webpage to capture and stream
4+
WEBPAGE_URL=https://example.com
55
# RTMP endpoint to stream to
66
RTMP_URL=rtmp://localhost:1935/live/stream
77
# Output resolution (720p, 1080p, or 2k)

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Stream Website Container
1+
# Stream Webpage Container
22

3-
A containerized application to stream a webpage live over RTMP. Just pass a `WEBSITE_URL` and a `RTMP_URL` and the container will open a browser, capture the video and audio, and send it to the specified location. It can even be configured to automatically restart the stream for supported services.
3+
A containerized application to stream a webpage live over RTMP. Just pass a `WEBPAGE_URL` and a `RTMP_URL` and the container will open a browser, capture the video and audio, and send it to the specified location. It can even be configured to automatically restart the stream for supported services.
44

55
## Uses
66

@@ -40,13 +40,13 @@ You can then use a program like VLC to view the stream to ensure it works (use `
4040

4141
```bash
4242
# Build the image
43-
docker build -t stream-website .
43+
docker build -t stream-webpage .
4444

4545
# Run the container
46-
docker run -e WEBSITE_URL="https://example.com" \
46+
docker run -e WEBPAGE_URL="https://example.com" \
4747
-e RTMP_URL="rtmp://your-server/live/stream" \
4848
-e RESOLUTION="1080p" \
49-
stream-website
49+
stream-webpage
5050
```
5151

5252
> [!WARNING]
@@ -122,10 +122,10 @@ To enable status checking for Twitch, provide a `TWITCH_CHANNEL`, `TWITCH_CLIENT
122122
- Twitch Client ID obtained from the [Twitch Developer Console](https://dev.twitch.tv/console) for checking stream status if the `TWITCH_CHANNEL` environmental variable is set.
123123
- Checking for the stream status on Twitch will not work without this and `TWITCH_CLIENT_ID` being set.
124124
- For more information about registering an app on Twitch, see [the developer documentation](https://dev.twitch.tv/docs/authentication/register-app/).
125-
- `WEBSITE_URL`
125+
- `WEBPAGE_URL`
126126
- String
127127
- Default: `https://google.com`
128-
- The website to stream.
128+
- The webpage to stream.
129129

130130
## About
131131

cmd/main.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ import (
2121
"go.uber.org/zap"
2222
"go.uber.org/zap/zapio"
2323

24-
"github.com/Zozman/stream-website/twitch"
25-
"github.com/Zozman/stream-website/utils"
24+
"github.com/Zozman/stream-webpage-container/twitch"
25+
"github.com/Zozman/stream-webpage-container/utils"
2626
)
2727

2828
const (
2929
// Default resoltion for streams sent by the application
3030
DefaultResolution = "720p"
3131
// Default RTMP URL to stream to
3232
DefaultRTMPURL = "rtmp://localhost:1935/live/stream"
33-
// Default website to capture
34-
DefaultWebsiteURL = "https://google.com"
33+
// Default webpage to capture
34+
DefaultWebpageURL = "https://google.com"
3535
// Default framerate for the stream
3636
DefaultFramerate = "30"
3737
// Default cron string for checking stream status
@@ -142,7 +142,7 @@ func StopCurrentStream(ctx context.Context) {
142142
// Struct representing the configuration for the stream
143143
type Config struct {
144144
// The URL of the webstie to stream
145-
WebsiteURL string
145+
WebpageURL string
146146
// The RTMP URL to stream to
147147
RTMPURL string
148148
// The resolution of the stream
@@ -171,8 +171,8 @@ func main() {
171171
logger.Fatal("Failed to load configuration", zap.Error(err))
172172
}
173173

174-
logger.Debug("Starting website stream capture",
175-
zap.String("website", config.WebsiteURL),
174+
logger.Debug("Starting webpage stream capture",
175+
zap.String("webpage", config.WebpageURL),
176176
zap.String("rtmp", config.RTMPURL),
177177
zap.String("resolution", config.Resolution),
178178
zap.String("framerate", config.Framerate),
@@ -235,7 +235,7 @@ func main() {
235235
// This will be triggered by the cron job or manual restarts
236236
default:
237237
logger.Info("Starting/restarting stream...")
238-
if err := streamWebsite(ctx, config); err != nil {
238+
if err := streamWebpage(ctx, config); err != nil {
239239
if ctx.Err() != nil {
240240
logger.Info("Stream stopped due to context cancellation")
241241
return
@@ -271,7 +271,7 @@ func loadConfig(ctx context.Context) (*Config, error) {
271271
logger := utils.GetLoggerFromContext(ctx)
272272

273273
config := &Config{
274-
WebsiteURL: utils.GetEnvOrDefault("WEBSITE_URL", DefaultWebsiteURL),
274+
WebpageURL: utils.GetEnvOrDefault("WEBPAGE_URL", DefaultWebpageURL),
275275
RTMPURL: utils.GetEnvOrDefault("RTMP_URL", DefaultRTMPURL),
276276
Resolution: utils.GetEnvOrDefault("RESOLUTION", DefaultResolution),
277277
Framerate: utils.GetEnvOrDefault("FRAMERATE", DefaultFramerate),
@@ -312,8 +312,8 @@ func loadConfig(ctx context.Context) (*Config, error) {
312312
return config, nil
313313
}
314314

315-
// Function to stream the specified website using Chrome and FFmpeg
316-
func streamWebsite(ctx context.Context, config *Config) error {
315+
// Function to stream the specified webpage using Chrome and FFmpeg
316+
func streamWebpage(ctx context.Context, config *Config) error {
317317
logger := utils.GetLoggerFromContext(ctx)
318318

319319
// Check if a stream is already running and stop it
@@ -356,14 +356,14 @@ func streamWebsite(ctx context.Context, config *Config) error {
356356
chromeCtx, chromeCancel := chromedp.NewContext(allocCtx)
357357
defer chromeCancel()
358358

359-
// Start Chrome and navigate to website
360-
logger.Info("Starting Chrome browser", zap.String("url", config.WebsiteURL))
359+
// Start Chrome and navigate to webpage
360+
logger.Info("Starting Chrome browser", zap.String("url", config.WebpageURL))
361361

362362
if err := chromedp.Run(chromeCtx,
363-
chromedp.Navigate(config.WebsiteURL),
363+
chromedp.Navigate(config.WebpageURL),
364364
chromedp.WaitVisible("body", chromedp.ByQuery),
365365
); err != nil {
366-
return fmt.Errorf("failed to navigate to website: %v", err)
366+
return fmt.Errorf("failed to navigate to webpage: %v", err)
367367
}
368368

369369
// Wait a moment for the page to fully load

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
services:
2-
stream-website:
2+
stream-webpage:
33
build: .
44
environment:
55
- FRAMERATE=${FRAMERATE:-60}
@@ -12,7 +12,7 @@ services:
1212
- TWITCH_CHANNEL=${TWITCH_CHANNEL}
1313
- TWITCH_CLIENT_ID=${TWITCH_CLIENT_ID}
1414
- TWITCH_CLIENT_SECRET=${TWITCH_CLIENT_SECRET}
15-
- WEBSITE_URL=${WEBSITE_URL:-https://google.com}
15+
- WEBPAGE_URL=${WEBPAGE_URL:-https://google.com}
1616
ports:
1717
- "${PORT:-8080}:${PORT:-8080}"
1818

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/Zozman/stream-website
1+
module github.com/Zozman/stream-webpage-container
22

33
go 1.24
44

twitch/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/nicklaw5/helix/v2"
99

10-
"github.com/Zozman/stream-website/utils"
10+
"github.com/Zozman/stream-webpage-container/utils"
1111
)
1212

1313
var (

0 commit comments

Comments
 (0)