lexiforest / curl_cffi

Python binding for curl-impersonate fork via cffi. A http client that can impersonate browser tls/ja3/http2 fingerprints.
https://curl-cffi.readthedocs.io/
MIT License
2.49k stars 265 forks source link

Curl-Cffi TLS support for chrome on Android devices #427

Open vishshaz opened 2 weeks ago

vishshaz commented 2 weeks ago

The question

Documentation suggestion

There is limited support in the documentation for Chrome Android.

lexiforest commented 2 weeks ago

Visit some fingerprints sites with your mobile chrome, you will find out that Chrome on Android shares the same fingerprints with the corresponding version on desktop. All you have to do is to change the UA. There is no plan of extending the support, since they are already there.

vishshaz commented 2 weeks ago

Visit some fingerprints sites with your mobile chrome, you will find out that Chrome on Android shares the same fingerprints with the corresponding version on desktop. All you have to do is to change the UA. There is no plan of extending the support, since they are already there.

@lexiforest Appreciate the quick turn around. Thank you. If my understanding is correct, what you are suggesting here is to use chrome124 with a mobile User Agent, correct? _If this is the case, to mimic safari for iOS, should I proceed to use safari17_2_ios with iOS user-agents or safari17_0 (or its previous versions such as safari15_3)?_

What about the support for chrome versions beyond v124 such as v130? As far as my testing goes, they have different fingerprints.

lexiforest commented 2 weeks ago

use chrome124 with a mobile User Agent, correct?

Yes.

to mimic safari for iOS, should I proceed to use safari17_2_ios

Yes.

chrome versions beyond v124 such as v130

Please refer to the README, last time I checked, their fingerprints did not change. "Browser versions will be added only when their fingerprints change. If you see a version, e.g. chrome122, were skipped, you can simply impersonate it with your own headers and the previous version."

vishshaz commented 2 weeks ago

use chrome124 with a mobile User Agent, correct?

Yes.

to mimic safari for iOS, should I proceed to use safari17_2_ios

Yes.

chrome versions beyond v124 such as v130

Please refer to the README, last time I checked, their fingerprints did not change. "Browser versions will be added only when their fingerprints change. If you see a version, e.g. chrome122, were skipped, you can simply impersonate it with your own headers and the previous version."

Understood. Appreciate you talking time to respond to my queries. Thank you.

lexiforest commented 2 weeks ago

I got report from another user yesterday, the fingerprints of Chrome 130 on Windows did change, although the macOS one stays the same. It will be updated soon.

lexiforest commented 2 weeks ago

I guess you can check the fingerprints of Chrome on Android to be sure, maybe it also differs from the one on macOS.

vishshaz commented 2 weeks ago

I got report from another user yesterday, the fingerprints of Chrome 130 on Windows did change, although the macOS one stays the same. It will be updated soon.

So what you are saying is that the fingerprint of Chrome v130 is different to the that of v124-v129 For Windows, but the fingerprint for Chrome v124-v130 currently remains the same on macOS?

vishshaz commented 2 weeks ago

I guess you can check the fingerprints of Chrome on Android to be sure, maybe it also differs from the one on macOS.

If the fingerprint for Chrome on Windows and macOS are different, won't it then be a problem to use Chrome on Android with a mobile user-agent using something like chrom124 (this is just an example), as mentioned by you in the comment above?

lexiforest commented 2 weeks ago

It could be, I guess you have to find out yourself, as I don't have an android device at hand.

vishshaz commented 2 weeks ago

It could be, I guess you have to find out yourself, as I don't have an android device at hand.

Sure. I will verify this with an android device. This being said, if it indeed is the case where the fingerprints for the same version of chrome for desktop and mobile are different, then we cannot continue using the chrome desktop impersonate for mobile devices with a mobile user-agent, correct? What then should the approach be?

vishshaz commented 2 weeks ago

Here is the fingerprint for an android device for chrome v130:

