lieuwex / whapp-irc

whatsapp web <-> irc gateway
GNU General Public License v3.0
205 stars 14 forks source link

Lighter headless browser #25

Open surskitt opened 6 years ago

surskitt commented 6 years ago

I've been using this, running the desktop on my PC and it really is excellent. Works far better than I ever thought possible, best solution of its type I've used by far. However, I'd normally like to run this on my AWS EC2 instance where my znc bouncer lives, but unfortunately it seems to be way too heavy to run on there.

Sorry to ask for something that would probably require a large overhaul, but would it be possible to look into using a lighter headless browser? The worry is that whatsapp web might insist on having one of the three main browsers, which I have a feeling might actually be the case.

If not though, would maybe something like webloop over chromedp (which I assume you're using) end up with a more lightweight instance? I really don't know what would be compatible with both the javascript needed to run whatsapp web and whatever whatsapp requirements are though.

Thanks again!

lieuwex commented 5 years ago

Thank you!

I can take a look at something like webloop, like you propose. But indeed I'm afraid it is too basic to be able to handle WhatsApp web. I'm kinda interested in dumping the whole headless browser thing as a whole and do something like https://github.com/sigalor/whatsapp-web-reveng. But this is of course a huge overhaul, but skimming their readme it seems like they're making a good amount of progress.

I will take a look first if a headless browser would be an option, but it's not really a big priority for me since I run it on my homeserver. Of course you're encouraged to experiment yourself if you need it quicker :) You at need least to spoof the user-agent, WhatsApp web didn't even accept the headless chromium UA (therefore I'm using a mac UA).

surskitt commented 5 years ago

Ah, that's a shame. Yeah unfortunately I had to pose the suggestion without knowing how realistic it was.

I didn't know about whatsapp-web-reveng, it does look really interesting. Hopefully it's not in that moral grey area that yowsup is in, but if it's reverse engineering the web protocol rather than at a lower level then it may be fine to use. Also, it's not going to get far if whatsapp start forcing the game of cat and mouse that have caused other app developers to abandon projects.

I would give it a try but I'd have to learn go first...

lieuwex commented 5 years ago

Hmm yeah for now the internal API seems to be pretty stable, but of course they change that approach if third party clients are becoming too popular. If you're interested in other bridges https://github.com/tulir/mautrix-whatsapp looks really awesome, definitely something I'm planning to use in the future. But I guess the default matrix homeserver (synapse) is still pretty heavy, so I don't know if that's really better than running whapp-irc, but it might be.

jkaberg commented 5 years ago

@sharktamer what about https://github.com/Rhymen/go-whatsapp ?