Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code change in overrideCodecs method is causing bot detection #37

Closed
dekelev opened this issue Jul 19, 2022 · 6 comments
Closed

Code change in overrideCodecs method is causing bot detection #37

dekelev opened this issue Jul 19, 2022 · 6 comments
Labels
bug Something isn't working.

Comments

@dekelev
Copy link

dekelev commented Jul 19, 2022

Code change in overrideCodecs method from fingerprint-injector v2 is causing bot detection.
Using fingerprint-injector v2 with the code from v1 works just fine.

To Reproduce
Load nuwber.com

Expected behavior
Website should load, but instead it blocks the session with anti-bot error.

System information:

  • OS: MacOS
  • Node.js v16.14.0

Additional context
Here's the affected code (v2 on the left):

image

@dekelev dekelev added the bug Something isn't working. label Jul 19, 2022
@barjin
Copy link
Collaborator

barjin commented Jul 21, 2022

Thank you for submitting this issue!

Nuwber.com is a funny website - I'm getting blocked with my regular Firefox-Linux setup without any fingerprint hiding tricks. IIRC the previous code actually did nothing (the codec names had different formats) - now, with the (partial) codec injection in place, this might be related to the MediaSource API issue.

I'll try to experiment some more and get back to this once we'll know more. In the meantime, feel free to fork this project and build your own version with the overrideCodecs line commented :)

@B4nan
Copy link
Member

B4nan commented Jul 21, 2022

feel free to fork this project and build your own version with the overrideCodecs line commented :)

Or better, just use https://github.com/ds300/patch-package

@dekelev
Copy link
Author

dekelev commented Jul 21, 2022

Thank you! I've already forked the injector for this purpose, so no pressure.

Some websites do block any Linux based OS using on the SSL fingerprint, so unless you're masking it like Windows or Mac, you might get blocked just for that.

I'll try to make some time available to debug the MediaSource API issue. I wasn't aware that it wasn't actually working in v1 and that it might also be injected by other libraries.

@dekelev
Copy link
Author

dekelev commented Aug 19, 2022

I can confirm that changing this line in utils.js:

throw new Error(`Codec ${codecString} not found in ${JSON.stringify(codecs)}`);

to return false solves the issue and passes the anti-bot detection.

The canPlayType method was not designed to throw an error:
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_av_met_canplaytype

@barjin
Copy link
Collaborator

barjin commented Aug 22, 2022

@dekelev thank you for the research! The change you mentioned is now in the stable branch - and published in [email protected]. While nuwber.com still doesn't load for me, I noticed better performance with other pages and fingerprinting services.

Feel free to test out the latest version and let us know, whether it solved your problem. Sorry for the wait!

@dekelev
Copy link
Author

dekelev commented Aug 22, 2022

Thanks @barjin! For me, as long as no error was thrown from that method, nuwber worked fine, even with the fingerprint-injector v1 code, where it wasn't really injected well. I'm not sure what could be the other difference between us that have affect here. They don't check for SSL fingerprint BTW.

@dekelev dekelev closed this as completed Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

3 participants