From 7541b977ff3c8ad0f3ff699c1ef3a880dc1a9360 Mon Sep 17 00:00:00 2001 From: HeapOfChaos Date: Sun, 23 Mar 2025 02:04:19 -0400 Subject: [PATCH] Added Ability to add CloudFlare Cookie --- chaturbate/channel.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chaturbate/channel.go b/chaturbate/channel.go index 7ce4ea3..892e4f0 100644 --- a/chaturbate/channel.go +++ b/chaturbate/channel.go @@ -27,6 +27,8 @@ type Channel struct { filenamePattern string LastStreamedAt string Interval int + CFCookie string + UserAgent string Framerate int Resolution int ResolutionFallback string @@ -60,6 +62,7 @@ type Channel struct { // Run func (w *Channel) Run() { + if w.Username == "" { w.log(logTypeError, "username is empty, use `-u USERNAME` to specify") return @@ -98,7 +101,10 @@ func (w *Channel) Run() { w.log(logTypeError, "release file: %w", err) } } - + if strings.Contains(body, "Just a moment...") { + w.log(logTypeError, "Cloudflare anti-bot page detected, Try providing cf-cookie and user-agent (Check GitHub for instructions)... Exiting") + os.Exit(1) + } w.log(logTypeInfo, "channel is offline, check again %d min(s) later", w.Interval) <-time.After(time.Duration(w.Interval) * time.Minute) // minutes cooldown to check online status }