{ "user_agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/[130.0.0.0](http://130.0.0.0/) Mobile Safari/537.36", "ja3_hash": "365939c7e06e536921d3a66ecea5b5f4", "ja3_text": "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,11-35-10-45-43-23-13-5-65037-27-65281-17513-0-51-16-18,29-23-24,0", "ja3n_hash": "473f0e7c0b6a0f7b049072f4e683068b", "ja3n_text": "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,0-5-10-11-13-16-18-23-27-35-43-45-51-17513-65037-65281,29-23-24,0", "ja4": "t13d1516h2_8daaf6152771_02713d6af862", "ja4_r": "t13d1516h2_002f,0035,009c,009d,1301,1302,1303,c013,c014,c02b,c02c,c02f,c030,cca8,cca9_0005,000a,000b,000d,0012,0017,001b,0023,002b,002d,0033,4469,fe0d,ff01_0403,0804,0401,0503,0805,0501,0806,0601", "ja4_o": "t13d1516h2_acb858a92679_7b625652c0a4", "ja4_ro": "t13d1516h2_1301,1302,1303,c02b,c02f,c02c,c030,cca9,cca8,c013,c014,009c,009d,002f,0035_000b,0023,000a,002d,002b,0017,000d,0005,fe0d,001b,ff01,4469,0000,0033,0010,0012_0403,0804,0401,0503,0805,0501,0806,0601", "akamai_hash": "52d84b11737d980aef856699f885ca86", "akamai_text": "1:65536;2:0;4:6291456;6:262144|15663105|0|m,a,s,p" }

The fingerprint for macOS chrome v130:

{ "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36", "ja3_hash": "78d450322efcbf3f5d2d92f9d7769566", "ja3_text": "771,49199-49171-49191-49200-49172-49192-156-47-60-157-53-61-65-132-49195-49324-49326-49161-49187-49196-49325-49327-49162-49188-158-51-103-159-57-107-69-136-4865-4866-255,0-10-11-13-23-43-51,23-29-24-256-257-258,0", "ja3n_hash": "78d450322efcbf3f5d2d92f9d7769566", "ja3n_text": "771,49199-49171-49191-49200-49172-49192-156-47-60-157-53-61-65-132-49195-49324-49326-49161-49187-49196-49325-49327-49162-49188-158-51-103-159-57-107-69-136-4865-4866-255,0-10-11-13-23-43-51,23-29-24-256-257-258,0", "ja4": "t13d350700_98f6b5ae8975_e74d7d97755c", "ja4_r": "t13d350700_002f,0033,0035,0039,003c,003d,0041,0045,0067,006b,0084,0088,009c,009d,009e,009f,00ff,1301,1302,c009,c00a,c013,c014,c023,c024,c027,c028,c02b,c02c,c02f,c030,c0ac,c0ad,c0ae,c0af_000a,000b,000d,0017,002b,0033_0401,0804,0403,0501,0805,0503,0601,0806,0603", "ja4_o": "t13d350700_f6fb28e5a594_070f1dc89d25", "ja4_ro": "t13d350700_c02f,c013,c027,c030,c014,c028,009c,002f,003c,009d,0035,003d,0041,0084,c02b,c0ac,c0ae,c009,c023,c02c,c0ad,c0af,c00a,c024,009e,0033,0067,009f,0039,006b,0045,0088,1301,1302,00ff_0000,000a,000b,000d,0017,002b,0033_0401,0804,0403,0501,0805,0503,0601,0806,0603", "akamai_hash": "", "akamai_text": "" }

vishshaz commented 1 week ago

It could be, I guess you have to find out yourself, as I don't have an android device at hand.

This being said, if it indeed is the case where the fingerprints for the same version of chrome for desktop and mobile are different, then we cannot continue using the chrome desktop impersonate for mobile devices with a mobile user-agent, correct? What then should the approach be?

Any suggestions to this problem @lexiforest ?