JacobLinCool / recaptcha-solver

Solve reCAPTCHA challenges by using offline speech recognition.
MIT License
27 stars 14 forks source link

Replace vosk-lib with vosk-koffi #8

Closed tocha688 closed 5 months ago

tocha688 commented 6 months ago

vosk-koffi is based on koffi while vosk-lib is based on ffi-napi, and it is well known that ffi-napi has a lot of problems.

changeset-bot[bot] commented 6 months ago

⚠️ No Changeset found

Latest commit: 9ca8b2dc99eac4d10f8464d9909238c1bca24c91

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

tocha688 commented 6 months ago

vosk-koffi does not require the python environment to be installed and other additional environments

JacobLinCool commented 6 months ago

Hello @tocha688,

You are right; ffi-napi is problematic, and node-gyp is frustrating.

I wasn't aware of koffi before, but it appears to offer much better performance and usability than ffi-napi, which is excellent!

I just looked into your vosk-koffi, and it seems that the package size is quite large compared to vosk-lib because it bundles the shared libraries for three platforms into one package. I think using a post-install script to download platform-dependent libraries from the official release could significantly reduce the package size. Additionally, I would prefer not to include and use binaries from an unknown source, which is a terrible idea. Please use the officially released ones or have trackable ways to build them (such as using GitHub Actions...).

After these problems are solved, we can definitely replace vosk-lib with vosk-koffi.

Also, this package uses pnpm as its package manager during development. Please remove the yarn.lock file and update the pnpm-lock.yaml file.

Thanks.

k725 commented 5 months ago

@JacobLinCool

node-ffi-napi, which vosk-lib depends on, is completely broken in the latest version of Node 22. ^1 Personally, I think this PR proposal is good. (Currently, I think it is unavoidable that the bundle size will increase.) I'm also looking forward to the new version being published to npm.

JacobLinCool commented 5 months ago

@k725

It seems that @tocha688 has done something to reduce the package size.

I am going to merge this.

JacobLinCool commented 5 months ago

Released with v0.3.0