go-rod / stealth

anti-bot-detection with rod
https://pkg.go.dev/github.com/go-rod/stealth
MIT License
253 stars 33 forks source link

Browser Being Bot Detected #21

Closed zumlex closed 2 years ago

zumlex commented 2 years ago

Looks like the PageSetBypassCSP no longer works, see below

image

But looks like there is also a bypass in the puppeteer-extra plugin https://github.com/berstend/puppeteer-extra/issues/668#issuecomment-1175197019

If I am wrong and this function is already available, how can we use ?

Thanks

steinathan commented 2 years ago

I'm still having this problem too, I'm trying to create a google meet bot to automatically join & record calls with MediaRecorder as an extension running in the background, but even using this plugin, google meet still detects it as a bot

package main

import (
    "time"

    "github.com/go-rod/rod"
    "github.com/go-rod/rod/lib/launcher"
    "github.com/go-rod/rod/lib/proto"

    "github.com/go-rod/stealth"
)

func main() {
    url := "https://meet.google.com/rck-cbnr-smb"

    l := launcher.New().Set("use-fake-ui-for-media-stream").Set("use-fake-device-for-media-stream").Headless(false).NoSandbox(true).Set("--allow-google-chromefile-access").Set("--lang", "en").Bin("/usr/bin/brave-browser").MustLaunch()
    browser := rod.New().ControlURL(l).MustConnect()

    page := stealth.MustPage(browser)

    proto.BrowserGrantPermissions{
        Origin:      "https://meet.google.com",
        Permissions: []proto.BrowserPermissionType{"camera", "microphone", "notifications"},
    }.Call(page)

    page.MustNavigate(url)
    page.MustWaitRequestIdle()

    //test
    time.Sleep(time.Second * 10)
    page.MustScreenshot("meet.png")

}

meet

ysmood commented 2 years ago

We don't need stealth to work with google products.

steinathan commented 2 years ago

Really? the actual problem is that Meet won't open & sees the head-full browser as a bot, even without the stealth I still get the message from google meet

ysmood commented 2 years ago

Works fine to me, might be your user-agent problem.

zumlex commented 2 years ago

Works fine to me, might be your user-agent problem.

Thank you.