go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.
https://go-rod.github.io
MIT License
5.43k stars 357 forks source link

[bug]: "Couldn't lanch browser" in Termux. #1147

Open OXY2DEV opened 6 days ago

OXY2DEV commented 6 days ago

I am trying to use vhs, and when running it I get this error.

could not launch browser: can't find a browser binary for your OS, the doc might help https://go-rod.github.io/#/compatibility?id=os : Not able to find a valid URL to download [https://storage.googleapis.com/chromium-browser-snapshots//1321438/ https://registry.npmmirror.com/-/binary/chromium-browser-snapshots//1321438/ https://playwright.azureedge.net/builds/chromium/1321438/chromium-linux-arm64.zip]
recording failed

I already have chromium-browser installed. I also have tried this inside proot(arch).

Am I missing something? Or is there some kind of bug thats causing this issue?

Version used:

ysmood commented 6 days ago

You can specify the installed browser path manually:

https://github.com/go-rod/rod/blob/ab8740f76fca9fbcc138abab51afaead37f38e4a/lib/launcher/example_test.go#L15

OXY2DEV commented 6 days ago

That fixed the issue.

But this is weird. There was a merged PR that added Termux support.

And browser.go file seem to have chromium-browser in it. So, why wasn't it getting picked up?

OXY2DEV commented 6 days ago

Relevant line: browser.go#L222.

Relevant PR: #808

ysmood commented 6 days ago

Maybe the for termux there will be multiple locations for the binary, could you make a PR to fix it?

OXY2DEV commented 6 days ago

The problem is, the PR should've solved the problem.

To check where chromium is I ran this,

> whereis chromium-browser
chromium-browser: /data/data/com.termux/files/usr/bin/chromium-browser

This path is already in here. So, why is it being skipped?

I thought it was an issue with my $PATH, but even after fixing that I still get that error.